The reference to a custom template for the day.
\nAllows to completely override the way a day 'cell' in the calendar is displayed.
\nThe number of months to display.
"
- },
- {
- "name": "firstDayOfWeek",
- "type": "number",
- "description": "The first day of the week.
\nWith default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.
"
- },
- {
- "name": "footerTemplate",
- "type": "TemplateRef",
- "description": "The reference to the custom template for the datepicker footer.
",
- "since": {
- "version": "3.3.0",
- "description": ""
- }
- },
- {
- "name": "markDisabled",
- "type": "(date: NgbDate, current: { year: number; month: number; }) => boolean",
- "description": "The callback to mark some dates as disabled.
\nIt is called for each new date when navigating to a different month.
\ncurrent
is the month that is currently displayed by the datepicker.
"
- },
- {
- "name": "maxDate",
- "type": "NgbDateStruct",
- "description": "The latest date that can be displayed or selected.
\nIf not provided, 'year' select box will display 10 years after the current month.
"
- },
- {
- "name": "minDate",
- "type": "NgbDateStruct",
- "description": "The earliest date that can be displayed or selected.
\nIf not provided, 'year' select box will display 10 years before the current month.
"
- },
- {
- "name": "navigation",
- "type": "\"select\" | \"arrows\" | \"none\"",
- "description": "Navigation type.
\n\n"select"
- select boxes for month and navigation arrows \n"arrows"
- only navigation arrows \n"none"
- no navigation visible at all \n "
- },
- {
- "name": "outsideDays",
- "type": "\"visible\" | \"collapsed\" | \"hidden\"",
- "description": "The way of displaying days that don't belong to the current month.
\n\n"visible"
- days are visible \n"hidden"
- days are hidden, white space preserved \n"collapsed"
- days are collapsed, so the datepicker height might change between months \n \nFor the 2+ months view, days in between months are never shown.
"
- },
- {
- "name": "showWeekdays",
- "type": "boolean",
- "description": "If true
, weekdays will be displayed.
"
- },
- {
- "name": "showWeekNumbers",
- "type": "boolean",
- "description": "If true
, week numbers will be displayed.
"
- },
- {
- "name": "startDate",
- "type": "{ year: number; month: number; day?: number; }",
- "description": "The date to open calendar with.
\nWith the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\nIf nothing or invalid date is provided, calendar will open with current month.
\nYou could use navigateTo(date)
method as an alternative.
"
- }
- ],
- "outputs": [
- {
- "name": "navigate",
- "description": "An event emitted right before the navigation happens and displayed month changes.
\nSee NgbDatepickerNavigateEvent
for the payload info.
"
- },
- {
- "name": "select",
- "description": "An event emitted when user selects a date using keyboard or mouse.
\nThe payload of the event is currently selected NgbDate
.
"
- }
- ],
- "properties": [
- {
- "name": "model",
- "type": "DatepickerViewModel",
- "description": ""
- },
- {
- "name": "onChange",
- "type": "(_: any) => void",
- "description": ""
- },
- {
- "name": "onTouched",
- "type": "() => void",
- "description": ""
- }
- ],
- "methods": [
- {
- "name": "navigateTo",
- "description": "Navigates to the provided date.
\nWith the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.\nIf nothing or invalid date provided calendar will open current month.
\nUse the [startDate]
input as an alternative.
",
- "args": [
- {
- "name": "date",
- "type": "{ year: number; month: number; day?: number; }"
- }
- ],
- "returnType": "void"
- }
- ]
- },
- "NgbCalendar": {
- "fileName": "src/datepicker/ngb-calendar.ts",
- "className": "NgbCalendar",
- "description": "A service that represents the calendar used by the datepicker.
\nThe default implementation uses the Gregorian calendar. You can inject it in your own\nimplementations if necessary to simplify NgbDate
calculations.
",
- "type": "Service",
- "methods": [
- {
- "name": "getDaysPerWeek",
- "description": "Returns the number of days per week.
",
- "args": [],
- "returnType": "number"
- },
- {
- "name": "getMonths",
- "description": "Returns an array of months per year.
\nWith default calendar we use ISO 8601 and return [1, 2, ..., 12];
",
- "args": [
- {
- "name": "year",
- "type": "number"
- }
- ],
- "returnType": "number[]"
- },
- {
- "name": "getWeeksPerMonth",
- "description": "Returns the number of weeks per month.
",
- "args": [],
- "returnType": "number"
- },
- {
- "name": "getWeekday",
- "description": "Returns the weekday number for a given day.
\nWith the default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun
",
- "args": [
- {
- "name": "date",
- "type": "NgbDate"
- }
- ],
- "returnType": "number"
- },
- {
- "name": "getNext",
- "description": "Adds a number of years, months or days to a given date.
\n\nperiod
can be y
, m
or d
and defaults to day. \nnumber
defaults to 1. \n \nAlways returns a new date.
",
- "args": [
- {
- "name": "date",
- "type": "NgbDate"
- },
- {
- "name": "period",
- "type": "NgbPeriod"
- },
- {
- "name": "number",
- "type": "number"
- }
- ],
- "returnType": "NgbDate"
- },
- {
- "name": "getPrev",
- "description": "Subtracts a number of years, months or days from a given date.
\n\nperiod
can be y
, m
or d
and defaults to day. \nnumber
defaults to 1. \n \nAlways returns a new date.
",
- "args": [
- {
- "name": "date",
- "type": "NgbDate"
- },
- {
- "name": "period",
- "type": "NgbPeriod"
- },
- {
- "name": "number",
- "type": "number"
- }
- ],
- "returnType": "NgbDate"
- },
- {
- "name": "getWeekNumber",
- "description": "Returns the week number for a given week.
",
- "args": [
- {
- "name": "week",
- "type": "NgbDate[]"
- },
- {
- "name": "firstDayOfWeek",
- "type": "number"
- }
- ],
- "returnType": "number"
- },
- {
- "name": "getToday",
- "description": "Returns the today's date.
",
- "args": [],
- "returnType": "NgbDate"
- },
- {
- "name": "isValid",
- "description": "Checks if a date is valid in the current calendar.
",
- "args": [
- {
- "name": "date",
- "type": "NgbDate"
- }
- ],
- "returnType": "boolean"
- }
- ],
- "properties": []
- },
- "NgbDateParserFormatter": {
- "fileName": "src/datepicker/ngb-date-parser-formatter.ts",
- "className": "NgbDateParserFormatter",
- "description": "An abstract service for parsing and formatting dates for the\nNgbInputDatepicker
directive.\nConverts between the internal NgbDateStruct
model presentation and a string
that is displayed in the\ninput element.
\nWhen user types something in the input this service attempts to parse it into a NgbDateStruct
object.\nAnd vice versa, when users selects a date in the calendar with the mouse, it must be displayed as a string
\nin the input.
\nDefault implementation uses the ISO 8601 format, but you can provide another implementation via DI\nto use an alternative string format or a custom parsing logic.
\nSee the date format overview for more details.
",
- "type": "Service",
- "methods": [
- {
- "name": "parse",
- "description": "Parses the given string
to an NgbDateStruct
.
\nImplementations should try their best to provide a result, even\npartial. They must return null
if the value can't be parsed.
",
- "args": [
- {
- "name": "value",
- "type": "string"
- }
- ],
- "returnType": "NgbDateStruct"
- },
- {
- "name": "format",
- "description": "Formats the given NgbDateStruct
to a string
.
\nImplementations should return an empty string if the given date is null
,\nand try their best to provide a partial result if the given date is incomplete or invalid.
",
- "args": [
- {
- "name": "date",
- "type": "NgbDateStruct"
- }
- ],
- "returnType": "string"
- }
- ],
- "properties": []
- },
- "NgbDateStruct": {
- "fileName": "src/datepicker/ngb-date-struct.ts",
- "className": "NgbDateStruct",
- "description": "An interface of the date model used by the datepicker.
\nAll datepicker APIs consume NgbDateStruct
, but return NgbDate
.
\nSee the date format overview for more details.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "day",
- "type": "number",
- "description": "The day of month, starting at 1
"
- },
- {
- "name": "month",
- "type": "number",
- "description": "The month, for example 1=Jan ... 12=Dec
"
- },
- {
- "name": "year",
- "type": "number",
- "description": "The year, for example 2016
"
- }
- ]
- },
- "NgbDate": {
- "fileName": "src/datepicker/ngb-date.ts",
- "className": "NgbDate",
- "description": "A simple class that represents a date that datepicker also uses internally.
\nIt is the implementation of the NgbDateStruct
interface that adds some convenience methods,\nlike .equals()
, .before()
, etc.
\nAll datepicker APIs consume NgbDateStruct
, but return NgbDate
.
\nIn many cases it is simpler to manipulate these objects together with\nNgbCalendar
than native JS Dates.
\nSee the date format overview for more details.
",
- "since": {
- "version": "3.0.0",
- "description": ""
- },
- "type": "Class",
- "methods": [
- {
- "name": "from",
- "description": "A static method that creates a new date object from the NgbDateStruct
,
\nex. NgbDate.from({year: 2000, month: 5, day: 1})
.
\nIf the date
is already of NgbDate
type, the method will return the same object.
",
- "args": [
- {
- "name": "date",
- "type": "NgbDateStruct"
- }
- ],
- "returnType": "NgbDate"
- },
- {
- "name": "equals",
- "description": "Checks if the current date is equal to another date.
",
- "args": [
- {
- "name": "other",
- "type": "NgbDateStruct"
- }
- ],
- "returnType": "boolean"
- },
- {
- "name": "before",
- "description": "Checks if the current date is before another date.
",
- "args": [
- {
- "name": "other",
- "type": "NgbDateStruct"
- }
- ],
- "returnType": "boolean"
- },
- {
- "name": "after",
- "description": "Checks if the current date is after another date.
",
- "args": [
- {
- "name": "other",
- "type": "NgbDateStruct"
- }
- ],
- "returnType": "boolean"
- }
- ],
- "properties": [
- {
- "name": "day",
- "type": "number",
- "description": "The day of month, starting with 1
"
- },
- {
- "name": "month",
- "type": "number",
- "description": "The month, for example 1=Jan ... 12=Dec as in ISO 8601
"
- },
- {
- "name": "year",
- "type": "number",
- "description": "The year, for example 2016
"
- }
- ]
- },
- "NgbDropdownConfig": {
- "fileName": "src/dropdown/dropdown-config.ts",
- "className": "NgbDropdownConfig",
- "description": "A configuration service for the NgbDropdown
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the dropdowns used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "autoClose",
- "defaultValue": "true",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": ""
- },
- {
- "name": "container",
- "type": "\"body\"",
- "description": ""
- },
- {
- "name": "placement",
- "type": "PlacementArray",
- "description": ""
- }
- ]
- },
- "NgbDropdownItem": {
- "fileName": "src/dropdown/dropdown.ts",
- "className": "NgbDropdownItem",
- "description": "A directive you should put put on a dropdown item to enable keyboard navigation.\nArrow keys will move focus between items marked with this directive.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "[ngbDropdownItem]",
- "inputs": [
- {
- "name": "disabled",
- "type": "boolean",
- "description": ""
- }
- ],
- "outputs": [],
- "properties": [
- {
- "name": "disabled",
- "type": "boolean",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbDropdownMenu": {
- "fileName": "src/dropdown/dropdown.ts",
- "className": "NgbDropdownMenu",
- "description": "A directive that wraps dropdown menu content and dropdown items.
",
- "type": "Directive",
- "selector": "[ngbDropdownMenu]",
- "inputs": [],
- "outputs": [],
- "properties": [
- {
- "name": "isOpen",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "menuItems",
- "type": "QueryList",
- "description": ""
- },
- {
- "name": "placement",
- "defaultValue": "bottom",
- "type": "Placement",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbDropdownAnchor": {
- "fileName": "src/dropdown/dropdown.ts",
- "className": "NgbDropdownAnchor",
- "description": "A directive to mark an element to which dropdown menu will be anchored.
\nThis is a simple version of the NgbDropdownToggle
directive.\nIt plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support\nfor events other than click.
",
- "since": {
- "version": "1.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "[ngbDropdownAnchor]",
- "inputs": [],
- "outputs": [],
- "properties": [
- {
- "name": "anchorEl",
- "type": "any",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbDropdownToggle": {
- "fileName": "src/dropdown/dropdown.ts",
- "className": "NgbDropdownToggle",
- "description": "A directive to mark an element that will toggle dropdown via the click
event.
\nYou can also use NgbDropdownAnchor
as an alternative.
",
- "type": "Directive",
- "selector": "[ngbDropdownToggle]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbDropdown": {
- "fileName": "src/dropdown/dropdown.ts",
- "className": "NgbDropdown",
- "description": "A directive that provides contextual overlays for displaying lists of links and more.
",
- "type": "Directive",
- "selector": "[ngbDropdown]",
- "exportAs": "ngbDropdown",
- "inputs": [
- {
- "name": "autoClose",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": "Indicates whether the dropdown should be closed when clicking one of dropdown items or pressing ESC.
\n\ntrue
- the dropdown will close on both outside and inside (menu) clicks. \nfalse
- the dropdown can only be closed manually via close()
or toggle()
methods. \n"inside"
- the dropdown will close on inside menu clicks, but not outside clicks. \n"outside"
- the dropdown will close only on the outside clicks and not on menu clicks. \n "
- },
- {
- "name": "container",
- "type": "\"body\"",
- "description": "A selector specifying the element the dropdown should be appended to.\nCurrently only supports "body".
",
- "since": {
- "version": "4.1.0",
- "description": ""
- }
- },
- {
- "name": "display",
- "type": "\"dynamic\" | \"static\"",
- "description": "Enable or disable the dynamic positioning. The default value is dynamic unless the dropdown is used\ninside a Bootstrap navbar. If you need custom placement for a dropdown in a navbar, set it to\ndynamic explicitly. See the positioning of dropdown \nand the navbar demo for more details.
",
- "since": {
- "version": "4.2.0",
- "description": ""
- }
- },
- {
- "name": "open",
- "defaultValue": "false",
- "type": "boolean",
- "description": "Defines whether or not the dropdown menu is opened initially.
"
- },
- {
- "name": "placement",
- "type": "PlacementArray",
- "description": "The preferred placement of the dropdown.
\nPossible values are "top"
, "top-left"
, "top-right"
, "bottom"
, "bottom-left"
,\n"bottom-right"
, "left"
, "left-top"
, "left-bottom"
, "right"
, "right-top"
,\n"right-bottom"
\nAccepts an array of strings or a string with space separated possible values.
\nThe default order of preference is "bottom-left bottom-right top-left top-right"
\nPlease see the positioning overview for more details.
"
- }
- ],
- "outputs": [
- {
- "name": "openChange",
- "description": "An event fired when the dropdown is opened or closed.
\nThe event payload is a boolean
:
\n\ntrue
- the dropdown was opened \nfalse
- the dropdown was closed \n "
- }
- ],
- "properties": [],
- "methods": [
- {
- "name": "isOpen",
- "description": "Checks if the dropdown menu is open.
",
- "args": [],
- "returnType": "boolean"
- },
- {
- "name": "open",
- "description": "Opens the dropdown menu.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "close",
- "description": "Closes the dropdown menu.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "toggle",
- "description": "Toggles the dropdown menu.
",
- "args": [],
- "returnType": "void"
- }
- ]
- },
- "NgbModalOptions": {
- "fileName": "src/modal/modal-config.ts",
- "className": "NgbModalOptions",
- "description": "Options available when opening new modal windows with NgbModal.open()
method.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "ariaLabelledBy",
- "type": "string",
- "description": "aria-labelledby
attribute value to set on the modal window.
",
- "since": {
- "version": "2.2.0",
- "description": ""
- }
- },
- {
- "name": "backdrop",
- "type": "boolean | \"static\"",
- "description": "If true
, the backdrop element will be created for a given modal.
\nAlternatively, specify 'static'
for a backdrop which doesn't close the modal on click.
\nDefault value is true
.
"
- },
- {
- "name": "backdropClass",
- "type": "string",
- "description": "A custom class to append to the modal backdrop.
",
- "since": {
- "version": "1.1.0",
- "description": ""
- }
- },
- {
- "name": "beforeDismiss",
- "type": "() => boolean | Promise",
- "description": "Callback right before the modal will be dismissed.
\nIf this function returns:
\n\nfalse
\na promise resolved with false
\na promise that is rejected \n \nthen the modal won't be dismissed.
"
- },
- {
- "name": "centered",
- "type": "boolean",
- "description": "If true
, the modal will be centered vertically.
\nDefault value is false
.
",
- "since": {
- "version": "1.1.0",
- "description": ""
- }
- },
- {
- "name": "container",
- "type": "string",
- "description": "A selector specifying the element all new modal windows should be appended to.
\nIf not specified, will be body
.
"
- },
- {
- "name": "injector",
- "type": "Injector",
- "description": "The Injector
to use for modal content.
"
- },
- {
- "name": "keyboard",
- "type": "boolean",
- "description": "If true
, the modal will be closed when Escape
key is pressed
\nDefault value is true
.
"
- },
- {
- "name": "scrollable",
- "type": "boolean",
- "description": "Scrollable modal content (false by default).
",
- "since": {
- "version": "5.0.0",
- "description": ""
- }
- },
- {
- "name": "size",
- "type": "\"sm\" | \"lg\" | \"xl\"",
- "description": "Size of a new modal window.
"
- },
- {
- "name": "windowClass",
- "type": "string",
- "description": "A custom class to append to the modal window.
"
- }
- ]
- },
- "NgbModalConfig": {
- "fileName": "src/modal/modal-config.ts",
- "className": "NgbModalConfig",
- "description": "A configuration service for the NgbModal
service.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all modals used in the application.
",
- "since": {
- "version": "3.1.0",
- "description": ""
- },
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "backdrop",
- "defaultValue": "true",
- "type": "boolean | \"static\"",
- "description": "If true
, the backdrop element will be created for a given modal.
\nAlternatively, specify 'static'
for a backdrop which doesn't close the modal on click.
\nDefault value is true
.
"
- },
- {
- "name": "keyboard",
- "defaultValue": "true",
- "type": "boolean",
- "description": "If true
, the modal will be closed when Escape
key is pressed
\nDefault value is true
.
"
- }
- ]
- },
- "NgbActiveModal": {
- "fileName": "src/modal/modal-ref.ts",
- "className": "NgbActiveModal",
- "description": "A reference to the currently opened (active) modal.
\nInstances of this class can be injected into your component passed as modal content.\nSo you can .close()
or .dismiss()
the modal window from your component.
",
- "type": "Class",
- "methods": [
- {
- "name": "close",
- "description": "Closes the modal with an optional result
value.
\nThe NgbMobalRef.result
promise will be resolved with the provided value.
",
- "args": [
- {
- "name": "result",
- "type": "any"
- }
- ],
- "returnType": "void"
- },
- {
- "name": "dismiss",
- "description": "Dismisses the modal with an optional reason
value.
\nThe NgbModalRef.result
promise will be rejected with the provided value.
",
- "args": [
- {
- "name": "reason",
- "type": "any"
- }
- ],
- "returnType": "void"
- }
- ],
- "properties": []
- },
- "NgbModalRef": {
- "fileName": "src/modal/modal-ref.ts",
- "className": "NgbModalRef",
- "description": "A reference to the newly opened modal returned by the NgbModal.open()
method.
",
- "type": "Class",
- "methods": [
- {
- "name": "close",
- "description": "Closes the modal with an optional result
value.
\nThe NgbMobalRef.result
promise will be resolved with the provided value.
",
- "args": [
- {
- "name": "result",
- "type": "any"
- }
- ],
- "returnType": "void"
- },
- {
- "name": "dismiss",
- "description": "Dismisses the modal with an optional reason
value.
\nThe NgbModalRef.result
promise will be rejected with the provided value.
",
- "args": [
- {
- "name": "reason",
- "type": "any"
- }
- ],
- "returnType": "void"
- }
- ],
- "properties": [
- {
- "name": "componentInstance",
- "type": "any",
- "description": "The instance of a component used for the modal content.
\nWhen a TemplateRef
is used as the content, will return undefined
.
"
- },
- {
- "name": "result",
- "type": "Promise",
- "description": "The promise that is resolved when the modal is closed and rejected when the modal is dismissed.
"
- }
- ]
- },
- "NgbModal": {
- "fileName": "src/modal/modal.ts",
- "className": "NgbModal",
- "description": "A service for opening modal windows.
\nCreating a modal is straightforward: create a component or a template and pass it as an argument to\nthe .open()
method.
",
- "type": "Service",
- "methods": [
- {
- "name": "open",
- "description": "Opens a new modal window with the specified content and supplied options.
\nContent can be provided as a TemplateRef
or a component type. If you pass a component type as content,\nthen instances of those components can be injected with an instance of the NgbActiveModal
class. You can then\nuse NgbActiveModal
methods to close / dismiss modals from "inside" of your component.
\nAlso see the NgbModalOptions
for the list of supported options.
",
- "args": [
- {
- "name": "content",
- "type": "any"
- },
- {
- "name": "options",
- "type": "NgbModalOptions"
- }
- ],
- "returnType": "NgbModalRef"
- },
- {
- "name": "dismissAll",
- "description": "Dismisses all currently displayed modal windows with the supplied reason.
",
- "args": [
- {
- "name": "reason",
- "type": "any"
- }
- ],
- "returnType": "void",
- "since": {
- "version": "3.1.0",
- "description": ""
- }
- },
- {
- "name": "hasOpenModals",
- "description": "Indicates if there are currently any open modal windows in the application.
",
- "args": [],
- "returnType": "boolean",
- "since": {
- "version": "3.3.0",
- "description": ""
- }
- }
- ],
- "properties": []
- },
- "NgbPaginationConfig": {
- "fileName": "src/pagination/pagination-config.ts",
- "className": "NgbPaginationConfig",
- "description": "A configuration service for the NgbPagination
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the paginations used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "boundaryLinks",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "directionLinks",
- "defaultValue": "true",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "disabled",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "ellipses",
- "defaultValue": "true",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "maxSize",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "pageSize",
- "defaultValue": "10",
- "type": "number",
- "description": ""
- },
- {
- "name": "rotate",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "size",
- "type": "\"sm\" | \"lg\"",
- "description": ""
- }
- ]
- },
- "NgbPaginationLinkContext": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationLinkContext",
- "description": "A context for the
\n\nNgbPaginationFirst
\nNgbPaginationPrevious
\nNgbPaginationNext
\nNgbPaginationLast
\nNgbPaginationEllipsis
\n \nlink templates in case you want to override one.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "currentPage",
- "type": "number",
- "description": "The currently selected page number
"
- },
- {
- "name": "disabled",
- "type": "boolean",
- "description": "If true
, the current link is disabled
"
- }
- ]
- },
- "NgbPaginationNumberContext": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationNumberContext",
- "description": "A context for the NgbPaginationNumber
link template in case you want to override one.
\nExtends NgbPaginationLinkContext
.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "$implicit",
- "type": "number",
- "description": "The page number, displayed by the current page link.
"
- }
- ]
- },
- "NgbPaginationEllipsis": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationEllipsis",
- "description": "A directive to match the 'ellipsis' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationEllipsis]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPaginationFirst": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationFirst",
- "description": "A directive to match the 'first' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationFirst]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPaginationLast": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationLast",
- "description": "A directive to match the 'last' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationLast]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPaginationNext": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationNext",
- "description": "A directive to match the 'next' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationNext]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPaginationNumber": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationNumber",
- "description": "A directive to match the page 'number' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationNumber]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPaginationPrevious": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPaginationPrevious",
- "description": "A directive to match the 'previous' link template
",
- "since": {
- "version": "4.1.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "ng-template[ngbPaginationPrevious]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbPagination": {
- "fileName": "src/pagination/pagination.ts",
- "className": "NgbPagination",
- "description": "A component that displays page numbers and allows to customize them in several ways.
",
- "type": "Component",
- "selector": "ngb-pagination",
- "inputs": [
- {
- "name": "boundaryLinks",
- "type": "boolean",
- "description": "If true
, the "First" and "Last" page links are shown.
"
- },
- {
- "name": "collectionSize",
- "type": "number",
- "description": "The number of items in your paginated collection.
\nNote, that this is not the number of pages. Page numbers are calculated dynamically based on\ncollectionSize
and pageSize
. Ex. if you have 100 items in your collection and displaying 20 items per page,\nyou'll end up with 5 pages.
"
- },
- {
- "name": "directionLinks",
- "type": "boolean",
- "description": "If true
, the "Next" and "Previous" page links are shown.
"
- },
- {
- "name": "disabled",
- "type": "boolean",
- "description": "If true
, pagination links will be disabled.
"
- },
- {
- "name": "ellipses",
- "type": "boolean",
- "description": "If true
, the ellipsis symbols and first/last page numbers will be shown when maxSize
> number of pages.
"
- },
- {
- "name": "maxSize",
- "type": "number",
- "description": "The maximum number of pages to display.
"
- },
- {
- "name": "page",
- "defaultValue": "1",
- "type": "number",
- "description": "The current page.
\nPage numbers start with 1
.
"
- },
- {
- "name": "pageSize",
- "type": "number",
- "description": "The number of items per page.
"
- },
- {
- "name": "rotate",
- "type": "boolean",
- "description": "Whether to rotate pages when maxSize
> number of pages.
\nThe current page always stays in the middle if true
.
"
- },
- {
- "name": "size",
- "type": "\"sm\" | \"lg\"",
- "description": "The pagination display size.
\nBootstrap currently supports small and large sizes.
"
- }
- ],
- "outputs": [
- {
- "name": "pageChange",
- "description": "An event fired when the page is changed. Will fire only if collection size is set and all values are valid.
\nEvent payload is the number of the newly selected page.
\nPage numbers start with 1
.
"
- }
- ],
- "properties": [
- {
- "name": "pageCount",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "pages",
- "type": "number[]",
- "description": ""
- },
- {
- "name": "tplEllipsis",
- "type": "NgbPaginationEllipsis",
- "description": ""
- },
- {
- "name": "tplFirst",
- "type": "NgbPaginationFirst",
- "description": ""
- },
- {
- "name": "tplLast",
- "type": "NgbPaginationLast",
- "description": ""
- },
- {
- "name": "tplNext",
- "type": "NgbPaginationNext",
- "description": ""
- },
- {
- "name": "tplNumber",
- "type": "NgbPaginationNumber",
- "description": ""
- },
- {
- "name": "tplPrevious",
- "type": "NgbPaginationPrevious",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbPopoverConfig": {
- "fileName": "src/popover/popover-config.ts",
- "className": "NgbPopoverConfig",
- "description": "A configuration service for the NgbPopover
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the popovers used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "autoClose",
- "defaultValue": "true",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": ""
- },
- {
- "name": "closeDelay",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "container",
- "type": "string",
- "description": ""
- },
- {
- "name": "disablePopover",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "openDelay",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "placement",
- "defaultValue": "auto",
- "type": "PlacementArray",
- "description": ""
- },
- {
- "name": "popoverClass",
- "type": "string",
- "description": ""
- },
- {
- "name": "triggers",
- "defaultValue": "click",
- "type": "string",
- "description": ""
- }
- ]
- },
- "NgbPopover": {
- "fileName": "src/popover/popover.ts",
- "className": "NgbPopover",
- "description": "A lightweight and extensible directive for fancy popover creation.
",
- "type": "Directive",
- "selector": "[ngbPopover]",
- "exportAs": "ngbPopover",
- "inputs": [
- {
- "name": "autoClose",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": "Indicates whether the popover should be closed on Escape
key and inside/outside clicks:
\n\ntrue
- closes on both outside and inside clicks as well as Escape
presses \nfalse
- disables the autoClose feature (NB: triggers still apply) \n"inside"
- closes on inside clicks as well as Escape presses \n"outside"
- closes on outside clicks (sometimes also achievable through triggers)\nas well as Escape
presses \n ",
- "since": {
- "version": "3.0.0",
- "description": ""
- }
- },
- {
- "name": "closeDelay",
- "type": "number",
- "description": "The closing delay in ms. Works only for "non-manual" opening triggers defined by the triggers
input.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- }
- },
- {
- "name": "container",
- "type": "string",
- "description": "A selector specifying the element the popover should be appended to.
\nCurrently only supports body
.
"
- },
- {
- "name": "disablePopover",
- "type": "boolean",
- "description": "If true
, popover is disabled and won't be displayed.
",
- "since": {
- "version": "1.1.0",
- "description": ""
- }
- },
- {
- "name": "ngbPopover",
- "type": "string | TemplateRef",
- "description": "The string content or a TemplateRef
for the content to be displayed in the popover.
\nIf the title and the content are empty, the popover won't open.
"
- },
- {
- "name": "openDelay",
- "type": "number",
- "description": "The opening delay in ms. Works only for "non-manual" opening triggers defined by the triggers
input.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- }
- },
- {
- "name": "placement",
- "type": "PlacementArray",
- "description": "The preferred placement of the popover.
\nPossible values are "top"
, "top-left"
, "top-right"
, "bottom"
, "bottom-left"
,\n"bottom-right"
, "left"
, "left-top"
, "left-bottom"
, "right"
, "right-top"
,\n"right-bottom"
\nAccepts an array of strings or a string with space separated possible values.
\nThe default order of preference is "auto"
(same as the sequence above).
\nPlease see the positioning overview for more details.
"
- },
- {
- "name": "popoverClass",
- "type": "string",
- "description": "An optional class applied to the popover window element.
",
- "since": {
- "version": "2.2.0",
- "description": ""
- }
- },
- {
- "name": "popoverTitle",
- "type": "string | TemplateRef",
- "description": "The title of the popover.
\nIf the title and the content are empty, the popover won't open.
"
- },
- {
- "name": "triggers",
- "type": "string",
- "description": "Specifies events that should trigger the tooltip.
\nSupports a space separated list of event names.\nFor more details see the triggers demo .
"
- }
- ],
- "outputs": [
- {
- "name": "hidden",
- "description": "An event emitted when the popover is hidden. Contains no payload.
"
- },
- {
- "name": "shown",
- "description": "An event emitted when the popover is shown. Contains no payload.
"
- }
- ],
- "properties": [],
- "methods": [
- {
- "name": "open",
- "description": "Opens the popover.
\nThis is considered to be a "manual" triggering.\nThe context
is an optional value to be injected into the popover template when it is created.
",
- "args": [
- {
- "name": "context",
- "type": "any"
- }
- ],
- "returnType": "void"
- },
- {
- "name": "close",
- "description": "Closes the popover.
\nThis is considered to be a "manual" triggering of the popover.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "toggle",
- "description": "Toggles the popover.
\nThis is considered to be a "manual" triggering of the popover.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "isOpen",
- "description": "Returns true
, if the popover is currently shown.
",
- "args": [],
- "returnType": "boolean"
- }
- ]
- },
- "NgbProgressbarConfig": {
- "fileName": "src/progressbar/progressbar-config.ts",
- "className": "NgbProgressbarConfig",
- "description": "A configuration service for the NgbProgressbar
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the progress bars used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "animated",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "height",
- "type": "string",
- "description": ""
- },
- {
- "name": "max",
- "defaultValue": "100",
- "type": "number",
- "description": ""
- },
- {
- "name": "showValue",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "striped",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "type",
- "type": "string",
- "description": ""
- }
- ]
- },
- "NgbProgressbar": {
- "fileName": "src/progressbar/progressbar.ts",
- "className": "NgbProgressbar",
- "description": "A directive that provides feedback on the progress of a workflow or an action.
",
- "type": "Component",
- "selector": "ngb-progressbar",
- "inputs": [
- {
- "name": "animated",
- "type": "boolean",
- "description": "If true
, the stripes on the progressbar are animated.
\nTakes effect only for browsers supporting CSS3 animations, and if striped
is true
.
"
- },
- {
- "name": "height",
- "type": "string",
- "description": "THe height of the progress bar.
\nAccepts any valid CSS height values, ex. "2rem"
"
- },
- {
- "name": "max",
- "type": "number",
- "description": "The maximal value to be displayed in the progressbar.
"
- },
- {
- "name": "showValue",
- "type": "boolean",
- "description": "If true
, the current percentage will be shown in the xx%
format.
"
- },
- {
- "name": "striped",
- "type": "boolean",
- "description": "If true
, the progress bars will be displayed as striped.
"
- },
- {
- "name": "type",
- "type": "string",
- "description": "The type of the progress bar.
\nCurrently Bootstrap supports "success"
, "info"
, "warning"
or "danger"
.
"
- },
- {
- "name": "value",
- "defaultValue": "0",
- "type": "number",
- "description": "The current value for the progress bar.
\nShould be in the [0, max]
range.
"
- }
- ],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbRatingConfig": {
- "fileName": "src/rating/rating-config.ts",
- "className": "NgbRatingConfig",
- "description": "A configuration service for the NgbRating
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the ratings used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "max",
- "defaultValue": "10",
- "type": "number",
- "description": ""
- },
- {
- "name": "readonly",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "resettable",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- }
- ]
- },
- "StarTemplateContext": {
- "fileName": "src/rating/rating.ts",
- "className": "StarTemplateContext",
- "description": "The context for the custom star display template defined in the starTemplate
.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "fill",
- "type": "number",
- "description": "The star fill percentage, an integer in the [0, 100]
range.
"
- },
- {
- "name": "index",
- "type": "number",
- "description": "Index of the star, starts with 0
.
"
- }
- ]
- },
- "NgbRating": {
- "fileName": "src/rating/rating.ts",
- "className": "NgbRating",
- "description": "A directive that helps visualising and interacting with a star rating bar.
",
- "type": "Component",
- "selector": "ngb-rating",
- "inputs": [
- {
- "name": "max",
- "type": "number",
- "description": "The maximal rating that can be given.
"
- },
- {
- "name": "rate",
- "type": "number",
- "description": "The current rating. Could be a decimal value like 3.75
.
"
- },
- {
- "name": "readonly",
- "type": "boolean",
- "description": "If true
, the rating can't be changed.
"
- },
- {
- "name": "resettable",
- "type": "boolean",
- "description": "If true
, the rating can be reset to 0
by mouse clicking currently set rating.
"
- },
- {
- "name": "starTemplate",
- "type": "TemplateRef",
- "description": "The template to override the way each star is displayed.
\nAlternatively put an <ng-template>
as the only child of your <ngb-rating>
element
"
- }
- ],
- "outputs": [
- {
- "name": "hover",
- "description": "An event emitted when the user is hovering over a given rating.
\nEvent payload equals to the rating being hovered over.
"
- },
- {
- "name": "leave",
- "description": "An event emitted when the user stops hovering over a given rating.
\nEvent payload equals to the rating of the last item being hovered over.
"
- },
- {
- "name": "rateChange",
- "description": "An event emitted when the user selects a new rating.
\nEvent payload equals to the newly selected rating.
"
- }
- ],
- "properties": [
- {
- "name": "contexts",
- "type": "StarTemplateContext[]",
- "description": ""
- },
- {
- "name": "disabled",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "nextRate",
- "type": "number",
- "description": ""
- },
- {
- "name": "onChange",
- "type": "(_: any) => void",
- "description": ""
- },
- {
- "name": "onTouched",
- "type": "() => void",
- "description": ""
- },
- {
- "name": "starTemplateFromContent",
- "type": "TemplateRef",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbTabsetConfig": {
- "fileName": "src/tabset/tabset-config.ts",
- "className": "NgbTabsetConfig",
- "description": "A configuration service for the NgbTabset
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the tabsets used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "justify",
- "defaultValue": "start",
- "type": "\"start\" | \"center\" | \"end\" | \"fill\" | \"justified\"",
- "description": ""
- },
- {
- "name": "orientation",
- "defaultValue": "horizontal",
- "type": "\"horizontal\" | \"vertical\"",
- "description": ""
- },
- {
- "name": "type",
- "defaultValue": "tabs",
- "type": "\"tabs\" | \"pills\"",
- "description": ""
- }
- ]
- },
- "NgbTabTitle": {
- "fileName": "src/tabset/tabset.ts",
- "className": "NgbTabTitle",
- "description": "A directive to wrap tab titles that need to contain HTML markup or other directives.
\nAlternatively you could use the NgbTab.title
input for string titles.
",
- "type": "Directive",
- "selector": "ng-template[ngbTabTitle]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbTabContent": {
- "fileName": "src/tabset/tabset.ts",
- "className": "NgbTabContent",
- "description": "A directive to wrap content to be displayed in a tab.
",
- "type": "Directive",
- "selector": "ng-template[ngbTabContent]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbTab": {
- "fileName": "src/tabset/tabset.ts",
- "className": "NgbTab",
- "description": "A directive representing an individual tab.
",
- "type": "Directive",
- "selector": "ngb-tab",
- "inputs": [
- {
- "name": "disabled",
- "defaultValue": "false",
- "type": "boolean",
- "description": "If true
, the current tab is disabled and can't be toggled.
"
- },
- {
- "name": "id",
- "type": "string",
- "description": "The tab identifier.
\nMust be unique for the entire document for proper accessibility support.
"
- },
- {
- "name": "title",
- "type": "string",
- "description": "The tab title.
\nUse the NgbTabTitle
directive for non-string titles.
"
- }
- ],
- "outputs": [],
- "properties": [
- {
- "name": "contentTpl",
- "type": "NgbTabContent",
- "description": ""
- },
- {
- "name": "contentTpls",
- "type": "QueryList",
- "description": ""
- },
- {
- "name": "titleTpl",
- "type": "NgbTabTitle",
- "description": ""
- },
- {
- "name": "titleTpls",
- "type": "QueryList",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbTabChangeEvent": {
- "fileName": "src/tabset/tabset.ts",
- "className": "NgbTabChangeEvent",
- "description": "The payload of the change event fired right before the tab change.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "activeId",
- "type": "string",
- "description": "The id of the currently active tab.
"
- },
- {
- "name": "nextId",
- "type": "string",
- "description": "The id of the newly selected tab.
"
- },
- {
- "name": "preventDefault",
- "type": "() => void",
- "description": "Calling this function will prevent tab switching.
"
- }
- ]
- },
- "NgbTabset": {
- "fileName": "src/tabset/tabset.ts",
- "className": "NgbTabset",
- "description": "A component that makes it easy to create tabbed interface.
",
- "type": "Component",
- "selector": "ngb-tabset",
- "exportAs": "ngbTabset",
- "inputs": [
- {
- "name": "activeId",
- "type": "string",
- "description": "The identifier of the tab that should be opened initially .
\nFor subsequent tab switches use the .select()
method and the (tabChange)
event.
"
- },
- {
- "name": "destroyOnHide",
- "defaultValue": "true",
- "type": "boolean",
- "description": "If true
, non-visible tabs content will be removed from DOM. Otherwise it will just be hidden.
"
- },
- {
- "name": "justify",
- "type": "\"start\" | \"center\" | \"end\" | \"fill\" | \"justified\"",
- "description": "The horizontal alignment of the tabs with flexbox utilities.
"
- },
- {
- "name": "orientation",
- "type": "\"horizontal\" | \"vertical\"",
- "description": "The orientation of the tabset.
"
- },
- {
- "name": "type",
- "type": "string",
- "description": "Type of navigation to be used for tabs.
\nCurrently Bootstrap supports only "tabs"
and "pills"
.
\nSince 3.0.0
can also be an arbitrary string (ex. for custom themes).
"
- }
- ],
- "outputs": [
- {
- "name": "tabChange",
- "description": "A tab change event emitted right before the tab change happens.
\nSee NgbTabChangeEvent
for payload details.
"
- }
- ],
- "properties": [
- {
- "name": "justifyClass",
- "type": "string",
- "description": ""
- },
- {
- "name": "tabs",
- "type": "QueryList",
- "description": ""
- }
- ],
- "methods": [
- {
- "name": "select",
- "description": "Selects the tab with the given id and shows its associated content panel.
\nAny other tab that was previously selected becomes unselected and its associated pane is removed from DOM or\nhidden depending on the destroyOnHide
value.
",
- "args": [
- {
- "name": "tabId",
- "type": "string"
- }
- ],
- "returnType": "void"
- }
- ]
- },
- "NgbTimeAdapter": {
- "fileName": "src/timepicker/ngb-time-adapter.ts",
- "className": "NgbTimeAdapter",
- "description": "An abstract service that does the conversion between the internal timepicker NgbTimeStruct
model and\nany provided user time model T
, ex. a string, a native date, etc.
\nThe adapter is used only for conversion when binding timepicker to a form control,\nex. [(ngModel)]="userTimeModel"
. Here userTimeModel
can be of any type.
\nThe default timepicker implementation assumes we use NgbTimeStruct
as a user model.
\nSee the custom time adapter demo for an example.
",
- "since": {
- "version": "2.2.0",
- "description": ""
- },
- "typeParameter": "T",
- "type": "Service",
- "methods": [
- {
- "name": "fromModel",
- "description": "Converts a user-model time of type T
to an NgbTimeStruct
for internal use.
",
- "args": [
- {
- "name": "value",
- "type": "T"
- }
- ],
- "returnType": "NgbTimeStruct"
- },
- {
- "name": "toModel",
- "description": "Converts an internal NgbTimeStruct
time to a user-model time of type T
.
",
- "args": [
- {
- "name": "time",
- "type": "NgbTimeStruct"
- }
- ],
- "returnType": "T"
- }
- ],
- "properties": []
- },
- "NgbTimeStruct": {
- "fileName": "src/timepicker/ngb-time-struct.ts",
- "className": "NgbTimeStruct",
- "description": "An interface for the time model used by the timepicker.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "hour",
- "type": "number",
- "description": "The hour in the [0, 23]
range.
"
- },
- {
- "name": "minute",
- "type": "number",
- "description": "The minute in the [0, 59]
range.
"
- },
- {
- "name": "second",
- "type": "number",
- "description": "The second in the [0, 59]
range.
"
- }
- ]
- },
- "NgbTimepickerConfig": {
- "fileName": "src/timepicker/timepicker-config.ts",
- "className": "NgbTimepickerConfig",
- "description": "A configuration service for the NgbTimepicker
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the timepickers used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "disabled",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "hourStep",
- "defaultValue": "1",
- "type": "number",
- "description": ""
- },
- {
- "name": "meridian",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "minuteStep",
- "defaultValue": "1",
- "type": "number",
- "description": ""
- },
- {
- "name": "readonlyInputs",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "seconds",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "secondStep",
- "defaultValue": "1",
- "type": "number",
- "description": ""
- },
- {
- "name": "size",
- "defaultValue": "medium",
- "type": "\"small\" | \"medium\" | \"large\"",
- "description": ""
- },
- {
- "name": "spinners",
- "defaultValue": "true",
- "type": "boolean",
- "description": ""
- }
- ]
- },
- "NgbTimepickerI18n": {
- "fileName": "src/timepicker/timepicker-i18n.ts",
- "className": "NgbTimepickerI18n",
- "description": "Type of the service supplying day periods (for example, 'AM' and 'PM') to NgbTimepicker component.\nThe default implementation of this service honors the Angular locale, and uses the registered locale data,\nas explained in the Angular i18n guide.
",
- "type": "Service",
- "methods": [
- {
- "name": "getMorningPeriod",
- "description": "Returns the name for the period before midday.
",
- "args": [],
- "returnType": "string"
- },
- {
- "name": "getAfternoonPeriod",
- "description": "Returns the name for the period after midday.
",
- "args": [],
- "returnType": "string"
- }
- ],
- "properties": []
- },
- "NgbTimepicker": {
- "fileName": "src/timepicker/timepicker.ts",
- "className": "NgbTimepicker",
- "description": "A directive that helps with wth picking hours, minutes and seconds.
",
- "type": "Component",
- "selector": "ngb-timepicker",
- "inputs": [
- {
- "name": "hourStep",
- "type": "number",
- "description": "The number of hours to add/subtract when clicking hour spinners.
"
- },
- {
- "name": "meridian",
- "type": "boolean",
- "description": "Whether to display 12H or 24H mode.
"
- },
- {
- "name": "minuteStep",
- "type": "number",
- "description": "The number of minutes to add/subtract when clicking minute spinners.
"
- },
- {
- "name": "readonlyInputs",
- "type": "boolean",
- "description": "If true
, the timepicker is readonly and can't be changed.
"
- },
- {
- "name": "seconds",
- "type": "boolean",
- "description": "If true
, it is possible to select seconds.
"
- },
- {
- "name": "secondStep",
- "type": "number",
- "description": "The number of seconds to add/subtract when clicking second spinners.
"
- },
- {
- "name": "size",
- "type": "\"small\" | \"medium\" | \"large\"",
- "description": "The size of inputs and buttons.
"
- },
- {
- "name": "spinners",
- "type": "boolean",
- "description": "If true
, the spinners above and below inputs are visible.
"
- }
- ],
- "outputs": [],
- "properties": [
- {
- "name": "disabled",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "hourStep",
- "type": "number",
- "description": "The number of hours to add/subtract when clicking hour spinners.
"
- },
- {
- "name": "isLargeSize",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "isSmallSize",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "minuteStep",
- "type": "number",
- "description": "The number of minutes to add/subtract when clicking minute spinners.
"
- },
- {
- "name": "model",
- "type": "NgbTime",
- "description": ""
- },
- {
- "name": "onChange",
- "type": "(_: any) => void",
- "description": ""
- },
- {
- "name": "onTouched",
- "type": "() => void",
- "description": ""
- },
- {
- "name": "secondStep",
- "type": "number",
- "description": "The number of seconds to add/subtract when clicking second spinners.
"
- }
- ],
- "methods": []
- },
- "NgbToastOptions": {
- "fileName": "src/toast/toast-config.ts",
- "className": "NgbToastOptions",
- "description": "Interface used to type all toast config options. See NgbToastConfig
.
",
- "since": {
- "version": "5.0.0",
- "description": ""
- },
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "ariaLive",
- "type": "\"polite\" | \"alert\"",
- "description": "Type of aria-live attribute to be used.
\nCould be one of these 2 values (as string):
\n\npolite
(default) \nalert
\n "
- },
- {
- "name": "autohide",
- "type": "boolean",
- "description": "Specify if the toast component should emit the hide()
output\nafter a certain delay
in ms.
"
- },
- {
- "name": "delay",
- "type": "number",
- "description": "Delay in ms after which the hide()
output should be emitted.
"
- }
- ]
- },
- "NgbToastConfig": {
- "fileName": "src/toast/toast-config.ts",
- "className": "NgbToastConfig",
- "description": "Configuration service for the NgbToast component. You can inject this service, typically in your root component,\nand customize the values of its properties in order to provide default values for all the toasts used in the\napplication.
",
- "since": {
- "version": "5.0.0",
- "description": ""
- },
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "ariaLive",
- "defaultValue": "polite",
- "type": "\"polite\" | \"alert\"",
- "description": "Type of aria-live attribute to be used.
\nCould be one of these 2 values (as string):
\n\npolite
(default) \nalert
\n "
- },
- {
- "name": "autohide",
- "defaultValue": "true",
- "type": "boolean",
- "description": "Specify if the toast component should emit the hide()
output\nafter a certain delay
in ms.
"
- },
- {
- "name": "delay",
- "defaultValue": "500",
- "type": "number",
- "description": "Delay in ms after which the hide()
output should be emitted.
"
- }
- ]
- },
- "NgbToastHeader": {
- "fileName": "src/toast/toast.ts",
- "className": "NgbToastHeader",
- "description": "This directive allows the usage of HTML markup or other directives\ninside of the toast's header.
",
- "since": {
- "version": "5.0.0",
- "description": ""
- },
- "type": "Directive",
- "selector": "[ngbToastHeader]",
- "inputs": [],
- "outputs": [],
- "properties": [],
- "methods": []
- },
- "NgbToast": {
- "fileName": "src/toast/toast.ts",
- "className": "NgbToast",
- "description": "Toasts provide feedback messages as notifications to the user.\nGoal is to mimic the push notifications available both on mobile and desktop operating systems.
",
- "since": {
- "version": "5.0.0",
- "description": ""
- },
- "type": "Component",
- "selector": "ngb-toast",
- "exportAs": "ngbToast",
- "inputs": [
- {
- "name": "autohide",
- "type": "boolean",
- "description": "Auto hide the toast after a delay in ms.\ndefault: true
(inherited from NgbToastConfig)
"
- },
- {
- "name": "delay",
- "type": "number",
- "description": "Delay after which the toast will hide (ms).\ndefault: 500
(ms) (inherited from NgbToastConfig)
"
- },
- {
- "name": "header",
- "type": "string",
- "description": "Text to be used as toast's header.\nIgnored if a ContentChild template is specified at the same time.
"
- }
- ],
- "outputs": [
- {
- "name": "hide",
- "description": "An event fired immediately when toast's hide()
method has been called.\nIt can only occur in 2 different scenarios:
\n\nautohide
timeout fires \nuser clicks on a closing cross (×) \n \nAdditionally this output is purely informative. The toast won't disappear. It's up to the user to take care of\nthat.
"
- }
- ],
- "properties": [
- {
- "name": "contentHeaderTpl",
- "type": "TemplateRef",
- "description": "A template like <ng-template ngbToastHeader></ng-template>
can be\nused in the projected content to allow markup usage.
"
- }
- ],
- "methods": []
- },
- "NgbTooltipConfig": {
- "fileName": "src/tooltip/tooltip-config.ts",
- "className": "NgbTooltipConfig",
- "description": "A configuration service for the NgbTooltip
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the tooltips used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "autoClose",
- "defaultValue": "true",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": ""
- },
- {
- "name": "closeDelay",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "container",
- "type": "string",
- "description": ""
- },
- {
- "name": "disableTooltip",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "openDelay",
- "defaultValue": "0",
- "type": "number",
- "description": ""
- },
- {
- "name": "placement",
- "defaultValue": "auto",
- "type": "PlacementArray",
- "description": ""
- },
- {
- "name": "tooltipClass",
- "type": "string",
- "description": ""
- },
- {
- "name": "triggers",
- "defaultValue": "hover focus",
- "type": "string",
- "description": ""
- }
- ]
- },
- "NgbTooltip": {
- "fileName": "src/tooltip/tooltip.ts",
- "className": "NgbTooltip",
- "description": "A lightweight and extensible directive for fancy tooltip creation.
",
- "type": "Directive",
- "selector": "[ngbTooltip]",
- "exportAs": "ngbTooltip",
- "inputs": [
- {
- "name": "autoClose",
- "type": "boolean | \"inside\" | \"outside\"",
- "description": "Indicates whether the tooltip should be closed on Escape
key and inside/outside clicks:
\n\ntrue
- closes on both outside and inside clicks as well as Escape
presses \nfalse
- disables the autoClose feature (NB: triggers still apply) \n"inside"
- closes on inside clicks as well as Escape presses \n"outside"
- closes on outside clicks (sometimes also achievable through triggers)\nas well as Escape
presses \n ",
- "since": {
- "version": "3.0.0",
- "description": ""
- }
- },
- {
- "name": "closeDelay",
- "type": "number",
- "description": "The closing delay in ms. Works only for "non-manual" opening triggers defined by the triggers
input.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- }
- },
- {
- "name": "container",
- "type": "string",
- "description": "A selector specifying the element the tooltip should be appended to.
\nCurrently only supports "body"
.
"
- },
- {
- "name": "disableTooltip",
- "type": "boolean",
- "description": "If true
, tooltip is disabled and won't be displayed.
",
- "since": {
- "version": "1.1.0",
- "description": ""
- }
- },
- {
- "name": "ngbTooltip",
- "type": "string | TemplateRef",
- "description": "The string content or a TemplateRef
for the content to be displayed in the tooltip.
\nIf the content if falsy, the tooltip won't open.
"
- },
- {
- "name": "openDelay",
- "type": "number",
- "description": "The opening delay in ms. Works only for "non-manual" opening triggers defined by the triggers
input.
",
- "since": {
- "version": "4.1.0",
- "description": ""
- }
- },
- {
- "name": "placement",
- "type": "PlacementArray",
- "description": "The preferred placement of the tooltip.
\nPossible values are "top"
, "top-left"
, "top-right"
, "bottom"
, "bottom-left"
,\n"bottom-right"
, "left"
, "left-top"
, "left-bottom"
, "right"
, "right-top"
,\n"right-bottom"
\nAccepts an array of strings or a string with space separated possible values.
\nThe default order of preference is "auto"
(same as the sequence above).
\nPlease see the positioning overview for more details.
"
- },
- {
- "name": "tooltipClass",
- "type": "string",
- "description": "An optional class applied to the tooltip window element.
",
- "since": {
- "version": "3.2.0",
- "description": ""
- }
- },
- {
- "name": "triggers",
- "type": "string",
- "description": "Specifies events that should trigger the tooltip.
\nSupports a space separated list of event names.\nFor more details see the triggers demo .
"
- }
- ],
- "outputs": [
- {
- "name": "hidden",
- "description": "An event emitted when the popover is hidden. Contains no payload.
"
- },
- {
- "name": "shown",
- "description": "An event emitted when the tooltip is shown. Contains no payload.
"
- }
- ],
- "properties": [
- {
- "name": "ngbTooltip",
- "type": "string | TemplateRef",
- "description": "The string content or a TemplateRef
for the content to be displayed in the tooltip.
\nIf the content if falsy, the tooltip won't open.
"
- }
- ],
- "methods": [
- {
- "name": "open",
- "description": "Opens the tooltip.
\nThis is considered to be a "manual" triggering.\nThe context
is an optional value to be injected into the tooltip template when it is created.
",
- "args": [
- {
- "name": "context",
- "type": "any"
- }
- ],
- "returnType": "void"
- },
- {
- "name": "close",
- "description": "Closes the tooltip.
\nThis is considered to be a "manual" triggering of the tooltip.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "toggle",
- "description": "Toggles the tooltip.
\nThis is considered to be a "manual" triggering of the tooltip.
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "isOpen",
- "description": "Returns true
, if the popover is currently shown.
",
- "args": [],
- "returnType": "boolean"
- }
- ]
- },
- "NgbHighlight": {
- "fileName": "src/typeahead/highlight.ts",
- "className": "NgbHighlight",
- "description": "A component that helps with text highlighting.
\nIf splits the result
text into parts that contain the searched term
and generates the HTML markup to simplify\nhighlighting:
\nEx. result="Alaska"
and term="as"
will produce Al<span class="ngb-highlight">as</span>ka
.
",
- "type": "Component",
- "selector": "ngb-highlight",
- "inputs": [
- {
- "name": "highlightClass",
- "defaultValue": "ngb-highlight",
- "type": "string",
- "description": "The CSS class for <span>
elements wrapping the term
inside the result
.
"
- },
- {
- "name": "result",
- "type": "string",
- "description": "The text highlighting is added to.
\nIf the term
is found inside this text, it will be highlighted.\nIf the term
contains array then all the items from it will be highlighted inside the text.
"
- },
- {
- "name": "term",
- "type": "string | string[]",
- "description": "The term or array of terms to be highlighted.\nSince version v4.2.0
term could be a string[]
"
- }
- ],
- "outputs": [],
- "properties": [
- {
- "name": "parts",
- "type": "string[]",
- "description": ""
- }
- ],
- "methods": []
- },
- "NgbTypeaheadConfig": {
- "fileName": "src/typeahead/typeahead-config.ts",
- "className": "NgbTypeaheadConfig",
- "description": "A configuration service for the NgbTypeahead
component.
\nYou can inject this service, typically in your root component, and customize the values of its properties in\norder to provide default values for all the typeaheads used in the application.
",
- "type": "Service",
- "methods": [],
- "properties": [
- {
- "name": "container",
- "type": "any",
- "description": ""
- },
- {
- "name": "editable",
- "defaultValue": "true",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "focusFirst",
- "defaultValue": "true",
- "type": "boolean",
- "description": ""
- },
- {
- "name": "placement",
- "type": "PlacementArray",
- "description": ""
- },
- {
- "name": "showHint",
- "defaultValue": "false",
- "type": "boolean",
- "description": ""
- }
- ]
- },
- "ResultTemplateContext": {
- "fileName": "src/typeahead/typeahead-window.ts",
- "className": "ResultTemplateContext",
- "description": "The context for the typeahead result template in case you want to override the default one.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "result",
- "type": "any",
- "description": "Your typeahead result item.
"
- },
- {
- "name": "term",
- "type": "string",
- "description": "Search term from the <input>
used to get current result.
"
- }
- ]
- },
- "NgbTypeaheadSelectItemEvent": {
- "fileName": "src/typeahead/typeahead.ts",
- "className": "NgbTypeaheadSelectItemEvent",
- "description": "An event emitted right before an item is selected from the result list.
",
- "type": "Interface",
- "methods": [],
- "properties": [
- {
- "name": "item",
- "type": "any",
- "description": "The item from the result list about to be selected.
"
- },
- {
- "name": "preventDefault",
- "type": "() => void",
- "description": "Calling this function will prevent item selection from happening.
"
- }
- ]
- },
- "NgbTypeahead": {
- "fileName": "src/typeahead/typeahead.ts",
- "className": "NgbTypeahead",
- "description": "A directive providing a simple way of creating powerful typeaheads from any text input.
",
- "type": "Directive",
- "selector": "input[ngbTypeahead]",
- "exportAs": "ngbTypeahead",
- "inputs": [
- {
- "name": "autocomplete",
- "defaultValue": "off",
- "type": "string",
- "description": "The value for the autocomplete
attribute for the <input>
element.
\nDefaults to "off"
to disable the native browser autocomplete, but you can override it if necessary.
",
- "since": {
- "version": "2.1.0",
- "description": ""
- }
- },
- {
- "name": "container",
- "type": "string",
- "description": "A selector specifying the element the typeahead popup will be appended to.
\nCurrently only supports "body"
.
"
- },
- {
- "name": "editable",
- "type": "boolean",
- "description": "If true
, model values will not be restricted only to items selected from the popup.
"
- },
- {
- "name": "focusFirst",
- "type": "boolean",
- "description": "If true
, the first item in the result list will always stay focused while typing.
"
- },
- {
- "name": "inputFormatter",
- "type": "(item: any) => string",
- "description": "The function that converts an item from the result list to a string
to display in the <input>
field.
\nIt is called when the user selects something in the popup or the model value changes, so the input needs to\nbe updated.
"
- },
- {
- "name": "ngbTypeahead",
- "type": "(text: Observable) => Observable",
- "description": "The function that converts a stream of text values from the <input>
element to the stream of the array of items\nto display in the typeahead popup.
\nIf the resulting observable emits a non-empty array - the popup will be shown. If it emits an empty array - the\npopup will be closed.
\nSee the basic example for more details.
\nNote that the this
argument is undefined
so you need to explicitly bind it to a desired "this" target.
"
- },
- {
- "name": "placement",
- "defaultValue": "bottom-left",
- "type": "PlacementArray",
- "description": "The preferred placement of the typeahead.
\nPossible values are "top"
, "top-left"
, "top-right"
, "bottom"
, "bottom-left"
,\n"bottom-right"
, "left"
, "left-top"
, "left-bottom"
, "right"
, "right-top"
,\n"right-bottom"
\nAccepts an array of strings or a string with space separated possible values.
\nThe default order of preference is "bottom-left bottom-right top-left top-right"
\nPlease see the positioning overview for more details.
"
- },
- {
- "name": "resultFormatter",
- "type": "(item: any) => string",
- "description": "The function that converts an item from the result list to a string
to display in the popup.
\nMust be provided, if your ngbTypeahead
returns something other than Observable<string[]>
.
\nAlternatively for more complex markup in the popup you should use resultTemplate
.
"
- },
- {
- "name": "resultTemplate",
- "type": "TemplateRef",
- "description": "The template to override the way resulting items are displayed in the popup.
\nSee the ResultTemplateContext for the template context.
\nAlso see the template for results demo for more details.
"
- },
- {
- "name": "showHint",
- "type": "boolean",
- "description": "If true
, will show the hint in the <input>
when an item in the result list matches.
"
- }
- ],
- "outputs": [
- {
- "name": "selectItem",
- "description": "An event emitted right before an item is selected from the result list.
\nEvent payload is of type NgbTypeaheadSelectItemEvent
.
"
- }
- ],
- "properties": [
- {
- "name": "activeDescendant",
- "type": "string",
- "description": ""
- },
- {
- "name": "popupId",
- "type": "string",
- "description": ""
- }
- ],
- "methods": [
- {
- "name": "dismissPopup",
- "description": "Dismisses typeahead popup window
",
- "args": [],
- "returnType": "void"
- },
- {
- "name": "isPopupOpen",
- "description": "Returns true if the typeahead popup window is displayed
",
- "args": [],
- "returnType": "void"
- }
- ]
- }
-};
-
-export default API_DOCS;
\ No newline at end of file
diff --git a/backup/demo/src/app/app.component.html b/backup/demo/src/app/app.component.html
deleted file mode 100644
index d250e81..0000000
--- a/backup/demo/src/app/app.component.html
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/app.component.ts b/backup/demo/src/app/app.component.ts
deleted file mode 100644
index ade7d73..0000000
--- a/backup/demo/src/app/app.component.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { DOCUMENT } from '@angular/common';
-import { Component, Inject, OnInit } from '@angular/core';
-import { NavigationEnd, Router } from '@angular/router';
-import { filter } from 'rxjs/operators';
-
-import { componentsList } from './shared';
-import { Analytics } from './shared/analytics/analytics';
-
-@Component({
- selector: 'ngbd-app',
- templateUrl: './app.component.html'
-})
-export class AppComponent implements OnInit {
- navbarCollapsed = true;
-
- components = componentsList;
-
- constructor(
- private _analytics: Analytics,
- router: Router,
- @Inject(DOCUMENT) document: any
- ) {
- router.events
- .pipe(filter(event => event instanceof NavigationEnd))
- .subscribe(event => {
- const { fragment } = router.parseUrl(router.url);
- if (fragment) {
- setTimeout(() => {
- const element = document.querySelector(`#${fragment}`);
- if (element) {
- element.scrollIntoView();
- }
- }, 0);
- } else {
- window.scrollTo({ top: 0 });
- }
- });
- }
-
- ngOnInit(): void {
- this._analytics.trackPageViews();
- }
-}
diff --git a/backup/demo/src/app/app.module.ts b/backup/demo/src/app/app.module.ts
deleted file mode 100644
index 8bdf3d7..0000000
--- a/backup/demo/src/app/app.module.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import {NgModule} from '@angular/core';
-import {BrowserModule} from '@angular/platform-browser';
-import {NgbModule} from 'sunbird-ui-component';
-
-import {AppComponent} from './app.component';
-import {routing} from './app.routing';
-import {SbCardModule} from './components/card/card.module';
-import {NgbdAccordionModule} from './components/accordion/accordion.module';
-import {NgbdAlertModule} from './components/alert/alert.module';
-import {NgbdButtonsModule} from './components/buttons/buttons.module';
-import {NgbdCarouselModule} from './components/carousel/carousel.module';
-import {NgbdCollapseModule} from './components/collapse/collapse.module';
-import {NgbdDatepickerModule} from './components/datepicker/datepicker.module';
-import {NgbdDropdownModule} from './components/dropdown/dropdown.module';
-import {NgbdModalModule} from './components/modal/modal.module';
-import {NgbdPaginationModule} from './components/pagination/pagination.module';
-import {NgbdPopoverModule} from './components/popover/popover.module';
-import {NgbdProgressbarModule} from './components/progressbar/progressbar.module';
-import {NgbdRatingModule} from './components/rating/rating.module';
-import {NgbdTableModule} from './components/table/table.module';
-import {NgbdTabsetModule} from './components/tabset/tabset.module';
-import {NgbdTimepickerModule} from './components/timepicker/timepicker.module';
-import {NgbdToastModule} from './components/toast/toast.module';
-import {NgbdTooltipModule} from './components/tooltip/tooltip.module';
-import {NgbdTypeaheadModule} from './components/typeahead/typeahead.module';
-import {DefaultComponent} from './default';
-import {GettingStartedPage} from './pages/getting-started/getting-started.component';
-import {PositioningPage} from './pages/positioning/positioning.component';
-import {NgbdSharedModule} from './shared';
-
-
-const DEMOS = [
- SbCardModule,
- NgbdAccordionModule,
- NgbdAlertModule,
- NgbdButtonsModule,
- NgbdCarouselModule,
- NgbdCollapseModule,
- NgbdDatepickerModule,
- NgbdDropdownModule,
- NgbdModalModule,
- NgbdPaginationModule,
- NgbdPopoverModule,
- NgbdProgressbarModule,
- NgbdRatingModule,
- NgbdTableModule,
- NgbdTabsetModule,
- NgbdTimepickerModule,
- NgbdToastModule,
- NgbdTooltipModule,
- NgbdTypeaheadModule
-];
-
-const PAGES = [
- GettingStartedPage,
- PositioningPage
-];
-
-@NgModule({
- declarations: [AppComponent, DefaultComponent, ...PAGES],
- imports: [BrowserModule, routing, NgbModule, NgbdSharedModule, ...DEMOS],
- bootstrap: [AppComponent]
-})
-export class SbdModule {}
diff --git a/backup/demo/src/app/app.routing.ts b/backup/demo/src/app/app.routing.ts
deleted file mode 100644
index 8928e0f..0000000
--- a/backup/demo/src/app/app.routing.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import {ModuleWithProviders} from '@angular/core';
-import {RouterModule, Routes} from '@angular/router';
-
-import {ROUTES as CARD_ROUTES} from './components/card/card.module';
-import {ROUTES as ACCORDION_ROUTES} from './components/accordion/accordion.module';
-import {ROUTES as ALERT_ROUTES} from './components/alert/alert.module';
-import {ROUTES as BUTTONS_ROUTES} from './components/buttons/buttons.module';
-import {ROUTES as CAROUSEL_ROUTES} from './components/carousel/carousel.module';
-import {ROUTES as COLLAPSE_ROUTES} from './components/collapse/collapse.module';
-import {ROUTES as DATEPICKER_ROUTES} from './components/datepicker/datepicker.module';
-import {ROUTES as DROPDOWN_ROUTES} from './components/dropdown/dropdown.module';
-import {ROUTES as MODAL_ROUTES} from './components/modal/modal.module';
-import {ROUTES as PAGINATION_ROUTES} from './components/pagination/pagination.module';
-import {ROUTES as POPOVER_ROUTES} from './components/popover/popover.module';
-import {ROUTES as PROGRESSBAR_ROUTES} from './components/progressbar/progressbar.module';
-import {ROUTES as RATING_ROUTES} from './components/rating/rating.module';
-import {ROUTES as TABLE_ROUTES} from './components/table/table.module';
-import {ROUTES as TABSET_ROUTES} from './components/tabset/tabset.module';
-import {ROUTES as TIMEPICKER_ROUTES} from './components/timepicker/timepicker.module';
-import {ROUTES as TOAST_ROUTES} from './components/toast/toast.module';
-import {ROUTES as TOOLTIP_ROUTES} from './components/tooltip/tooltip.module';
-import {ROUTES as TYPEAHEAD_ROUTES} from './components/typeahead/typeahead.module';
-import {DefaultComponent} from './default';
-import {GettingStartedPage} from './pages/getting-started/getting-started.component';
-import {PositioningPage} from './pages/positioning/positioning.component';
-
-const routes: Routes = [
- { path: '', pathMatch: 'full', redirectTo: 'home' },
- { path: 'home', component: DefaultComponent },
- { path: 'getting-started', component: GettingStartedPage },
- { path: 'positioning', component: PositioningPage },
- { path: 'components', pathMatch: 'full', redirectTo: 'components/alert' },
- { path: 'components/card', children: CARD_ROUTES },
- { path: 'components/accordion', children: ACCORDION_ROUTES },
- { path: 'components/alert', children: ALERT_ROUTES },
- { path: 'components/buttons', children: BUTTONS_ROUTES },
- { path: 'components/carousel', children: CAROUSEL_ROUTES },
- { path: 'components/collapse', children: COLLAPSE_ROUTES },
- { path: 'components/datepicker', children: DATEPICKER_ROUTES },
- { path: 'components/dropdown', children: DROPDOWN_ROUTES },
- { path: 'components/modal', children: MODAL_ROUTES },
- { path: 'components/pagination', children: PAGINATION_ROUTES },
- { path: 'components/popover', children: POPOVER_ROUTES },
- { path: 'components/progressbar', children: PROGRESSBAR_ROUTES },
- { path: 'components/rating', children: RATING_ROUTES },
- { path: 'components/table', children: TABLE_ROUTES },
- { path: 'components/tabset', children: TABSET_ROUTES },
- { path: 'components/toast', children: TOAST_ROUTES },
- { path: 'components/timepicker', children: TIMEPICKER_ROUTES },
- { path: 'components/tooltip', children: TOOLTIP_ROUTES },
- { path: 'components/typeahead', children: TYPEAHEAD_ROUTES },
- { path: '**', redirectTo: 'home' }
-];
-
-export const routing: ModuleWithProviders = RouterModule.forRoot(routes, {
- enableTracing: false,
- useHash: true
-});
diff --git a/backup/demo/src/app/components/accordion/accordion.module.ts b/backup/demo/src/app/components/accordion/accordion.module.ts
deleted file mode 100644
index 4821e4e..0000000
--- a/backup/demo/src/app/components/accordion/accordion.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdAccordionBasic } from './demos/basic/accordion-basic';
-import { NgbdAccordionBasicModule } from './demos/basic/accordion-basic.module';
-import { NgbdAccordionConfig } from './demos/config/accordion-config';
-import { NgbdAccordionConfigModule } from './demos/config/accordion-config.module';
-import { NgbdAccordionHeader } from './demos/header/accordion-header';
-import { NgbdAccordionHeaderModule } from './demos/header/accordion-header.module';
-import { NgbdAccordionPreventchange } from './demos/preventchange/accordion-preventchange';
-import { NgbdAccordionPreventchangeModule } from './demos/preventchange/accordion-preventchange.module';
-import { NgbdAccordionStatic } from './demos/static/accordion-static';
-import { NgbdAccordionStaticModule } from './demos/static/accordion-static.module';
-import { NgbdAccordionToggle } from './demos/toggle/accordion-toggle';
-import { NgbdAccordionToggleModule } from './demos/toggle/accordion-toggle.module';
-
-const DEMOS = {
- basic: {
- title: 'Accordion',
- code: require('!raw-loader!./demos/basic/accordion-basic'),
- markup: require('!raw-loader!./demos/basic/accordion-basic.html'),
- type: NgbdAccordionBasic
- },
- static: {
- title: 'One open panel at a time',
- code: require('!!raw-loader!./demos/static/accordion-static'),
- markup: require('!!raw-loader!./demos/static/accordion-static.html'),
- type: NgbdAccordionStatic
- },
- toggle: {
- title: 'Toggle panels',
- code: require('!!raw-loader!./demos/toggle/accordion-toggle'),
- markup: require('!!raw-loader!./demos/toggle/accordion-toggle.html'),
- type: NgbdAccordionToggle
- },
- header: {
- title: 'Custom header',
- code: require('!!raw-loader!./demos/header/accordion-header'),
- markup: require('!!raw-loader!./demos/header/accordion-header.html'),
- type: NgbdAccordionHeader
- },
- preventchange: {
- title: 'Prevent panel toggle',
- code: require('!!raw-loader!./demos/preventchange/accordion-preventchange'),
- markup: require('!!raw-loader!./demos/preventchange/accordion-preventchange.html'),
- type: NgbdAccordionPreventchange
- },
- config: {
- title: 'Global configuration of accordions',
- code: require('!!raw-loader!./demos/config/accordion-config'),
- markup: require('!!raw-loader!./demos/config/accordion-config.html'),
- type: NgbdAccordionConfig
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdAccordionBasicModule,
- NgbdAccordionConfigModule,
- NgbdAccordionHeaderModule,
- NgbdAccordionToggleModule,
- NgbdAccordionStaticModule,
- NgbdAccordionPreventchangeModule
- ]
-})
-export class NgbdAccordionModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('accordion', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.html b/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.html
deleted file mode 100644
index 29eb649..0000000
--- a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- ★ Fancy title ★
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
diff --git a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.module.ts b/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.module.ts
deleted file mode 100644
index b330e81..0000000
--- a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionBasic } from './accordion-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionBasic],
- exports: [NgbdAccordionBasic],
- bootstrap: [NgbdAccordionBasic]
-})
-export class NgbdAccordionBasicModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.ts b/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.ts
deleted file mode 100644
index 6cfdece..0000000
--- a/backup/demo/src/app/components/accordion/demos/basic/accordion-basic.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
- selector: 'ngbd-accordion-basic',
- templateUrl: './accordion-basic.html'
-})
-export class NgbdAccordionBasic {
-}
diff --git a/backup/demo/src/app/components/accordion/demos/config/accordion-config.html b/backup/demo/src/app/components/accordion/demos/config/accordion-config.html
deleted file mode 100644
index f3d4ac5..0000000
--- a/backup/demo/src/app/components/accordion/demos/config/accordion-config.html
+++ /dev/null
@@ -1,24 +0,0 @@
-This accordion uses customized default values.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
diff --git a/backup/demo/src/app/components/accordion/demos/config/accordion-config.module.ts b/backup/demo/src/app/components/accordion/demos/config/accordion-config.module.ts
deleted file mode 100644
index 59e6c78..0000000
--- a/backup/demo/src/app/components/accordion/demos/config/accordion-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionConfig } from './accordion-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionConfig],
- exports: [NgbdAccordionConfig],
- bootstrap: [NgbdAccordionConfig]
-})
-export class NgbdAccordionConfigModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/config/accordion-config.ts b/backup/demo/src/app/components/accordion/demos/config/accordion-config.ts
deleted file mode 100644
index 48a8be3..0000000
--- a/backup/demo/src/app/components/accordion/demos/config/accordion-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbAccordionConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-accordion-config',
- templateUrl: './accordion-config.html',
- providers: [NgbAccordionConfig] // add the NgbAccordionConfig to the component providers
-})
-export class NgbdAccordionConfig {
- constructor(config: NgbAccordionConfig) {
- // customize default values of accordions used by this component tree
- config.closeOthers = true;
- config.type = 'info';
- }
-}
diff --git a/backup/demo/src/app/components/accordion/demos/header/accordion-header.html b/backup/demo/src/app/components/accordion/demos/header/accordion-header.html
deleted file mode 100644
index 795dd75..0000000
--- a/backup/demo/src/app/components/accordion/demos/header/accordion-header.html
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
First panel - {{ opened ? 'opened' : 'collapsed' }}
- Toggle first
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
-
-
Second panel
-
- Toggle second
-
- {{ disabled ? 'En' : 'Dis' }}able third
-
- Collapse all
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
-
-
Third panel
-
[I'm disabled]
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
diff --git a/backup/demo/src/app/components/accordion/demos/header/accordion-header.module.ts b/backup/demo/src/app/components/accordion/demos/header/accordion-header.module.ts
deleted file mode 100644
index 61f354c..0000000
--- a/backup/demo/src/app/components/accordion/demos/header/accordion-header.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionHeader } from './accordion-header';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionHeader],
- exports: [NgbdAccordionHeader],
- bootstrap: [NgbdAccordionHeader]
-})
-export class NgbdAccordionHeaderModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/header/accordion-header.ts b/backup/demo/src/app/components/accordion/demos/header/accordion-header.ts
deleted file mode 100644
index 01021fc..0000000
--- a/backup/demo/src/app/components/accordion/demos/header/accordion-header.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
- selector: 'ngbd-accordion-header',
- templateUrl: './accordion-header.html'
-})
-export class NgbdAccordionHeader {
- disabled = false;
-}
diff --git a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.html b/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.html
deleted file mode 100644
index 93ff3aa..0000000
--- a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
diff --git a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.module.ts b/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.module.ts
deleted file mode 100644
index 3a948c2..0000000
--- a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionPreventchange } from './accordion-preventchange';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionPreventchange],
- exports: [NgbdAccordionPreventchange],
- bootstrap: [NgbdAccordionPreventchange]
-})
-export class NgbdAccordionPreventchangeModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.ts b/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.ts
deleted file mode 100644
index 2ce2c70..0000000
--- a/backup/demo/src/app/components/accordion/demos/preventchange/accordion-preventchange.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbPanelChangeEvent} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-accordion-preventchange',
- templateUrl: './accordion-preventchange.html',
-})
-export class NgbdAccordionPreventchange {
- public beforeChange($event: NgbPanelChangeEvent) {
-
- if ($event.panelId === 'preventchange-2') {
- $event.preventDefault();
- }
-
- if ($event.panelId === 'preventchange-3' && $event.nextState === false) {
- $event.preventDefault();
- }
- }
-}
diff --git a/backup/demo/src/app/components/accordion/demos/static/accordion-static.html b/backup/demo/src/app/components/accordion/demos/static/accordion-static.html
deleted file mode 100644
index f834c8b..0000000
--- a/backup/demo/src/app/components/accordion/demos/static/accordion-static.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- ★ Fancy title ★
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
diff --git a/backup/demo/src/app/components/accordion/demos/static/accordion-static.module.ts b/backup/demo/src/app/components/accordion/demos/static/accordion-static.module.ts
deleted file mode 100644
index 94aca3a..0000000
--- a/backup/demo/src/app/components/accordion/demos/static/accordion-static.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionStatic } from './accordion-static';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionStatic],
- exports: [NgbdAccordionStatic],
- bootstrap: [NgbdAccordionStatic]
-})
-export class NgbdAccordionStaticModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/static/accordion-static.ts b/backup/demo/src/app/components/accordion/demos/static/accordion-static.ts
deleted file mode 100644
index 32fa6e3..0000000
--- a/backup/demo/src/app/components/accordion/demos/static/accordion-static.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
- selector: 'ngbd-accordion-static',
- templateUrl: './accordion-static.html'
-})
-export class NgbdAccordionStatic {
-}
diff --git a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.html b/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.html
deleted file mode 100644
index bf0d9b7..0000000
--- a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
- Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia
- aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor,
- sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica,
- craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings
- occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus
- labore sustainable VHS.
-
-
-
-
-
-
-Toggle first
-Toggle second
-
diff --git a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.module.ts b/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.module.ts
deleted file mode 100644
index fde1795..0000000
--- a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAccordionToggle } from './accordion-toggle';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAccordionToggle],
- exports: [NgbdAccordionToggle],
- bootstrap: [NgbdAccordionToggle]
-})
-export class NgbdAccordionToggleModule {}
diff --git a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.ts b/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.ts
deleted file mode 100644
index a514631..0000000
--- a/backup/demo/src/app/components/accordion/demos/toggle/accordion-toggle.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-accordion-toggle',
- templateUrl: './accordion-toggle.html'
-})
-export class NgbdAccordionToggle {
-}
diff --git a/backup/demo/src/app/components/alert/alert.module.ts b/backup/demo/src/app/components/alert/alert.module.ts
deleted file mode 100644
index 01da256..0000000
--- a/backup/demo/src/app/components/alert/alert.module.ts
+++ /dev/null
@@ -1,119 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdAlertBasic } from './demos/basic/alert-basic';
-import { NgbdAlertBasicModule } from './demos/basic/alert-basic.module';
-import { NgbdAlertCloseable } from './demos/closeable/alert-closeable';
-import { NgbdAlertCloseableModule } from './demos/closeable/alert-closeable.module';
-import { NgbdAlertConfig } from './demos/config/alert-config';
-import { NgbdAlertConfigModule } from './demos/config/alert-config.module';
-import { NgbdAlertCustom } from './demos/custom/alert-custom';
-import { NgbdAlertCustomModule } from './demos/custom/alert-custom.module';
-import { NgbdAlertSelfclosing } from './demos/selfclosing/alert-selfclosing';
-import { NgbdAlertSelfclosingModule } from './demos/selfclosing/alert-selfclosing.module';
-
-const DEMOS = {
- basic: {
- title: 'Basic Alert',
- type: NgbdAlertBasic,
- files: [
- {
- name: 'alert-basic.html',
- source: require('!!raw-loader!./demos/basic/alert-basic.html')
- },
- {
- name: 'alert-basic.ts',
- source: require('!!raw-loader!./demos/basic/alert-basic')
- }
- ]
- },
- closeable: {
- title: 'Closable Alert',
- type: NgbdAlertCloseable,
- files: [
- {
- name: 'alert-closeable.html',
- source: require('!!raw-loader!./demos/closeable/alert-closeable.html')
- },
- {
- name: 'alert-closeable.ts',
- source: require('!!raw-loader!./demos/closeable/alert-closeable')
- }
- ]
- },
- selfclosing: {
- title: 'Self closing alert',
- type: NgbdAlertSelfclosing,
- files: [
- {
- name: 'alert-selfclosing.html',
- source: require('!!raw-loader!./demos/selfclosing/alert-selfclosing.html')
- },
- {
- name: 'alert-selfclosing.ts',
- source: require('!!raw-loader!./demos/selfclosing/alert-selfclosing')
- }
- ]
- },
- custom: {
- title: 'Custom alert',
- type: NgbdAlertCustom,
- files: [
- {
- name: 'alert-custom.html',
- source: require('!!raw-loader!./demos/custom/alert-custom.html')
- },
- {
- name: 'alert-custom.ts',
- source: require('!!raw-loader!./demos/custom/alert-custom')
- }
- ]
- },
- config: {
- title: 'Global configuration of alerts',
- type: NgbdAlertConfig,
- files: [
- {
- name: 'alert-config.html',
- source: require('!!raw-loader!./demos/config/alert-config.html')
- },
- {
- name: 'alert-config.ts',
- source: require('!!raw-loader!./demos/config/alert-config')
- }
- ]
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdAlertBasicModule,
- NgbdAlertCloseableModule,
- NgbdAlertCustomModule,
- NgbdAlertConfigModule,
- NgbdAlertSelfclosingModule
- ]
-})
-export class NgbdAlertModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('alert', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/alert/demos/basic/alert-basic.html b/backup/demo/src/app/components/alert/demos/basic/alert-basic.html
deleted file mode 100644
index a59f478..0000000
--- a/backup/demo/src/app/components/alert/demos/basic/alert-basic.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- Warning! Better check yourself, you're not looking too good.
-
-
diff --git a/backup/demo/src/app/components/alert/demos/basic/alert-basic.module.ts b/backup/demo/src/app/components/alert/demos/basic/alert-basic.module.ts
deleted file mode 100644
index 77dcecf..0000000
--- a/backup/demo/src/app/components/alert/demos/basic/alert-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAlertBasic } from './alert-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAlertBasic],
- exports: [NgbdAlertBasic],
- bootstrap: [NgbdAlertBasic]
-})
-export class NgbdAlertBasicModule {}
diff --git a/backup/demo/src/app/components/alert/demos/basic/alert-basic.ts b/backup/demo/src/app/components/alert/demos/basic/alert-basic.ts
deleted file mode 100644
index 61abb1e..0000000
--- a/backup/demo/src/app/components/alert/demos/basic/alert-basic.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({selector: 'ngbd-alert-basic', templateUrl: './alert-basic.html'})
-export class NgbdAlertBasic {
-}
diff --git a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.html b/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.html
deleted file mode 100644
index 8c7241b..0000000
--- a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
- {{ alert.message }}
-
-
- Reset
-
diff --git a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.module.ts b/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.module.ts
deleted file mode 100644
index 49a36b4..0000000
--- a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAlertCloseable } from './alert-closeable';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAlertCloseable],
- exports: [NgbdAlertCloseable],
- bootstrap: [NgbdAlertCloseable]
-})
-export class NgbdAlertCloseableModule {}
diff --git a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.ts b/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.ts
deleted file mode 100644
index f76203c..0000000
--- a/backup/demo/src/app/components/alert/demos/closeable/alert-closeable.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Input, Component } from '@angular/core';
-
-interface Alert {
- type: string;
- message: string;
-}
-
-const ALERTS: Alert[] = [{
- type: 'success',
- message: 'This is an success alert',
- }, {
- type: 'info',
- message: 'This is an info alert',
- }, {
- type: 'warning',
- message: 'This is a warning alert',
- }, {
- type: 'danger',
- message: 'This is a danger alert',
- }, {
- type: 'primary',
- message: 'This is a primary alert',
- }, {
- type: 'secondary',
- message: 'This is a secondary alert',
- }, {
- type: 'light',
- message: 'This is a light alert',
- }, {
- type: 'dark',
- message: 'This is a dark alert',
- }
-];
-
-@Component({
- selector: 'ngbd-alert-closeable',
- templateUrl: './alert-closeable.html'
-})
-export class NgbdAlertCloseable {
-
- alerts: Alert[];
-
- constructor() {
- this.reset();
- }
-
- close(alert: Alert) {
- this.alerts.splice(this.alerts.indexOf(alert), 1);
- }
-
- reset() {
- this.alerts = Array.from(ALERTS);
- }
-}
diff --git a/backup/demo/src/app/components/alert/demos/config/alert-config.html b/backup/demo/src/app/components/alert/demos/config/alert-config.html
deleted file mode 100644
index d795c20..0000000
--- a/backup/demo/src/app/components/alert/demos/config/alert-config.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- This alert's type is success and it's not dismissible because the config has been customized
-
-
diff --git a/backup/demo/src/app/components/alert/demos/config/alert-config.module.ts b/backup/demo/src/app/components/alert/demos/config/alert-config.module.ts
deleted file mode 100644
index 9e5078f..0000000
--- a/backup/demo/src/app/components/alert/demos/config/alert-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAlertConfig } from './alert-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAlertConfig],
- exports: [NgbdAlertConfig],
- bootstrap: [NgbdAlertConfig]
-})
-export class NgbdAlertConfigModule {}
diff --git a/backup/demo/src/app/components/alert/demos/config/alert-config.ts b/backup/demo/src/app/components/alert/demos/config/alert-config.ts
deleted file mode 100644
index d9f1e9d..0000000
--- a/backup/demo/src/app/components/alert/demos/config/alert-config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component, Input} from '@angular/core';
-import {NgbAlertConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-alert-config',
- templateUrl: './alert-config.html',
- // add NgbAlertConfig to the component providers
- providers: [NgbAlertConfig]
-})
-export class NgbdAlertConfig {
- @Input() public alerts: Array = [];
-
- constructor(alertConfig: NgbAlertConfig) {
- // customize default values of alerts used by this component tree
- alertConfig.type = 'success';
- alertConfig.dismissible = false;
- }
-}
diff --git a/backup/demo/src/app/components/alert/demos/custom/alert-custom.html b/backup/demo/src/app/components/alert/demos/custom/alert-custom.html
deleted file mode 100644
index cd0e4d9..0000000
--- a/backup/demo/src/app/components/alert/demos/custom/alert-custom.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Whoa! This is a custom alert.
-
diff --git a/backup/demo/src/app/components/alert/demos/custom/alert-custom.module.ts b/backup/demo/src/app/components/alert/demos/custom/alert-custom.module.ts
deleted file mode 100644
index 6606b7d..0000000
--- a/backup/demo/src/app/components/alert/demos/custom/alert-custom.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAlertCustom } from './alert-custom';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAlertCustom],
- exports: [NgbdAlertCustom],
- bootstrap: [NgbdAlertCustom]
-})
-export class NgbdAlertCustomModule {}
diff --git a/backup/demo/src/app/components/alert/demos/custom/alert-custom.ts b/backup/demo/src/app/components/alert/demos/custom/alert-custom.ts
deleted file mode 100644
index fc2ee39..0000000
--- a/backup/demo/src/app/components/alert/demos/custom/alert-custom.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
- selector: 'ngbd-alert-custom',
- templateUrl: './alert-custom.html',
- styles: [`
- :host >>> .alert-custom {
- color: #99004d;
- background-color: #f169b4;
- border-color: #800040;
- }
- `]
-})
-export class NgbdAlertCustom {}
diff --git a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.html b/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.html
deleted file mode 100644
index 4d1f1df..0000000
--- a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
- Static self-closing alert that disappears after 20 seconds (refresh the page if it has already disappeared)
-
-Check out our awesome new features!
-
-
-
-
- Show a self-closing success message that disappears after 5 seconds.
-
-{{ successMessage }}
-
- Change message
-
diff --git a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.module.ts b/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.module.ts
deleted file mode 100644
index 861db10..0000000
--- a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdAlertSelfclosing } from './alert-selfclosing';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdAlertSelfclosing],
- exports: [NgbdAlertSelfclosing],
- bootstrap: [NgbdAlertSelfclosing]
-})
-export class NgbdAlertSelfclosingModule {}
diff --git a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.ts b/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.ts
deleted file mode 100644
index 9f7ea19..0000000
--- a/backup/demo/src/app/components/alert/demos/selfclosing/alert-selfclosing.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import {Component, OnInit} from '@angular/core';
-import {Subject} from 'rxjs';
-import {debounceTime} from 'rxjs/operators';
-
-@Component({
- selector: 'ngbd-alert-selfclosing',
- templateUrl: './alert-selfclosing.html'
-})
-export class NgbdAlertSelfclosing implements OnInit {
- private _success = new Subject();
-
- staticAlertClosed = false;
- successMessage: string;
-
- ngOnInit(): void {
- setTimeout(() => this.staticAlertClosed = true, 20000);
-
- this._success.subscribe((message) => this.successMessage = message);
- this._success.pipe(
- debounceTime(5000)
- ).subscribe(() => this.successMessage = null);
- }
-
- public changeSuccessMessage() {
- this._success.next(`${new Date()} - Message successfully changed.`);
- }
-}
diff --git a/backup/demo/src/app/components/buttons/buttons.module.ts b/backup/demo/src/app/components/buttons/buttons.module.ts
deleted file mode 100644
index bda1fce..0000000
--- a/backup/demo/src/app/components/buttons/buttons.module.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdButtonsCheckbox } from './demos/checkbox/buttons-checkbox';
-import { NgbdButtonsCheckboxModule } from './demos/checkbox/buttons-checkbox.module';
-import { NgbdButtonsCheckboxReactiveModule } from './demos/checkboxreactive/buttons-checkbox-reactive.module';
-import { NgbdButtonsCheckboxreactive } from './demos/checkboxreactive/buttons-checkboxreactive';
-import { NgbdButtonsRadio } from './demos/radio/buttons-radio';
-import { NgbdButtonsRadioModule } from './demos/radio/buttons-radio.module';
-import { NgbdButtonsRadioReactiveModule } from './demos/radioreactive/buttons-radio-reactive.module';
-import { NgbdButtonsRadioreactive } from './demos/radioreactive/buttons-radioreactive';
-
-const DEMOS = {
- checkbox: {
- title: 'Checkbox buttons',
- type: NgbdButtonsCheckbox,
- code: require('!!raw-loader!./demos/checkbox/buttons-checkbox'),
- markup: require('!!raw-loader!./demos/checkbox/buttons-checkbox.html')
- },
- checkboxreactive: {
- title: 'Checkbox buttons (Reactive Forms)',
- type: NgbdButtonsCheckboxreactive,
- code: require('!!raw-loader!./demos/checkboxreactive/buttons-checkboxreactive'),
- markup: require('!!raw-loader!./demos/checkboxreactive/buttons-checkboxreactive.html')
- },
- radio: {
- title: 'Radio buttons',
- type: NgbdButtonsRadio,
- code: require('!!raw-loader!./demos/radio/buttons-radio'),
- markup: require('!!raw-loader!./demos/radio/buttons-radio.html')
- },
- radioreactive: {
- title: 'Radio buttons (Reactive Forms)',
- type: NgbdButtonsRadioreactive,
- code: require('!!raw-loader!./demos/radioreactive/buttons-radioreactive'),
- markup: require('!!raw-loader!./demos/radioreactive/buttons-radioreactive.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdButtonsCheckboxModule,
- NgbdButtonsCheckboxReactiveModule,
- NgbdButtonsRadioModule,
- NgbdButtonsRadioReactiveModule
- ]
-})
-export class NgbdButtonsModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('buttons', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.html b/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.html
deleted file mode 100644
index e87a52d..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- Left (pre-checked)
-
-
- Middle
-
-
- Right
-
-
-
-{{model | json}}
diff --git a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.module.ts b/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.module.ts
deleted file mode 100644
index d3fd95d..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdButtonsCheckbox } from './buttons-checkbox';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdButtonsCheckbox],
- exports: [NgbdButtonsCheckbox],
- bootstrap: [NgbdButtonsCheckbox]
-})
-export class NgbdButtonsCheckboxModule {}
diff --git a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.ts b/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.ts
deleted file mode 100644
index c5edd94..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkbox/buttons-checkbox.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-buttons-checkbox',
- templateUrl: './buttons-checkbox.html'
-})
-export class NgbdButtonsCheckbox {
- model = {
- left: true,
- middle: false,
- right: false
- };
-}
diff --git a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkbox-reactive.module.ts b/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkbox-reactive.module.ts
deleted file mode 100644
index b2c5101..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkbox-reactive.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdButtonsCheckboxreactive } from './buttons-checkboxreactive';
-
-@NgModule({
- imports: [BrowserModule, ReactiveFormsModule, NgbModule],
- declarations: [NgbdButtonsCheckboxreactive],
- exports: [NgbdButtonsCheckboxreactive],
- bootstrap: [NgbdButtonsCheckboxreactive]
-})
-export class NgbdButtonsCheckboxReactiveModule {}
diff --git a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.html b/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.html
deleted file mode 100644
index 4fb67e0..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-{{checkboxGroupForm.value | json}}
diff --git a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.ts b/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.ts
deleted file mode 100644
index 7c0baf9..0000000
--- a/backup/demo/src/app/components/buttons/demos/checkboxreactive/buttons-checkboxreactive.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Component } from '@angular/core';
-import { FormBuilder, FormGroup } from '@angular/forms';
-
-@Component({
- selector: 'ngbd-buttons-checkboxreactive',
- templateUrl: './buttons-checkboxreactive.html'
-})
-export class NgbdButtonsCheckboxreactive {
- public checkboxGroupForm: FormGroup;
-
- constructor(private formBuilder: FormBuilder) {}
-
- ngOnInit() {
- this.checkboxGroupForm = this.formBuilder.group({
- left: true,
- middle: false,
- right: false
- });
- }
-}
diff --git a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.html b/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.html
deleted file mode 100644
index 944e41b..0000000
--- a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- Left (pre-checked)
-
-
- Middle
-
-
- Right
-
-
-
-{{model}}
diff --git a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.module.ts b/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.module.ts
deleted file mode 100644
index b4055d7..0000000
--- a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdButtonsRadio } from './buttons-radio';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdButtonsRadio],
- exports: [NgbdButtonsRadio],
- bootstrap: [NgbdButtonsRadio]
-})
-export class NgbdButtonsRadioModule {}
diff --git a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.ts b/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.ts
deleted file mode 100644
index 1125c05..0000000
--- a/backup/demo/src/app/components/buttons/demos/radio/buttons-radio.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-buttons-radio',
- templateUrl: './buttons-radio.html'
-})
-export class NgbdButtonsRadio {
- model = 1;
-}
diff --git a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radio-reactive.module.ts b/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radio-reactive.module.ts
deleted file mode 100644
index e77c01a..0000000
--- a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radio-reactive.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdButtonsRadioreactive } from './buttons-radioreactive';
-
-@NgModule({
- imports: [BrowserModule, ReactiveFormsModule, NgbModule],
- declarations: [NgbdButtonsRadioreactive],
- exports: [NgbdButtonsRadioreactive],
- bootstrap: [NgbdButtonsRadioreactive]
-})
-export class NgbdButtonsRadioReactiveModule {}
diff --git a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.html b/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.html
deleted file mode 100644
index d85a496..0000000
--- a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-{{radioGroupForm.value['model']}}
diff --git a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.ts b/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.ts
deleted file mode 100644
index b5803e5..0000000
--- a/backup/demo/src/app/components/buttons/demos/radioreactive/buttons-radioreactive.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { FormBuilder, FormGroup } from '@angular/forms';
-
-@Component({
- selector: 'ngbd-buttons-radioreactive',
- templateUrl: './buttons-radioreactive.html'
-})
-export class NgbdButtonsRadioreactive implements OnInit {
- public radioGroupForm: FormGroup;
-
- constructor(private formBuilder: FormBuilder) {}
-
- ngOnInit() {
- this.radioGroupForm = this.formBuilder.group({
- 'model': 1
- });
- }
-}
diff --git a/backup/demo/src/app/components/card/card.module.ts b/backup/demo/src/app/components/card/card.module.ts
deleted file mode 100644
index a1e3d90..0000000
--- a/backup/demo/src/app/components/card/card.module.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-
-import { SbdCardBasic } from './demos/basic/card-basic';
-import { SbdCardBasicModule } from './demos/basic/card-basic.module';
-import { SbdCardConfig } from './demos/config/card-config';
-import { SbdCardConfigModule } from './demos/config/card-config.module';
-
-const DEMOS = {
- basic: {
- title: 'Basic Card',
- type: SbdCardBasic,
- files: [
- {
- name: 'card-basic.html',
- source: require('!!raw-loader!./demos/basic/card-basic.html')
- },
- {
- name: 'card-basic.ts',
- source: require('!!raw-loader!./demos/basic/card-basic')
- }
- ]
- },
- config: {
- title: 'Global configuration of cards',
- type: SbdCardConfig,
- files: [
- {
- name: 'card-config.html',
- source: require('!!raw-loader!./demos/config/card-config.html')
- },
- {
- name: 'card-config.ts',
- source: require('!!raw-loader!./demos/config/card-config')
- }
- ]
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- SbdCardBasicModule,
- SbdCardConfigModule
- ]
-})
-export class SbCardModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('card', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/card/demos/basic/card-basic.html b/backup/demo/src/app/components/card/demos/basic/card-basic.html
deleted file mode 100644
index ef9db3b..0000000
--- a/backup/demo/src/app/components/card/demos/basic/card-basic.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- Card title
- Card topic 1
- Card topic 2
- Card org
- 10
-
-
-
- Card title
- Card label
- Card subject
- Card medium
- Card org
- Card class
-
\ No newline at end of file
diff --git a/backup/demo/src/app/components/card/demos/basic/card-basic.module.ts b/backup/demo/src/app/components/card/demos/basic/card-basic.module.ts
deleted file mode 100644
index 10ccb21..0000000
--- a/backup/demo/src/app/components/card/demos/basic/card-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-
-import { NgbModule } from 'sunbird-ui-component';
-import { SbdCardBasic } from './card-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [SbdCardBasic],
- exports: [SbdCardBasic],
- bootstrap: [SbdCardBasic]
-})
-export class SbdCardBasicModule {}
diff --git a/backup/demo/src/app/components/card/demos/basic/card-basic.ts b/backup/demo/src/app/components/card/demos/basic/card-basic.ts
deleted file mode 100644
index cdecad2..0000000
--- a/backup/demo/src/app/components/card/demos/basic/card-basic.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({selector: 'sb-card-basic', templateUrl: './card-basic.html'})
-export class SbdCardBasic {
-}
diff --git a/backup/demo/src/app/components/card/demos/config/card-config.html b/backup/demo/src/app/components/card/demos/config/card-config.html
deleted file mode 100644
index 93687ac..0000000
--- a/backup/demo/src/app/components/card/demos/config/card-config.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
- Card title
- Card topic 1
- Card topic 2
- Card org
-
-
-
- Card title
- Card label
- Card subject
- Card medium
- Card class
-
\ No newline at end of file
diff --git a/backup/demo/src/app/components/card/demos/config/card-config.module.ts b/backup/demo/src/app/components/card/demos/config/card-config.module.ts
deleted file mode 100644
index 71b7e02..0000000
--- a/backup/demo/src/app/components/card/demos/config/card-config.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-
-import { NgbModule } from 'sunbird-ui-component';
-
-import { SbdCardConfig } from './card-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [SbdCardConfig],
- exports: [SbdCardConfig],
- bootstrap: [SbdCardConfig]
-})
-export class SbdCardConfigModule {}
diff --git a/backup/demo/src/app/components/card/demos/config/card-config.ts b/backup/demo/src/app/components/card/demos/config/card-config.ts
deleted file mode 100644
index 5df8bde..0000000
--- a/backup/demo/src/app/components/card/demos/config/card-config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component, Input} from '@angular/core';
-import {SbCardConfig} from 'sunbird-ui-component';
-
-@Component({
- selector: 'sb-card-config',
- templateUrl: './card-config.html',
- // add NgbAlertConfig to the component providers
- providers: [SbdCardConfig]
-})
-export class SbdCardConfig {
- @Input() public cards: Array = [];
-
- constructor(cardConfig: SbCardConfig) {
- // customize default values of alerts used by this component tree
- cardConfig.type = 'success';
- cardConfig.dismissible = false;
- }
-}
diff --git a/backup/demo/src/app/components/carousel/carousel.module.ts b/backup/demo/src/app/components/carousel/carousel.module.ts
deleted file mode 100644
index 94faa52..0000000
--- a/backup/demo/src/app/components/carousel/carousel.module.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdCarouselBasic } from './demos/basic/carousel-basic';
-import { NgbdCarouselBasicModule } from './demos/basic/carousel-basic.module';
-import { NgbdCarouselConfig } from './demos/config/carousel-config';
-import { NgbdCarouselConfigModule } from './demos/config/carousel-config.module';
-import { NgbdCarouselNavigation } from './demos/navigation/carousel-navigation';
-import { NgbdCarouselNavigationModule } from './demos/navigation/carousel-navigation.module';
-import { NgbdCarouselPause } from './demos/pause/carousel-pause';
-import { NgbdCarouselPauseModule } from './demos/pause/carousel-pause.module';
-
-const DEMOS = {
- basic: {
- title: 'Carousel',
- type: NgbdCarouselBasic,
- code: require('!!raw-loader!./demos/basic/carousel-basic'),
- markup: require('!!raw-loader!./demos/basic/carousel-basic.html')
- },
- navigation: {
- title: 'Navigation arrows and indicators',
- type: NgbdCarouselNavigation,
- code: require('!!raw-loader!./demos/navigation/carousel-navigation'),
- markup: require('!!raw-loader!./demos/navigation/carousel-navigation.html')
- },
- pause: {
- title: 'Pause/cycle',
- type: NgbdCarouselPause,
- code: require('!!raw-loader!./demos/pause/carousel-pause'),
- markup: require('!!raw-loader!./demos/pause/carousel-pause.html')
- },
- config: {
- title: 'Global configuration of carousels',
- type: NgbdCarouselConfig,
- code: require('!!raw-loader!./demos/config/carousel-config'),
- markup: require('!!raw-loader!./demos/config/carousel-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdCarouselBasicModule,
- NgbdCarouselConfigModule,
- NgbdCarouselNavigationModule,
- NgbdCarouselPauseModule
- ]
-})
-export class NgbdCarouselModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('carousel', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.html b/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.html
deleted file mode 100644
index 0bb3474..0000000
--- a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
First slide label
-
Nulla vitae elit libero, a pharetra augue mollis interdum.
-
-
-
-
-
-
-
-
Second slide label
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
-
-
-
-
-
-
-
-
Third slide label
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur.
-
-
-
diff --git a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.module.ts b/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.module.ts
deleted file mode 100644
index 4b272b1..0000000
--- a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdCarouselBasic } from './carousel-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdCarouselBasic],
- exports: [NgbdCarouselBasic],
- bootstrap: [NgbdCarouselBasic]
-})
-export class NgbdCarouselBasicModule {}
diff --git a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.ts b/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.ts
deleted file mode 100644
index f0910bb..0000000
--- a/backup/demo/src/app/components/carousel/demos/basic/carousel-basic.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({selector: 'ngbd-carousel-basic', templateUrl: './carousel-basic.html'})
-export class NgbdCarouselBasic {
- images = [1, 2, 3].map(() => `https://picsum.photos/900/500?random&t=${Math.random()}`);
-}
diff --git a/backup/demo/src/app/components/carousel/demos/config/carousel-config.html b/backup/demo/src/app/components/carousel/demos/config/carousel-config.html
deleted file mode 100644
index 23439de..0000000
--- a/backup/demo/src/app/components/carousel/demos/config/carousel-config.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
10 seconds between slides...
-
This carousel uses customized default values.
-
-
-
-
-
-
-
-
No mouse events...
-
This carousel doesn't pause or resume on mouse events
-
-
-
-
-
-
-
-
No keyboard...
-
This carousel uses customized default values.
-
-
-
-
-
-
-
-
And no wrap after last slide.
-
This carousel uses customized default values.
-
-
-
diff --git a/backup/demo/src/app/components/carousel/demos/config/carousel-config.module.ts b/backup/demo/src/app/components/carousel/demos/config/carousel-config.module.ts
deleted file mode 100644
index 5379286..0000000
--- a/backup/demo/src/app/components/carousel/demos/config/carousel-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdCarouselConfig } from './carousel-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdCarouselConfig],
- exports: [NgbdCarouselConfig],
- bootstrap: [NgbdCarouselConfig]
-})
-export class NgbdCarouselConfigModule {}
diff --git a/backup/demo/src/app/components/carousel/demos/config/carousel-config.ts b/backup/demo/src/app/components/carousel/demos/config/carousel-config.ts
deleted file mode 100644
index 3058664..0000000
--- a/backup/demo/src/app/components/carousel/demos/config/carousel-config.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Component } from '@angular/core';
-import { NgbCarouselConfig } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-carousel-config',
- templateUrl: './carousel-config.html',
- providers: [NgbCarouselConfig] // add NgbCarouselConfig to the component providers
-})
-export class NgbdCarouselConfig {
- images = [1, 2, 3, 4].map(() => `https://picsum.photos/900/500?random&t=${Math.random()}`);
-
- constructor(config: NgbCarouselConfig) {
- // customize default values of carousels used by this component tree
- config.interval = 10000;
- config.wrap = false;
- config.keyboard = false;
- config.pauseOnHover = false;
- }
-}
diff --git a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.html b/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.html
deleted file mode 100644
index fb3f263..0000000
--- a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
No mouse navigation
-
This carousel hides navigation arrows and indicators.
-
-
-
-
-
-
-
- Toggle navigation arrows
- Toggle navigation indicators
-
diff --git a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.module.ts b/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.module.ts
deleted file mode 100644
index 0946890..0000000
--- a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdCarouselNavigation } from './carousel-navigation';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdCarouselNavigation],
- exports: [NgbdCarouselNavigation],
- bootstrap: [NgbdCarouselNavigation]
-})
-export class NgbdCarouselNavigationModule {}
diff --git a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.ts b/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.ts
deleted file mode 100644
index 94148b0..0000000
--- a/backup/demo/src/app/components/carousel/demos/navigation/carousel-navigation.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbCarouselConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-carousel-navigation',
- templateUrl: './carousel-navigation.html',
- providers: [NgbCarouselConfig] // add NgbCarouselConfig to the component providers
-})
-export class NgbdCarouselNavigation {
- showNavigationArrows = false;
- showNavigationIndicators = false;
- images = [1, 2, 3].map(() => `https://picsum.photos/900/500?random&t=${Math.random()}`);
-
- constructor(config: NgbCarouselConfig) {
- // customize default values of carousels used by this component tree
- config.showNavigationArrows = true;
- config.showNavigationIndicators = true;
- }
-}
diff --git a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.html b/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.html
deleted file mode 100644
index 5f7d063..0000000
--- a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
My slide {{i + 1}} title
-
-
-
-
-
-
-
-
-
-
-
-
-
- Pause on hover
-
-
-
- Unpause when clicking on arrows
-
-
-
- Pause when clicking on navigation indicator
-
-
- {{paused ? 'Cycle' : 'Pause' }}
-
diff --git a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.module.ts b/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.module.ts
deleted file mode 100644
index ab4ce58..0000000
--- a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdCarouselPause } from './carousel-pause';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdCarouselPause],
- exports: [NgbdCarouselPause],
- bootstrap: [NgbdCarouselPause]
-})
-export class NgbdCarouselPauseModule {}
diff --git a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.ts b/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.ts
deleted file mode 100644
index 54355df..0000000
--- a/backup/demo/src/app/components/carousel/demos/pause/carousel-pause.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Component, ViewChild } from '@angular/core';
-import { NgbCarousel, NgbSlideEvent, NgbSlideEventSource } from '@ng-bootstrap/ng-bootstrap';
-
-
-@Component({selector: 'ngbd-carousel-pause', templateUrl: './carousel-pause.html'})
-export class NgbdCarouselPause {
- images = [1, 2, 3, 4, 5, 6, 7].map(() => `https://picsum.photos/900/500?random&t=${Math.random()}`);
-
- paused = false;
- unpauseOnArrow = false;
- pauseOnIndicator = false;
- pauseOnHover = true;
-
- @ViewChild('carousel', {static : true}) carousel: NgbCarousel;
-
- togglePaused() {
- if (this.paused) {
- this.carousel.cycle();
- } else {
- this.carousel.pause();
- }
- this.paused = !this.paused;
- }
-
- onSlide(slideEvent: NgbSlideEvent) {
- if (this.unpauseOnArrow && slideEvent.paused &&
- (slideEvent.source === NgbSlideEventSource.ARROW_LEFT || slideEvent.source === NgbSlideEventSource.ARROW_RIGHT)) {
- this.togglePaused();
- }
- if (this.pauseOnIndicator && !slideEvent.paused && slideEvent.source === NgbSlideEventSource.INDICATOR) {
- this.togglePaused();
- }
- }
-}
diff --git a/backup/demo/src/app/components/collapse/collapse.module.ts b/backup/demo/src/app/components/collapse/collapse.module.ts
deleted file mode 100644
index a610207..0000000
--- a/backup/demo/src/app/components/collapse/collapse.module.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdCollapseBasic } from './demos/basic/collapse-basic';
-import { NgbdCollapseBasicModule } from './demos/basic/collapse-basic.module';
-
-const DEMOS = {
- basic: {
- title: 'Collapse',
- type: NgbdCollapseBasic,
- code: require('!!raw-loader!./demos/basic/collapse-basic'),
- markup: require('!!raw-loader!./demos/basic/collapse-basic.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdCollapseBasicModule
- ]
-})
-export class NgbdCollapseModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('collapse', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.html b/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.html
deleted file mode 100644
index 3151210..0000000
--- a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- Toggle
-
-
-
-
-
- You can collapse this card by clicking Toggle
-
-
-
diff --git a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.module.ts b/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.module.ts
deleted file mode 100644
index e6c0838..0000000
--- a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdCollapseBasic } from './collapse-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdCollapseBasic],
- exports: [NgbdCollapseBasic],
- bootstrap: [NgbdCollapseBasic]
-})
-export class NgbdCollapseBasicModule {}
diff --git a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.ts b/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.ts
deleted file mode 100644
index 689adcf..0000000
--- a/backup/demo/src/app/components/collapse/demos/basic/collapse-basic.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
- selector: 'ngbd-collapse-basic',
- templateUrl: './collapse-basic.html'
-})
-export class NgbdCollapseBasic {
- public isCollapsed = false;
-}
diff --git a/backup/demo/src/app/components/datepicker/calendars/datepicker-calendars.component.ts b/backup/demo/src/app/components/datepicker/calendars/datepicker-calendars.component.ts
deleted file mode 100644
index 07dcfb6..0000000
--- a/backup/demo/src/app/components/datepicker/calendars/datepicker-calendars.component.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import {Component} from '@angular/core';
-
-import {Snippet} from '../../../shared/code/snippet';
-import {NgbdExamplesPage} from '../../shared/examples-page/examples.component';
-import {NgbdDatepickerHebrew} from '../demos/hebrew/datepicker-hebrew';
-import {NgbdDatepickerHebrewModule} from '../demos/hebrew/datepicker-hebrew.module';
-import {NgbdDatepickerIslamicCivilModule} from '../demos/islamiccivil/datepicker-islamic-civil.module';
-import {NgbdDatepickerIslamiccivil} from '../demos/islamiccivil/datepicker-islamiccivil';
-import {NgbdDatepickerIslamicUmalquraModule} from '../demos/islamicumalqura/datepicker-islamic-umalqura.module';
-import {NgbdDatepickerIslamicumalqura} from '../demos/islamicumalqura/datepicker-islamicumalqura';
-import {NgbdDatepickerJalali} from '../demos/jalali/datepicker-jalali';
-import {NgbdDatepickerJalaliModule} from '../demos/jalali/datepicker-jalali.module';
-
-export const DEMO_CALENDAR_MODULES = [
- NgbdDatepickerHebrewModule,
- NgbdDatepickerJalaliModule,
- NgbdDatepickerIslamicCivilModule,
- NgbdDatepickerIslamicUmalquraModule,
-];
-
-const DEMOS = [
- {
- id: 'hebrew',
- title: 'Hebrew',
- type: NgbdDatepickerHebrew,
- code: require('!!raw-loader!./../demos/hebrew/datepicker-hebrew'),
- markup: require('!!raw-loader!./../demos/hebrew/datepicker-hebrew.html')
- },
- {
- id: 'jalali',
- title: 'Jalali',
- type: NgbdDatepickerJalali,
- code: require('!!raw-loader!./../demos/jalali/datepicker-jalali'),
- markup: require('!!raw-loader!./../demos/jalali/datepicker-jalali.html')
- },
- {
- id: 'islamiccivil',
- title: 'Islamic Civil',
- type: NgbdDatepickerIslamiccivil,
- code: require('!!raw-loader!./../demos/islamiccivil/datepicker-islamiccivil'),
- markup: require('!!raw-loader!./../demos/islamiccivil/datepicker-islamiccivil.html')
- },
- {
- id: 'islamicumalqura',
- title: 'Islamic Umm al-Qura',
- type: NgbdDatepickerIslamicumalqura,
- code: require('!!raw-loader!./../demos/islamicumalqura/datepicker-islamicumalqura'),
- markup: require('!!raw-loader!./../demos/islamicumalqura/datepicker-islamicumalqura.html')
- }
-];
-
-@Component({
- selector: 'ngbd-datepicker-calendars',
- template: `
-
- Datepicker relies on NgbCalendar
abstract class for calendar-related calculations.
- Default implementation is the NgbCalendarGregorian
, but can be any
- calendar that has notion of days, months and years.
-
-
- For instance, other calendar implementations available are:
-
- NgbCalendarHebrew
+ NgbDatepickerI18nHebrew
- NgbCalendarPersian
- NgbCalendarIslamicCivil
- NgbCalendarIslamicUmalqura
-
-
-
- Please note that calendar support is experimental!
- We're not calendar experts and any community help is very much appreciated.
-
-
-
- To use any of them, simply provide a different calendar implementation.
- Some calendars (like Hebrew in the example and demo below) also come with i18n support
- to override the way day/week/year numerals and weekday/month names are displayed.
-
-
-
-
-
-
- Here are some demos of the calendars you can use
-
-
-
-
-
-
- `
-})
-export class NgbdDatepickerCalendarsComponent extends NgbdExamplesPage {
- demos = DEMOS;
-
- snippets = {
- calendars: Snippet({
- lang: 'typescript',
- code: `
- providers: [
- {provide: NgbCalendar, useClass: NgbCalendarHebrew},
- {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nHebrew}
- ]
- `,
- }),
- };
-}
diff --git a/backup/demo/src/app/components/datepicker/datepicker.module.ts b/backup/demo/src/app/components/datepicker/datepicker.module.ts
deleted file mode 100644
index d10d637..0000000
--- a/backup/demo/src/app/components/datepicker/datepicker.module.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import {
- DEMO_CALENDAR_MODULES,
- NgbdDatepickerCalendarsComponent
-} from './calendars/datepicker-calendars.component';
-import { NgbdDatepickerAdapter } from './demos/adapter/datepicker-adapter';
-import { NgbdDatepickerAdapterModule } from './demos/adapter/datepicker-adpater.module';
-import { NgbdDatepickerBasic } from './demos/basic/datepicker-basic';
-import { NgbdDatepickerBasicModule } from './demos/basic/datepicker-basic.module';
-import { NgbdDatepickerConfig } from './demos/config/datepicker-config';
-import { NgbdDatepickerConfigModule } from './demos/config/datepicker-config.module';
-import { NgbdDatepickerCustomday } from './demos/customday/datepicker-customday';
-import { NgbdDatepickerCustomdayModule } from './demos/customday/datepicker-customday.module';
-import { NgbdDatepickerDisabled } from './demos/disabled/datepicker-disabled';
-import { NgbdDatepickerDisabledModule } from './demos/disabled/datepicker-disabled.module';
-import { NgbdDatepickerFooterTemplateModule } from './demos/footertemplate/datepicker-footer-template.module';
-import { NgbdDatepickerFootertemplate } from './demos/footertemplate/datepicker-footertemplate';
-import { NgbdDatepickerI18n } from './demos/i18n/datepicker-i18n';
-import { NgbdDatepickerI18nModule } from './demos/i18n/datepicker-i18n.module';
-import { NgbdDatepickerMultiple } from './demos/multiple/datepicker-multiple';
-import { NgbdDatepickerMultipleModule } from './demos/multiple/datepicker-multiple.module';
-import { NgbdDatepickerPopup } from './demos/popup/datepicker-popup';
-import { NgbdDatepickerPopupModule } from './demos/popup/datepicker-popup.module';
-import { NgbdDatepickerRange } from './demos/range/datepicker-range';
-import { NgbdDatepickerRangeModule } from './demos/range/datepicker-range.module';
-import { NgbdDatepickerOverviewComponent } from './overview/datepicker-overview.component';
-import { NgbdDatepickerOverviewDemoComponent } from './overview/demo/datepicker-overview-demo.component';
-import { NgbdDatepickerPositiontargetModule } from './demos/positiontarget/datepicker-position-target.module';
-import { NgbdDatepickerPositiontarget } from './demos/positiontarget/datepicker-positiontarget';
-
-const OVERVIEW = {
- 'basic-usage': 'Basic Usage',
- 'getting-date': 'Getting/setting a date',
- 'date-model': 'Date model and format',
- navigation: 'Moving around',
- 'limiting-dates': 'Disabling and limiting dates',
- 'day-template': 'Day display customization',
- today: 'Today\'s date',
- 'footer-template': 'Custom footer',
- range: 'Range selection',
- i18n: 'Internationalization',
- 'keyboard-shortcuts': 'Keyboard shortcuts'
-};
-
-const DEMOS = {
- basic: {
- title: 'Basic datepicker',
- type: NgbdDatepickerBasic,
- code: require('!!raw-loader!./demos/basic/datepicker-basic'),
- markup: require('!!raw-loader!./demos/basic/datepicker-basic.html')
- },
- popup: {
- title: 'Datepicker in a popup',
- type: NgbdDatepickerPopup,
- code: require('!!raw-loader!./demos/popup/datepicker-popup'),
- markup: require('!!raw-loader!./demos/popup/datepicker-popup.html')
- },
- multiple: {
- title: 'Multiple months',
- type: NgbdDatepickerMultiple,
- code: require('!!raw-loader!./demos/multiple/datepicker-multiple'),
- markup: require('!!raw-loader!./demos/multiple/datepicker-multiple.html')
- },
- range: {
- title: 'Range selection',
- type: NgbdDatepickerRange,
- code: require('!!raw-loader!./demos/range/datepicker-range'),
- markup: require('!!raw-loader!./demos/range/datepicker-range.html')
- },
- disabled: {
- title: 'Disabled datepicker',
- type: NgbdDatepickerDisabled,
- code: require('!!raw-loader!./demos/disabled/datepicker-disabled'),
- markup: require('!!raw-loader!./demos/disabled/datepicker-disabled.html')
- },
- adapter: {
- title: 'Custom date adapter',
- type: NgbdDatepickerAdapter,
- code: require('!!raw-loader!./demos/adapter/datepicker-adapter'),
- markup: require('!!raw-loader!./demos/adapter/datepicker-adapter.html')
- },
- i18n: {
- title: 'Internationalization of datepickers',
- type: NgbdDatepickerI18n,
- code: require('!!raw-loader!./demos/i18n/datepicker-i18n'),
- markup: require('!!raw-loader!./demos/i18n/datepicker-i18n.html')
- },
- customday: {
- title: 'Custom day view',
- type: NgbdDatepickerCustomday,
- code: require('!!raw-loader!./demos/customday/datepicker-customday'),
- markup: require('!!raw-loader!./demos/customday/datepicker-customday.html')
- },
- footertemplate: {
- title: 'Footer template',
- type: NgbdDatepickerFootertemplate,
- code: require('!!raw-loader!./demos/footertemplate/datepicker-footertemplate'),
- markup: require('!!raw-loader!./demos/footertemplate/datepicker-footertemplate.html')
- },
- positiontarget: {
- title: 'Position target',
- type: NgbdDatepickerPositiontarget,
- code: require('!!raw-loader!./demos/positiontarget/datepicker-positiontarget'),
- markup: require('!!raw-loader!./demos/positiontarget/datepicker-positiontarget.html')
- },
- config: {
- title: 'Global configuration of datepickers',
- type: NgbdDatepickerConfig,
- code: require('!!raw-loader!./demos/config/datepicker-config'),
- markup: require('!!raw-loader!./demos/config/datepicker-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'overview' },
- {
- path: '',
- component: ComponentWrapper,
- data: { OVERVIEW },
- children: [
- { path: 'overview', component: NgbdDatepickerOverviewComponent },
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'calendars', component: NgbdDatepickerCalendarsComponent },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdDatepickerBasicModule,
- NgbdDatepickerPopupModule,
- NgbdDatepickerDisabledModule,
- NgbdDatepickerI18nModule,
- NgbdDatepickerCustomdayModule,
- NgbdDatepickerFooterTemplateModule,
- NgbdDatepickerConfigModule,
- NgbdDatepickerPositiontargetModule,
- NgbdDatepickerMultipleModule,
- NgbdDatepickerRangeModule,
- NgbdDatepickerAdapterModule,
- ...DEMO_CALENDAR_MODULES
- ],
- declarations: [
- NgbdDatepickerCalendarsComponent,
- NgbdDatepickerOverviewComponent,
- NgbdDatepickerOverviewDemoComponent
- ]
-})
-export class NgbdDatepickerModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('datepicker', DEMOS, OVERVIEW);
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.html b/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.html
deleted file mode 100644
index d9d9c90..0000000
--- a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.html
+++ /dev/null
@@ -1,38 +0,0 @@
-These datepickers use custom Date adapter that lets you use your own model implementation.
-In this example we are converting from and to a JS native Date object
-
-
-
-
-
-
-
Select Today
-
-
-
Model: {{ model1 | json }}
-
State: {{ c1.status }}
-
-
-
-
-
-
-
Select Today
-
-
-
-
Model: {{ model2 | json }}
-
State: {{ c2.status }}
-
-
-
diff --git a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.ts b/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.ts
deleted file mode 100644
index 700301f..0000000
--- a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adapter.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {NgbDateAdapter, NgbDateStruct, NgbDateNativeAdapter} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-adapter',
- templateUrl: './datepicker-adapter.html',
-
- // NOTE: For this example we are only providing current component, but probably
- // NOTE: you will want to provide your main App Module
- providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeAdapter}]
-})
-export class NgbdDatepickerAdapter {
-
- model1: Date;
- model2: Date;
-
- get today() {
- return new Date();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adpater.module.ts b/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adpater.module.ts
deleted file mode 100644
index 3ff4a4d..0000000
--- a/backup/demo/src/app/components/datepicker/demos/adapter/datepicker-adpater.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerAdapter } from './datepicker-adapter';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerAdapter],
- exports: [NgbdDatepickerAdapter],
- bootstrap: [NgbdDatepickerAdapter]
-})
-export class NgbdDatepickerAdapterModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.html b/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.html
deleted file mode 100644
index 32cdd95..0000000
--- a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.html
+++ /dev/null
@@ -1,14 +0,0 @@
-Simple datepicker
-
-
-
-
-
-Select Today
-To current month
-To Feb 2013
-
-
-
-Month: {{ date.month }}.{{ date.year }}
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.module.ts b/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.module.ts
deleted file mode 100644
index 749f150..0000000
--- a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerBasic } from './datepicker-basic';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerBasic],
- exports: [NgbdDatepickerBasic],
- bootstrap: [NgbdDatepickerBasic]
-})
-export class NgbdDatepickerBasicModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.ts b/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.ts
deleted file mode 100644
index 819abd5..0000000
--- a/backup/demo/src/app/components/datepicker/demos/basic/datepicker-basic.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbDateStruct, NgbCalendar} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-basic',
- templateUrl: './datepicker-basic.html'
-})
-export class NgbdDatepickerBasic {
-
- model: NgbDateStruct;
- date: {year: number, month: number};
-
- constructor(private calendar: NgbCalendar) {
- }
-
- selectToday() {
- this.model = this.calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.html b/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.html
deleted file mode 100644
index 83d2f30..0000000
--- a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.html
+++ /dev/null
@@ -1,3 +0,0 @@
-This datepicker uses customized default values.
-
-
diff --git a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.module.ts b/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.module.ts
deleted file mode 100644
index c152fb2..0000000
--- a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerConfig } from './datepicker-config';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerConfig],
- exports: [NgbdDatepickerConfig],
- bootstrap: [NgbdDatepickerConfig]
-})
-export class NgbdDatepickerConfigModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.ts b/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.ts
deleted file mode 100644
index d03851b..0000000
--- a/backup/demo/src/app/components/datepicker/demos/config/datepicker-config.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbDatepickerConfig, NgbCalendar, NgbDate, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-config',
- templateUrl: './datepicker-config.html',
- providers: [NgbDatepickerConfig] // add NgbDatepickerConfig to the component providers
-})
-export class NgbdDatepickerConfig {
-
- model: NgbDateStruct;
-
- constructor(config: NgbDatepickerConfig, calendar: NgbCalendar) {
- // customize default values of datepickers used by this component tree
- config.minDate = {year: 1900, month: 1, day: 1};
- config.maxDate = {year: 2099, month: 12, day: 31};
-
- // days that don't belong to current month are not visible
- config.outsideDays = 'hidden';
-
- // weekends are disabled
- config.markDisabled = (date: NgbDate) => calendar.getWeekday(date) >= 6;
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.html b/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.html
deleted file mode 100644
index 63cc314..0000000
--- a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.html
+++ /dev/null
@@ -1,20 +0,0 @@
-This datepicker uses a custom template to display days. All week-ends are displayed with an orange background.
-
-
-
-
-
- {{ date.day }}
-
-
diff --git a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.module.ts b/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.module.ts
deleted file mode 100644
index 4799b6b..0000000
--- a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerCustomday } from './datepicker-customday';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerCustomday],
- exports: [NgbdDatepickerCustomday],
- bootstrap: [NgbdDatepickerCustomday]
-})
-export class NgbdDatepickerCustomdayModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.ts b/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.ts
deleted file mode 100644
index eee057e..0000000
--- a/backup/demo/src/app/components/datepicker/demos/customday/datepicker-customday.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbCalendar, NgbDate, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-customday',
- templateUrl: './datepicker-customday.html',
- styles: [`
- .custom-day {
- text-align: center;
- padding: 0.185rem 0.25rem;
- border-radius: 0.25rem;
- display: inline-block;
- width: 2rem;
- }
- .custom-day:hover, .custom-day.focused {
- background-color: #e6e6e6;
- }
- .weekend {
- background-color: #f0ad4e;
- border-radius: 1rem;
- color: white;
- }
- .hidden {
- display: none;
- }
- `]
-})
-export class NgbdDatepickerCustomday {
- model: NgbDateStruct;
-
- constructor(private calendar: NgbCalendar) {
- }
-
- isDisabled = (date: NgbDate, current: {month: number}) => date.month !== current.month;
- isWeekend = (date: NgbDate) => this.calendar.getWeekday(date) >= 6;
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.html b/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.html
deleted file mode 100644
index 819e0f9..0000000
--- a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.html
+++ /dev/null
@@ -1,9 +0,0 @@
-Disabled datepicker
-
-
-
-
-
-
- {{ disabled ? "disabled" : "enabled"}}
-
diff --git a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.module.ts b/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.module.ts
deleted file mode 100644
index 4440be0..0000000
--- a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerDisabled } from './datepicker-disabled';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerDisabled],
- exports: [NgbdDatepickerDisabled],
- bootstrap: [NgbdDatepickerDisabled]
-})
-export class NgbdDatepickerDisabledModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.ts b/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.ts
deleted file mode 100644
index e0aecf5..0000000
--- a/backup/demo/src/app/components/datepicker/demos/disabled/datepicker-disabled.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbCalendar, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-disabled',
- templateUrl: './datepicker-disabled.html'
-})
-export class NgbdDatepickerDisabled {
-
- model: NgbDateStruct;
- disabled = true;
-
- constructor(calendar: NgbCalendar) {
- this.model = calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footer-template.module.ts b/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footer-template.module.ts
deleted file mode 100644
index a39a992..0000000
--- a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footer-template.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerFootertemplate } from './datepicker-footertemplate';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerFootertemplate],
- exports: [NgbdDatepickerFootertemplate],
- bootstrap: [NgbdDatepickerFootertemplate]
-})
-export class NgbdDatepickerFooterTemplateModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.html b/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.html
deleted file mode 100644
index d9dd0a5..0000000
--- a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.html
+++ /dev/null
@@ -1,19 +0,0 @@
-This datepicker uses a footer template which is presented inside datepicker. Today and close buttons used as an example.
-
-
-
-
-
- Today
- Close
-
diff --git a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.ts b/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.ts
deleted file mode 100644
index c788409..0000000
--- a/backup/demo/src/app/components/datepicker/demos/footertemplate/datepicker-footertemplate.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbCalendar, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-footertemplate',
- templateUrl: './datepicker-footertemplate.html',
-})
-export class NgbdDatepickerFootertemplate {
- model: NgbDateStruct;
- today = this.calendar.getToday();
-
- constructor(private calendar: NgbCalendar) {}
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.html b/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.html
deleted file mode 100644
index 6e78097..0000000
--- a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
- The Hebrew or Jewish calendar is a lunisolar calendar.
- In Israel it is used for religious purposes and frequently as an official calendar for civil purposes.
-
-
-
-
-
-
-
-
{{ data.gregorian.day + '/' + (data.gregorian.month) }}
-
{{ i18n.getDayNumerals(date) }}
-
-
-
-
-
-Select Today
-To current month
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.module.ts b/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.module.ts
deleted file mode 100644
index 99c41f4..0000000
--- a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerHebrew } from './datepicker-hebrew';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerHebrew],
- exports: [NgbdDatepickerHebrew],
- bootstrap: [NgbdDatepickerHebrew]
-})
-export class NgbdDatepickerHebrewModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.ts b/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.ts
deleted file mode 100644
index be2683e..0000000
--- a/backup/demo/src/app/components/datepicker/demos/hebrew/datepicker-hebrew.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import {Component} from '@angular/core';
-import {
- NgbCalendar,
- NgbCalendarHebrew, NgbDate,
- NgbDatepickerI18n,
- NgbDatepickerI18nHebrew,
- NgbDateStruct
-} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-hebrew',
- templateUrl: './datepicker-hebrew.html',
- styles: [`
- .hebrew-day {
- text-align: right;
- padding: 0.25rem 0.65rem 0.25rem 0.25rem;
- border-radius: 0.25rem;
- display: inline-block;
- height: 2.75rem;
- width: 2.75rem;
- }
- .hebrew-day:hover, .hebrew-day.focused {
- background-color: #e6e6e6;
- }
- .hebrew-day.selected {
- background-color: #007bff;
- color: white;
- }
- .outside {
- color: lightgray;
- }
- .gregorian-num {
- font-size: 0.5rem;
- direction: ltr;
- }
- `],
- providers: [
- {provide: NgbCalendar, useClass: NgbCalendarHebrew},
- {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nHebrew}
- ]
-})
-export class NgbdDatepickerHebrew {
-
- model: NgbDateStruct;
-
- constructor(private calendar: NgbCalendar, public i18n: NgbDatepickerI18n) {
- this.dayTemplateData = this.dayTemplateData.bind(this);
- }
-
- dayTemplateData(date: NgbDate) {
- return {
- gregorian: (this.calendar as NgbCalendarHebrew).toGregorian(date)
- };
- }
-
- selectToday() {
- this.model = this.calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.html b/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.html
deleted file mode 100644
index 0634abf..0000000
--- a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
- If you configure the locale and register the locale data as explained in the
- i18n guide , the date picker will honor
- the locale and use days and months names from the locale data. You can however
- provide a custom service, as demonstrated in this example, to customize the
- days and months names the way you want to.
-
-
-Datepicker in French
-
-
-
diff --git a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.module.ts b/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.module.ts
deleted file mode 100644
index a0eedaa..0000000
--- a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerI18n } from './datepicker-i18n';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerI18n],
- exports: [NgbdDatepickerI18n],
- bootstrap: [NgbdDatepickerI18n]
-})
-export class NgbdDatepickerI18nModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.ts b/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.ts
deleted file mode 100644
index e7da10c..0000000
--- a/backup/demo/src/app/components/datepicker/demos/i18n/datepicker-i18n.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {NgbDatepickerI18n, NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-const I18N_VALUES = {
- 'fr': {
- weekdays: ['Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa', 'Di'],
- months: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aou', 'Sep', 'Oct', 'Nov', 'Déc'],
- }
- // other languages you would support
-};
-
-// Define a service holding the language. You probably already have one if your app is i18ned. Or you could also
-// use the Angular LOCALE_ID value
-@Injectable()
-export class I18n {
- language = 'fr';
-}
-
-// Define custom service providing the months and weekdays translations
-@Injectable()
-export class CustomDatepickerI18n extends NgbDatepickerI18n {
-
- constructor(private _i18n: I18n) {
- super();
- }
-
- getWeekdayShortName(weekday: number): string {
- return I18N_VALUES[this._i18n.language].weekdays[weekday - 1];
- }
- getMonthShortName(month: number): string {
- return I18N_VALUES[this._i18n.language].months[month - 1];
- }
- getMonthFullName(month: number): string {
- return this.getMonthShortName(month);
- }
-
- getDayAriaLabel(date: NgbDateStruct): string {
- return `${date.day}-${date.month}-${date.year}`;
- }
-}
-
-@Component({
- selector: 'ngbd-datepicker-i18n',
- templateUrl: './datepicker-i18n.html',
- providers: [I18n, {provide: NgbDatepickerI18n, useClass: CustomDatepickerI18n}] // define custom NgbDatepickerI18n provider
-})
-export class NgbdDatepickerI18n {
- model: NgbDateStruct;
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamic-civil.module.ts b/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamic-civil.module.ts
deleted file mode 100644
index 0b298bf..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamic-civil.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerIslamiccivil } from './datepicker-islamiccivil';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerIslamiccivil],
- exports: [NgbdDatepickerIslamiccivil],
- bootstrap: [NgbdDatepickerIslamiccivil]
-})
-export class NgbdDatepickerIslamicCivilModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.html b/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.html
deleted file mode 100644
index 55181f5..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
- The civil calendar is a type of Hijri calendars used in islamic countries.
- It uses a fixed cycle of alternating 29- and 30-day months, with a leap day added to the last month of 11 out of every 30 years
-
-
-
-
-
-
-
-Select Today
-To current month
-To Saf. 1434
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.ts b/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.ts
deleted file mode 100644
index 99dc9ed..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamiccivil/datepicker-islamiccivil.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {
- NgbDateStruct, NgbCalendar, NgbCalendarIslamicCivil, NgbDatepickerI18n
-} from '@ng-bootstrap/ng-bootstrap';
-
-const WEEKDAYS = ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'];
-const MONTHS = ['محرم', 'صفر', 'ربيع الأول', 'ربيع الآخر', 'جمادى الأولى', 'جمادى الآخرة', 'رجب', 'شعبان', 'رمضان', 'شوال',
- 'ذو القعدة', 'ذو الحجة'];
-
-@Injectable()
-export class IslamicI18n extends NgbDatepickerI18n {
-
- getWeekdayShortName(weekday: number) {
- return WEEKDAYS[weekday - 1];
- }
-
- getMonthShortName(month: number) {
- return MONTHS[month - 1];
- }
-
- getMonthFullName(month: number) {
- return MONTHS[month - 1];
- }
-
- getDayAriaLabel(date: NgbDateStruct): string {
- return `${date.day}-${date.month}-${date.year}`;
- }
-}
-
-@Component({
- selector: 'ngbd-datepicker-islamiccivil',
- templateUrl: './datepicker-islamiccivil.html',
- providers: [
- {provide: NgbCalendar, useClass: NgbCalendarIslamicCivil},
- {provide: NgbDatepickerI18n, useClass: IslamicI18n}
- ]
-})
-export class NgbdDatepickerIslamiccivil {
-
- model: NgbDateStruct;
-
- constructor(private calendar: NgbCalendar) {}
-
- selectToday() {
- this.model = this.calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamic-umalqura.module.ts b/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamic-umalqura.module.ts
deleted file mode 100644
index 8576979..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamic-umalqura.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerIslamicumalqura } from './datepicker-islamicumalqura';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerIslamicumalqura],
- exports: [NgbdDatepickerIslamicumalqura],
- bootstrap: [NgbdDatepickerIslamicumalqura]
-})
-export class NgbdDatepickerIslamicUmalquraModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.html b/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.html
deleted file mode 100644
index b6b4ee4..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
- Umm al-Qura calendar is a type of Hijri calendars based on astronomical calculations and used
- in Saudi Arabia for administrative purposes
-
-
-
-
-
-
-
-Select Today
-To current month
-To Saf. 1434
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.ts b/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.ts
deleted file mode 100644
index 77bde17..0000000
--- a/backup/demo/src/app/components/datepicker/demos/islamicumalqura/datepicker-islamicumalqura.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { Component, Injectable } from '@angular/core';
-import {
- NgbDateStruct, NgbCalendar, NgbCalendarIslamicUmalqura, NgbDatepickerI18n
-} from '@ng-bootstrap/ng-bootstrap';
-
-const WEEKDAYS = ['ن', 'ث', 'ر', 'خ', 'ج', 'س', 'ح'];
-const MONTHS = ['محرم', 'صفر', 'ربيع الأول', 'ربيع الآخر', 'جمادى الأولى', 'جمادى الآخرة', 'رجب', 'شعبان', 'رمضان', 'شوال',
- 'ذو القعدة', 'ذو الحجة'];
-
-@Injectable()
-export class IslamicI18n extends NgbDatepickerI18n {
-
- getWeekdayShortName(weekday: number) {
- return WEEKDAYS[weekday - 1];
- }
-
- getMonthShortName(month: number) {
- return MONTHS[month - 1];
- }
-
- getMonthFullName(month: number) {
- return MONTHS[month - 1];
- }
-
- getDayAriaLabel(date: NgbDateStruct): string {
- return `${date.day}-${date.month}-${date.year}`;
- }
-}
-
-@Component({
- selector: 'ngbd-datepicker-islamicumalqura',
- templateUrl: './datepicker-islamicumalqura.html',
- providers: [
- {provide: NgbCalendar, useClass: NgbCalendarIslamicUmalqura},
- {provide: NgbDatepickerI18n, useClass: IslamicI18n}
- ]
-})
-export class NgbdDatepickerIslamicumalqura {
-
- model: NgbDateStruct;
-
- constructor(private calendar: NgbCalendar) {}
-
- selectToday() {
- this.model = this.calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.html b/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.html
deleted file mode 100644
index 6fbd882..0000000
--- a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- The Jalali calendar is a solar calendar that was used in Persia.
- Variants of it are still in use in Iran and Afghanistan
-
-
-
-
-
-
-Select Today
-To current month
-To Tir. 1396
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.module.ts b/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.module.ts
deleted file mode 100644
index c55b5a3..0000000
--- a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerJalali } from './datepicker-jalali';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerJalali],
- exports: [NgbdDatepickerJalali],
- bootstrap: [NgbdDatepickerJalali]
-})
-export class NgbdDatepickerJalaliModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.ts b/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.ts
deleted file mode 100644
index 4c6bfc3..0000000
--- a/backup/demo/src/app/components/datepicker/demos/jalali/datepicker-jalali.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {NgbDateStruct, NgbCalendar, NgbDatepickerI18n, NgbCalendarPersian} from '@ng-bootstrap/ng-bootstrap';
-
-const WEEKDAYS_SHORT = ['د', 'س', 'چ', 'پ', 'ج', 'ش', 'ی'];
-const MONTHS = ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'];
-
-@Injectable()
-export class NgbDatepickerI18nPersian extends NgbDatepickerI18n {
- getWeekdayShortName(weekday: number) { return WEEKDAYS_SHORT[weekday - 1]; }
- getMonthShortName(month: number) { return MONTHS[month - 1]; }
- getMonthFullName(month: number) { return MONTHS[month - 1]; }
- getDayAriaLabel(date: NgbDateStruct): string { return `${date.year}-${this.getMonthFullName(date.month)}-${date.day}`; }
-}
-
-@Component({
- selector: 'ngbd-datepicker-jalali',
- templateUrl: './datepicker-jalali.html',
- providers: [
- {provide: NgbCalendar, useClass: NgbCalendarPersian},
- {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nPersian}
- ]
-})
-export class NgbdDatepickerJalali {
-
- model: NgbDateStruct;
- date: {year: number, month: number};
-
- constructor(private calendar: NgbCalendar) {
- }
-
- selectToday() {
- this.model = this.calendar.getToday();
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.html b/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.html
deleted file mode 100644
index 870e375..0000000
--- a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- One month
- Two months
- Three months
-
-
-
- Without navigation
- With select boxes
- Without select boxes
-
-
-
- Week numbers
- No week numbers
-
-
-
- Visible outside days
- Hidden outside days
- Collapsed outside days
-
-
-
diff --git a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.module.ts b/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.module.ts
deleted file mode 100644
index 32e93f7..0000000
--- a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerMultiple } from './datepicker-multiple';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerMultiple],
- exports: [NgbdDatepickerMultiple],
- bootstrap: [NgbdDatepickerMultiple]
-})
-export class NgbdDatepickerMultipleModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.ts b/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.ts
deleted file mode 100644
index 6458ee8..0000000
--- a/backup/demo/src/app/components/datepicker/demos/multiple/datepicker-multiple.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-datepicker-multiple',
- templateUrl: './datepicker-multiple.html',
- styles: [`
- select.custom-select {
- margin: 0.5rem 0.5rem 0 0;
- width: auto;
- }
- `]
-})
-export class NgbdDatepickerMultiple {
-
- displayMonths = 2;
- navigation = 'select';
- showWeekNumbers = false;
- outsideDays = 'visible';
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.html b/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.html
deleted file mode 100644
index ae965bb..0000000
--- a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.module.ts b/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.module.ts
deleted file mode 100644
index 314e75f..0000000
--- a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerPopup } from './datepicker-popup';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerPopup],
- exports: [NgbdDatepickerPopup],
- bootstrap: [NgbdDatepickerPopup]
-})
-export class NgbdDatepickerPopupModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.ts b/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.ts
deleted file mode 100644
index a98a470..0000000
--- a/backup/demo/src/app/components/datepicker/demos/popup/datepicker-popup.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-datepicker-popup',
- templateUrl: './datepicker-popup.html'
-})
-export class NgbdDatepickerPopup {
- model;
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-position-target.module.ts b/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-position-target.module.ts
deleted file mode 100644
index 0b7ebea..0000000
--- a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-position-target.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerPositiontarget } from './datepicker-positiontarget';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdDatepickerPositiontarget],
- exports: [NgbdDatepickerPositiontarget],
- bootstrap: [NgbdDatepickerPositiontarget]
-})
-export class NgbdDatepickerPositiontargetModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.html b/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.html
deleted file mode 100644
index c205839..0000000
--- a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.html
+++ /dev/null
@@ -1,28 +0,0 @@
-This datepicker uses a custom position target and placement. Popup is positioned according to the toggle button instead of input which is default.
-
-
-
-
-
-
-
- Placement
-
- Top
- Bottom
- Left
- Right
-
-
-
\ No newline at end of file
diff --git a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.ts b/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.ts
deleted file mode 100644
index 502716b..0000000
--- a/backup/demo/src/app/components/datepicker/demos/positiontarget/datepicker-positiontarget.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-positiontarget',
- templateUrl: './datepicker-positiontarget.html',
-})
-export class NgbdDatepickerPositiontarget {
- model: NgbDateStruct;
- placement = 'bottom';
-}
diff --git a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.html b/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.html
deleted file mode 100644
index 8705210..0000000
--- a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.html
+++ /dev/null
@@ -1,20 +0,0 @@
-Example of the range selection
-
-
-
-
-
-
- {{ date.day }}
-
-
-
-
-
-From: {{ fromDate | json }}
-To: {{ toDate | json }}
diff --git a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.module.ts b/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.module.ts
deleted file mode 100644
index de1bcd1..0000000
--- a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDatepickerRange } from './datepicker-range';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDatepickerRange],
- exports: [NgbdDatepickerRange],
- bootstrap: [NgbdDatepickerRange]
-})
-export class NgbdDatepickerRangeModule {}
diff --git a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.ts b/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.ts
deleted file mode 100644
index 4c21f0a..0000000
--- a/backup/demo/src/app/components/datepicker/demos/range/datepicker-range.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbDate, NgbCalendar} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-range',
- templateUrl: './datepicker-range.html',
- styles: [`
- .custom-day {
- text-align: center;
- padding: 0.185rem 0.25rem;
- display: inline-block;
- height: 2rem;
- width: 2rem;
- }
- .custom-day.focused {
- background-color: #e6e6e6;
- }
- .custom-day.range, .custom-day:hover {
- background-color: rgb(2, 117, 216);
- color: white;
- }
- .custom-day.faded {
- background-color: rgba(2, 117, 216, 0.5);
- }
- `]
-})
-export class NgbdDatepickerRange {
-
- hoveredDate: NgbDate;
-
- fromDate: NgbDate;
- toDate: NgbDate;
-
- constructor(calendar: NgbCalendar) {
- this.fromDate = calendar.getToday();
- this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
- }
-
- onDateSelection(date: NgbDate) {
- if (!this.fromDate && !this.toDate) {
- this.fromDate = date;
- } else if (this.fromDate && !this.toDate && date.after(this.fromDate)) {
- this.toDate = date;
- } else {
- this.toDate = null;
- this.fromDate = date;
- }
- }
-
- isHovered(date: NgbDate) {
- return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate);
- }
-
- isInside(date: NgbDate) {
- return date.after(this.fromDate) && date.before(this.toDate);
- }
-
- isRange(date: NgbDate) {
- return date.equals(this.fromDate) || date.equals(this.toDate) || this.isInside(date) || this.isHovered(date);
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.html b/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.html
deleted file mode 100644
index 258d66d..0000000
--- a/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.html
+++ /dev/null
@@ -1,371 +0,0 @@
-
- Datepicker will help you with date selection.
- It can be used either inline with NgbDatepicker
component or as a
- popup on any input element with NgbInputDatepicker
directive.
- It also comes with the list of services to do date formatting, i18n and
- alternative calendars support .
-
-
- We try to keep API of our components simple, but introduce extension points,
- so you could enrich and reuse them.
-
- Here is a short example of the vacation range picker that displays holidays with tooltips
- and disables weekends.
-
-
-
-
-
-
-
-
-
- Datepicker can be used either inline or inside of the popup.
-
-
-
-
-
- In the example above the template variable #d
will point
- to the instance of the NgbDatepicker
component in the first case.
- In the second it will point to the instance of the NgbInputDatepicker
- directive that handles the popup with inline datepicker component.
-
-
-
- See the NgbDatepicker API
- and the NgbInputDatepicker API
- for details on available inputs, outputs and methods.
-
- You can customize the number of displayed months, the way navigation
- between months and years looks like, week numbers, etc.
-
-
-
- If you have a very specific use case for the datepicker popup,
- you could always create you own one and use the inline datepicker inside.
-
-
- Handling the popup
-
-
- It's up to you do decide when the datepicker popup should be opened and closed.
- The API contains .open()
, .close()
and .toggle()
- methods.
-
-
-
- By default the popup element is attached after the input in the DOM.
- You have also the option of attaching it to the document body by setting the
- [container]
input to 'body'
-
-
-
-
-
- The popup will be closed with Escape
key and when
- a date is selected via keyboard or mouse.
- It can stay open after date selection if you set [autoClose]
input to false
-
-
-
-
-
-
-
-
- You have several ways of knowing when user selects a date. The date is selected
- either by clicking on it, pressing Space
or Enter
,
- typing text in the input or programmatically.
-
-
-
- Datepicker is integrated with Angular forms and works with both reactive
- and template-driven forms. So you could use [(ngModel)]
,
- [formControl]
, formControlName
, etc. Using
- ngModel
will allow you both to get and set selected value.
-
-
-
- The model, however, is NOT a native javascript date, see the following
- Date Model section for more info.
-
-
-
-
-
- Alternatively you could use the (dateSelect)
or (select)
outputs.
- The difference from ngModel
is that outputs will continue emitting the same value,
- if user clicks on the same date. NgModel
will do it only once.
-
-
-
-
-
-
-
-
-
-
- Datepicker uses NgbDateStruct
- interface as a model and not the native Date
object.
- It's a simple data structure with 3 fields, but note that months start with 1 (as in ISO 8601).
-
-
-
-
-
- All datepicker APIs will consume NgbDateStruct
, but will produce it's implementation
- class NgbDate
when returning dates to you.
- It offers additional methods for easy date comparison, and using it together with
- NgbCalendar
will cover most
- of the date-related calculations.
-
-
-
-
- Adapters
-
-
- You can also tell datepicker to use the native javascript date adapter (bundled with ng-bootstrap) as in the
- custom date adapter example . For now
- the adapter works only for the form integration, so for instance (ngModelChange)
- will return a native date object. All other APIs continue to use NgbDateStruct
.
-
-
-
-
-
- You can also create your own adapters if necessary by extending and implementing the
- NgbDateAdapter
methods.
-
-
-
-
- Input date parsing and formatting
-
-
- In the case of the NgbInputDatepicker
you should be able to parse
- and format the text entered in the input. This is not as easy task as it seems,
- because you have to account for various formats and locales.
- For now internally there is a service that does default formatting using ISO 8601 format.
-
-
-
-
-
- If the entered input value is invalid, the form model will contain the entered text.
-
-
-
-
-
-
-
-
-
- Date selection and navigation are two different things.
- You might have a date selected in January, but August currently displayed.
-
-
-
- Datepicker fully supports keyboard navigation and screen readers. You can navigate
- between controls using Tab
(focus will be trapped in the popup), move
- date focus with arrow keys, home, page up/down and use Shift
modifier
- for faster navigation.
-
-
-
- With the API you can tell datepicker to initially open a specific month
- via the [startDate]
input or go to any month via the .navigateTo()
method
-
-
-
-
-
-
-
-
-
-
- You can limit the dates available for navigation and selection using
- [minDate]
and [maxDate]
inputs. If you don't specify
- any of them, you'll have infinite navigation and the year select box
- will display [-10, +10] years from currently visible month.
-
-
-
- If you want to disable some dates for selection (ex. weekends), you have to
- provide the [markDisabled]
function that will mark certain dates
- not selectable. It will be called for each newly visible day when you navigate
- between months.
-
-
-
-
-
-
-
-
-
-
-
- You can completely replace how each date is rendered by providing a custom template
- and rendering anything you want inside. You'll get a date context available inside
- the template with info on whether current date is disabled, selected, focused, etc.
-
-
-
- For more info on what is provided in the template context,
- see the DayTemplateContext API
-
-
-
-
-
- Note that before v3.3.0 there is no $implicit
template property and you have to specify
- let-date="date"
in the template.
- See $implicit example in Angular documentation.
-
-
-
-
-
-
-
-
-
- It is often useful to highlight a today's date in the calendar view or add a certain logic to it. Today's date
- is the date returned by the NgbCalendar 's getToday()
- method.
-
-
-
- We add a custom CSS class .ngb-dp-today
on a cell that corresponds to the today's date.
- We do not add any rules to it at the moment, but you can add your own if necessary.
- You would see something like this in the resulting markup
-
-
-
-
-
- You can also access this information from the DayTemplateContext API
- if you're using a custom day template. It contains a today: boolean
flag since v4.1.0
-
-
-
-
-
-
-
-
-
-
- You can insert anything you want in a datepicker footer by providing a template.
-
-
-
-
-
-
-
-
-
-
- The datepicker model is a single date, however you still can implement range selection
- functionality. With (select)
and (dateSelect)
outputs you'll know
- which dates are being selected and with the [dayTemplate]
input
- you can customize the way any particular date looks.
- If you want to use the NgbDatepickerInput
, you can also tell the popup
- to stay open by tuning the [autoClose]
input.
- Check the range selection example
- and the initial demo on this page for more details.
-
-
-
- If you can't use the NgbDatepickerInput
directive, you should
- create your own popup and use NgbDatepicker
inside of it. In this case
- we'll handle everything related to date selection and navigation for you and you can create
- a completely customized popup with any data model you want.
-
-
-
-
-
-
-
-
- Since the 2.0.0 release datepicker will use the
- application locale
- if it is present to get translations of weekdays and month names. The internal service that does
- translation is called NgbDatepickerI18n
and you could provide your own implementation
- if necessary.
-
-
-
-
-
- The next/previous button labels can be translated using the standard Angular i18n
- mechanism. For example, previous month label is extracted under the ngb.datepicker.previous-month
- name.
-
-
-
-
-
-
-
-
-
-
- Space / Enter
- Selects currently focused date if it is not disabled
-
-
- Escape
- Closes the datepicker popup (unless [autoClose]
is false)
-
-
- Arrow(Up|Down|Left|Right)
- Moves day focus inside the months view
-
-
- Shift + Arrow(Up|Down|Left|Right)
- Selects currently focused date (if it is not disabled)
-
-
- Home
- Moves focus to the the first day of currently opened first month
-
-
- End
- Moves focus to the the last day of currently opened last month
-
-
- Shift + Home
- Moves focus to the minDate
(if set)
-
-
- Shift + End
- Moves focus to the maxDate
(if set)
-
-
- PageDown
- Moves focus to the previous month
-
-
- PageUp
- Moves focus to the next month
-
-
- Shift + PageDown
- Moves focus to the previous year
-
-
- Shift + PageUp
- Moves focus to the next year
-
-
-
-
-
diff --git a/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.ts b/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.ts
deleted file mode 100644
index 2d415a4..0000000
--- a/backup/demo/src/app/components/datepicker/overview/datepicker-overview.component.ts
+++ /dev/null
@@ -1,186 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-
-import {Snippet} from '../../../shared/code/snippet';
-import { NgbdDemoList } from '../../shared';
-import { NgbdOverview } from '../../shared/overview';
-
-@Component({
- selector: 'ngbd-datepicker-overview',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './datepicker-overview.component.html',
- host: {
- '[class.overview]': 'true'
- }
-})
-
-export class NgbdDatepickerOverviewComponent {
-
- snippets = {
- basic: Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
- `,
- }),
- popup: Snippet({
- lang: 'html',
- code: `
-
- Toggle
- `,
- }),
- form: Snippet({
- lang: 'html',
- code: `
-
- `,
- }),
- selection: Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
- `,
- }),
- navigation: Snippet({
- lang: 'html',
- code: `
-
- Goto JAN 2048
- `,
- }),
- dateStruct: Snippet({
- lang: 'typescript',
- code: `
- const date: NgbDateStruct = { year: 1789, month: 7, day: 14 }; // July, 14 1789
- `,
- }),
- date: Snippet({
- lang: 'typescript',
- code: `
- const date: NgbDate = new NgbDate(1789, 7, 14); // July, 14 1789
-
- date.before({ year: 1789, month: 7, day: 14 }); // compare to a structure
- date.equals(NgbDate.from({ year: 1789, month: 7, day: 14 })); // or to another date object
- `,
- }),
- nativeAdapter: Snippet({
- lang: 'typescript',
- code: `
- // native adapter is bundled with library
- providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeAdapter}]
-
- // or another native adapter that works with UTC dates
- providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeUTCAdapter}]
- `,
- }),
- adapter: Snippet({
- lang: 'typescript',
- code: `
- @Injectable()
- export abstract class NgbDateAdapter {
- abstract fromModel(value: D): NgbDateStruct; // from your model -> internal model
- abstract toModel(date: NgbDateStruct): D; // from internal model -> your mode
- }
-
- // create your own if necessary
- providers: [{provide: NgbDateAdapter, useClass: YourOwnDateAdapter}]
- `,
- }),
- formatter: Snippet({
- lang: 'typescript',
- code: `
- @Injectable()
- export abstract class NgbDateParserFormatter {
- abstract parse(value: string): NgbDateStruct; // from input -> internal model
- abstract format(date: NgbDateStruct): string; // from internal model -> string
- }
-
- // create your own if necessary
- providers: [{provide: NgbDateParserFormatter, useClass: YourOwnParserFormatter}]
- `,
- }),
- dayTemplate: Snippet({
- lang: 'html',
- code: `
-
- {{ date.day }}
-
-
-
- `,
- }),
- todayHTML: Snippet({
- lang: 'html',
- code: `
-
-
-
- `,
- }),
- todayTemplate: Snippet({
- lang: 'html',
- code: `
-
- ...
-
-
-
- `,
- }),
- footerTemplate: Snippet({
- lang: 'html',
- code: `
-
- Today
-
-
-
- `,
- }),
- disablingTS: Snippet({
- lang: 'typescript',
- code: `
- // disable the 13th of each month
- const isDisabled = (date: NgbDate, current: {month: number}) => date.day === 13;
- `,
- }),
- disablingHTML: Snippet({
- lang: 'html',
- code: `
-
-
- `,
- }),
- i18n: Snippet({
- lang: 'typescript',
- code: `
- @Injectable()
- export abstract class NgbDatepickerI18n {
- abstract getWeekdayShortName(weekday: number): string;
- abstract getMonthShortName(month: number): string;
- abstract getMonthFullName(month: number): string;
- abstract getDayAriaLabel(date: NgbDateStruct): string;
- }
-
- // provide your own if necessary
- providers: [{provide: NgbDatepickerI18n, useClass: YourOwnDatepickerI18n}]
- `,
- }),
- };
-
- sections: NgbdOverview = {};
-
- constructor(demoList: NgbdDemoList) {
- this.sections = demoList.getOverviewSections('datepicker');
- }
-}
diff --git a/backup/demo/src/app/components/datepicker/overview/demo/datepicker-overview-demo.component.ts b/backup/demo/src/app/components/datepicker/overview/demo/datepicker-overview-demo.component.ts
deleted file mode 100644
index 0ab0f34..0000000
--- a/backup/demo/src/app/components/datepicker/overview/demo/datepicker-overview-demo.component.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-import {ChangeDetectionStrategy, Component} from '@angular/core';
-import {NgbCalendar, NgbDate, NgbDateNativeAdapter} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-datepicker-demo-overview',
- changeDetection: ChangeDetectionStrategy.OnPush,
- template: `
-
-
Vacations
-
- from
- {{ adapter.toModel(fromDate) | date : 'mediumDate' }}
- to
- {{ adapter.toModel(toDate ? toDate : hoveredDate) | date : 'mediumDate' }}
-
-
-
-
-
- {{ date.day }}
-
-
-
-
-
- `,
- styles: [`
- .custom-day {
- text-align: center;
- display: inline-block;
- width: 2rem;
- height: 2rem;
- line-height: 2rem;
- }
- .custom-day:hover {
- background-color: #e6e6e6;
- }
- .disabled {
- color: #bbbbbb;
- }
- .disabled:hover {
- background-color: transparent;
- }
- .holiday, .holiday.disabled, .holiday:hover {
- color: white;
- background-color: coral;
- }
- .range:not(.holiday):not(.disabled), .custom-day:not(.disabled):not(.holiday):hover {
- background-color: rgb(2, 117, 216);
- color: white;
- }
- .faded:not(.holiday):not(.disabled) {
- background-color: rgba(2, 117, 216, 0.5);
- }
- `],
- providers: [NgbDateNativeAdapter]
-})
-
-export class NgbdDatepickerOverviewDemoComponent {
-
- today: NgbDate;
-
- hoveredDate: NgbDate;
-
- fromDate: NgbDate;
- toDate: NgbDate;
-
- holidays: {month, day, text}[] = [
- {month: 1, day: 1, text: 'New Years Day'},
- {month: 3, day: 30, text: 'Good Friday (hi, Alsace!)'},
- {month: 5, day: 1, text: 'Labour Day'},
- {month: 5, day: 5, text: 'V-E Day'},
- {month: 7, day: 14, text: 'Bastille Day'},
- {month: 8, day: 15, text: 'Assumption Day'},
- {month: 11, day: 1, text: 'All Saints Day'},
- {month: 11, day: 11, text: 'Armistice Day'},
- {month: 12, day: 25, text: 'Christmas Day'}
- ];
-
- constructor(private calendar: NgbCalendar, public adapter: NgbDateNativeAdapter) {
- this.markDisabled = this.markDisabled.bind(this);
- this.today = calendar.getToday();
- this.fromDate = this.getFirstAvailableDate(this.today);
- this.toDate = this.getFirstAvailableDate(calendar.getNext(this.today, 'd', 15));
- }
-
- isHoliday(date: NgbDate): string {
- const holiday = this.holidays.find(h => h.day === date.day && h.month === date.month);
- return holiday ? holiday.text : '';
- }
-
- markDisabled(date: NgbDate, current: {month: number}) {
- return this.isHoliday(date) || (this.isWeekend(date) && date.month === current.month);
- }
-
- onDateSelection(date: NgbDate) {
- if (!this.fromDate && !this.toDate) {
- this.fromDate = date;
- } else if (this.fromDate && !this.toDate && (date.after(this.fromDate) || date.equals(this.fromDate))) {
- this.toDate = date;
- } else {
- this.toDate = null;
- this.fromDate = date;
- }
- }
-
- getTooltip(date: NgbDate) {
- const holidayTooltip = this.isHoliday(date);
-
- if (holidayTooltip) {
- return holidayTooltip;
- } else if (this.isRange(date) && !this.isWeekend(date)) {
- return 'Vacations!';
- } else {
- return '';
- }
- }
-
- getFirstAvailableDate(date): NgbDate {
- while (this.isWeekend(date) || this.isHoliday(date)) {
- date = this.calendar.getNext(date, 'd', 1);
- }
- return date;
- }
-
- isWeekend(date: NgbDate) {
- return this.calendar.getWeekday(date) >= 6;
- }
-
- isRange(date: NgbDate) {
- return date.equals(this.fromDate) || date.equals(this.toDate) || this.isInside(date) || this.isHovered(date);
- }
-
- isHovered(date: NgbDate) {
- return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate);
- }
-
- isInside(date: NgbDate) {
- return date.after(this.fromDate) && date.before(this.toDate);
- }
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.html b/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.html
deleted file mode 100644
index eb2040b..0000000
--- a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
Toggle dropdown
-
- Action - 1
- Another Action
- Something else is here
-
-
-
-
-
-
-
Toggle dropup
-
- Action - 1
- Another Action
- Something else is here
-
-
-
-
diff --git a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.module.ts b/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.module.ts
deleted file mode 100644
index fd2160f..0000000
--- a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownBasic } from './dropdown-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDropdownBasic],
- exports: [NgbdDropdownBasic],
- bootstrap: [NgbdDropdownBasic]
-})
-export class NgbdDropdownBasicModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.ts b/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.ts
deleted file mode 100644
index b3e2fc5..0000000
--- a/backup/demo/src/app/components/dropdown/demos/basic/dropdown-basic.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-dropdown-basic',
- templateUrl: './dropdown-basic.html'
-})
-export class NgbdDropdownBasic {
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.html b/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.html
deleted file mode 100644
index a9c30fa..0000000
--- a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.html
+++ /dev/null
@@ -1,10 +0,0 @@
-This dropdown uses customized default values.
-
-
-
Toggle
-
- Action - 1
- Another Action
- Something else is here
-
-
diff --git a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.module.ts b/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.module.ts
deleted file mode 100644
index b62197d..0000000
--- a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownConfig } from './dropdown-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDropdownConfig],
- exports: [NgbdDropdownConfig],
- bootstrap: [NgbdDropdownConfig]
-})
-export class NgbdDropdownConfigModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.ts b/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.ts
deleted file mode 100644
index d1d491b..0000000
--- a/backup/demo/src/app/components/dropdown/demos/config/dropdown-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbDropdownConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-dropdown-config',
- templateUrl: './dropdown-config.html',
- providers: [NgbDropdownConfig] // add NgbDropdownConfig to the component providers
-})
-export class NgbdDropdownConfig {
- constructor(config: NgbDropdownConfig) {
- // customize default values of dropdowns used by this component tree
- config.placement = 'top-left';
- config.autoClose = false;
- }
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.html b/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.html
deleted file mode 100644
index 43368d4..0000000
--- a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
Toggle dropdown
-
-
-
-
New around here? Sign up
-
Forgot password?
-
-
-
-
diff --git a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.module.ts b/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.module.ts
deleted file mode 100644
index 00b9c6d..0000000
--- a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownForm } from './dropdown-form';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDropdownForm],
- exports: [NgbdDropdownForm],
- bootstrap: [NgbdDropdownForm]
-})
-export class NgbdDropdownFormModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.ts b/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.ts
deleted file mode 100644
index 6823972..0000000
--- a/backup/demo/src/app/components/dropdown/demos/form/dropdown-form.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-dropdown-form',
- templateUrl: './dropdown-form.html'
-})
-export class NgbdDropdownForm {
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.html b/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.html
deleted file mode 100644
index 00f4fe2..0000000
--- a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.html
+++ /dev/null
@@ -1,13 +0,0 @@
-You can easily control dropdowns programmatically using the exported dropdown instance.
-
-
-
Toggle dropdown
-
- Action - 1
- Another Action
- Something else is here
-
-
-
Open from outside
-
Close from outside
-
diff --git a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.module.ts b/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.module.ts
deleted file mode 100644
index 30c7fff..0000000
--- a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownManual } from './dropdown-manual';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDropdownManual],
- exports: [NgbdDropdownManual],
- bootstrap: [NgbdDropdownManual]
-})
-export class NgbdDropdownManualModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.ts b/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.ts
deleted file mode 100644
index 4082ee1..0000000
--- a/backup/demo/src/app/components/dropdown/demos/manual/dropdown-manual.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-dropdown-manual',
- templateUrl: './dropdown-manual.html'
-})
-export class NgbdDropdownManual {
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.html b/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.html
deleted file mode 100644
index 8fb3661..0000000
--- a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
- By design, dropdowns are always positioned dynamically via
- placement
- except when used inside navbar elements. To gracefully display them properly on small screens, they are
- rendered in the html as block elements.
-
-
- In order to align a dropdown in a navbar to the right while still keeping correct behavior when the navbar is
- collapsed, the CSS class dropdown-menu-right
must be added to the dropdown menu.
- The second dropdown in this example illustrates it.
-
-
- If completely custom placement of a dropdown in a navbar is needed, then it is only possible if the
- display
property is explicitlyset to "dynamic".
- The third dropdown in this example illustrates this.
-
-
- Beware however that this breaks the positioning of the dropdown when the navbar is
- expanded on small displays. You can see the difference between the behavior of the first dropdowns
- (with a static display) and the last one (with a dynamic display) if you use this demo on a small resolution.
-
-
- To have dynamic positioning along with correct behavior on smaller displays, the value of the display
- property should be dynamically set based on the screen resolution. This is left as an exercise to the reader.
-
-
-
- Dropdowns in navbar
-
-
-
-
-
-
diff --git a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.module.ts b/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.module.ts
deleted file mode 100644
index 2800afd..0000000
--- a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownNavbar } from './dropdown-navbar';
-import { RouterModule } from '@angular/router';
-
-@NgModule({
- imports: [BrowserModule, NgbModule, RouterModule],
- declarations: [NgbdDropdownNavbar],
- exports: [NgbdDropdownNavbar],
- bootstrap: [NgbdDropdownNavbar]
-})
-export class NgbdDropdownNavbarModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.ts b/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.ts
deleted file mode 100644
index 2f9d355..0000000
--- a/backup/demo/src/app/components/dropdown/demos/navbar/dropdown-navbar.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-dropdown-navbar',
- templateUrl: './dropdown-navbar.html'
-})
-export class NgbdDropdownNavbar {
- collapsed = true;
-}
diff --git a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.html b/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.html
deleted file mode 100644
index e30d82f..0000000
--- a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.html
+++ /dev/null
@@ -1,44 +0,0 @@
-Bootstrap split buttons and dropdowns on button groups are supported with the existing dropdown directives.
-
-
-
Plain ol' button
-
- Drop me
-
-
-
-
-
-
-
-
- Select me
-
-
-
- Or me
-
-
-
diff --git a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.module.ts b/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.module.ts
deleted file mode 100644
index 5c6910e..0000000
--- a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdDropdownSplit } from './dropdown-split';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdDropdownSplit],
- exports: [NgbdDropdownSplit],
- bootstrap: [NgbdDropdownSplit]
-})
-export class NgbdDropdownSplitModule {}
diff --git a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.ts b/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.ts
deleted file mode 100644
index dd9c355..0000000
--- a/backup/demo/src/app/components/dropdown/demos/split/dropdown-split.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-dropdown-split',
- templateUrl: './dropdown-split.html'
-})
-export class NgbdDropdownSplit {
-}
diff --git a/backup/demo/src/app/components/dropdown/dropdown.module.ts b/backup/demo/src/app/components/dropdown/dropdown.module.ts
deleted file mode 100644
index 71bf363..0000000
--- a/backup/demo/src/app/components/dropdown/dropdown.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdDropdownBasic } from './demos/basic/dropdown-basic';
-import { NgbdDropdownBasicModule } from './demos/basic/dropdown-basic.module';
-import { NgbdDropdownConfig } from './demos/config/dropdown-config';
-import { NgbdDropdownConfigModule } from './demos/config/dropdown-config.module';
-import { NgbdDropdownForm } from './demos/form/dropdown-form';
-import { NgbdDropdownFormModule } from './demos/form/dropdown-form.module';
-import { NgbdDropdownManual } from './demos/manual/dropdown-manual';
-import { NgbdDropdownManualModule } from './demos/manual/dropdown-manual.module';
-import { NgbdDropdownNavbar } from './demos/navbar/dropdown-navbar';
-import { NgbdDropdownNavbarModule } from './demos/navbar/dropdown-navbar.module';
-import { NgbdDropdownSplit } from './demos/split/dropdown-split';
-import { NgbdDropdownSplitModule } from './demos/split/dropdown-split.module';
-
-const DEMOS = {
- basic: {
- title: 'Dropdown',
- type: NgbdDropdownBasic,
- code: require('!!raw-loader!./demos/basic/dropdown-basic'),
- markup: require('!!raw-loader!./demos/basic/dropdown-basic.html')
- },
- manual: {
- title: 'Manual and custom triggers',
- type: NgbdDropdownManual,
- code: require('!!raw-loader!./demos/manual/dropdown-manual'),
- markup: require('!!raw-loader!./demos/manual/dropdown-manual.html')
- },
- split: {
- title: 'Button groups and split buttons',
- type: NgbdDropdownSplit,
- code: require('!!raw-loader!./demos/split/dropdown-split'),
- markup: require('!!raw-loader!./demos/split/dropdown-split.html')
- },
- form: {
- title: 'Mixed menu items and form',
- type: NgbdDropdownForm,
- code: require('!!raw-loader!./demos/form/dropdown-form'),
- markup: require('!!raw-loader!./demos/form/dropdown-form.html')
- },
- navbar: {
- title: 'Dynamic positioning in a navbar',
- type: NgbdDropdownNavbar,
- code: require('!!raw-loader!./demos/navbar/dropdown-navbar'),
- markup: require('!!raw-loader!./demos/navbar/dropdown-navbar.html')
- },
- config: {
- title: 'Global configuration of dropdowns',
- type: NgbdDropdownConfig,
- code: require('!!raw-loader!./demos/config/dropdown-config'),
- markup: require('!!raw-loader!./demos/config/dropdown-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdDropdownBasicModule,
- NgbdDropdownConfigModule,
- NgbdDropdownManualModule,
- NgbdDropdownSplitModule,
- NgbdDropdownFormModule,
- NgbdDropdownNavbarModule
- ]
-})
-export class NgbdDropdownModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('dropdown', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/modal/demos/basic/modal-basic.html b/backup/demo/src/app/components/modal/demos/basic/modal-basic.html
deleted file mode 100644
index 12c681d..0000000
--- a/backup/demo/src/app/components/modal/demos/basic/modal-basic.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-Launch demo modal
-
-
-
-{{closeResult}}
diff --git a/backup/demo/src/app/components/modal/demos/basic/modal-basic.module.ts b/backup/demo/src/app/components/modal/demos/basic/modal-basic.module.ts
deleted file mode 100644
index 351b0d5..0000000
--- a/backup/demo/src/app/components/modal/demos/basic/modal-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdModalBasic } from './modal-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalBasic],
- exports: [NgbdModalBasic],
- bootstrap: [NgbdModalBasic]
-})
-export class NgbdModalBasicModule {}
diff --git a/backup/demo/src/app/components/modal/demos/basic/modal-basic.ts b/backup/demo/src/app/components/modal/demos/basic/modal-basic.ts
deleted file mode 100644
index cc36b89..0000000
--- a/backup/demo/src/app/components/modal/demos/basic/modal-basic.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import {Component} from '@angular/core';
-
-import {NgbModal, ModalDismissReasons} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-modal-basic',
- templateUrl: './modal-basic.html'
-})
-export class NgbdModalBasic {
- closeResult: string;
-
- constructor(private modalService: NgbModal) {}
-
- open(content) {
- this.modalService.open(content, {ariaLabelledBy: 'modal-basic-title'}).result.then((result) => {
- this.closeResult = `Closed with: ${result}`;
- }, (reason) => {
- this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
- });
- }
-
- private getDismissReason(reason: any): string {
- if (reason === ModalDismissReasons.ESC) {
- return 'by pressing ESC';
- } else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
- return 'by clicking on a backdrop';
- } else {
- return `with: ${reason}`;
- }
- }
-}
diff --git a/backup/demo/src/app/components/modal/demos/component/modal-component.html b/backup/demo/src/app/components/modal/demos/component/modal-component.html
deleted file mode 100644
index b2fbbe4..0000000
--- a/backup/demo/src/app/components/modal/demos/component/modal-component.html
+++ /dev/null
@@ -1,4 +0,0 @@
-You can pass an existing component as content of the modal window. In this case remember to add content component
-as an entryComponents
section of your NgModule
.
-
-Launch demo modal
diff --git a/backup/demo/src/app/components/modal/demos/component/modal-component.module.ts b/backup/demo/src/app/components/modal/demos/component/modal-component.module.ts
deleted file mode 100644
index 7fa0fda..0000000
--- a/backup/demo/src/app/components/modal/demos/component/modal-component.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdModalComponent, NgbdModalContent } from './modal-component';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalComponent, NgbdModalContent],
- exports: [NgbdModalComponent],
- bootstrap: [NgbdModalComponent],
- entryComponents: [NgbdModalContent]
-})
-export class NgbdModalComponentModule {}
diff --git a/backup/demo/src/app/components/modal/demos/component/modal-component.ts b/backup/demo/src/app/components/modal/demos/component/modal-component.ts
deleted file mode 100644
index 7fb6ad5..0000000
--- a/backup/demo/src/app/components/modal/demos/component/modal-component.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Component, Input } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-modal-content',
- template: `
-
-
-
- `
-})
-export class NgbdModalContent {
- @Input() name;
-
- constructor(public activeModal: NgbActiveModal) {}
-}
-
-@Component({
- selector: 'ngbd-modal-component',
- templateUrl: './modal-component.html'
-})
-export class NgbdModalComponent {
- constructor(private modalService: NgbModal) {}
-
- open() {
- const modalRef = this.modalService.open(NgbdModalContent);
- modalRef.componentInstance.name = 'World';
- }
-}
diff --git a/backup/demo/src/app/components/modal/demos/config/modal-config.html b/backup/demo/src/app/components/modal/demos/config/modal-config.html
deleted file mode 100644
index 3d79b50..0000000
--- a/backup/demo/src/app/components/modal/demos/config/modal-config.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-Launch demo modal
diff --git a/backup/demo/src/app/components/modal/demos/config/modal-config.module.ts b/backup/demo/src/app/components/modal/demos/config/modal-config.module.ts
deleted file mode 100644
index ed20dda..0000000
--- a/backup/demo/src/app/components/modal/demos/config/modal-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdModalConfig } from './modal-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalConfig],
- exports: [NgbdModalConfig],
- bootstrap: [NgbdModalConfig]
-})
-export class NgbdModalConfigModule {}
diff --git a/backup/demo/src/app/components/modal/demos/config/modal-config.ts b/backup/demo/src/app/components/modal/demos/config/modal-config.ts
deleted file mode 100644
index c326a9a..0000000
--- a/backup/demo/src/app/components/modal/demos/config/modal-config.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Component } from '@angular/core';
-import { NgbModalConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-modal-config',
- templateUrl: './modal-config.html',
- // add NgbModalConfig and NgbModal to the component providers
- providers: [NgbModalConfig, NgbModal]
-})
-export class NgbdModalConfig {
- constructor(config: NgbModalConfig, private modalService: NgbModal) {
- // customize default values of modals used by this component tree
- config.backdrop = 'static';
- config.keyboard = false;
- }
-
- open(content) {
- this.modalService.open(content);
- }
-}
-
diff --git a/backup/demo/src/app/components/modal/demos/focus/modal-focus.html b/backup/demo/src/app/components/modal/demos/focus/modal-focus.html
deleted file mode 100644
index 5e2173d..0000000
--- a/backup/demo/src/app/components/modal/demos/focus/modal-focus.html
+++ /dev/null
@@ -1,17 +0,0 @@
-First focusable element within the modal window will receive focus upon opening.
-This could be configured to focus any other element by adding an ngbAutofocus
attribute on it.
-
-< button type = " button" ngbAutofocus class = " btn btn-danger"
- (click) = " modal.close(' Ok click' )" > Ok</ button>
-
-
-
- Open confirm modal
- × button will be focused
-
-
-
- Open confirm modal with `ngbAutofocus`
- Ok button will be focused
-
-
diff --git a/backup/demo/src/app/components/modal/demos/focus/modal-focus.module.ts b/backup/demo/src/app/components/modal/demos/focus/modal-focus.module.ts
deleted file mode 100644
index fea1e60..0000000
--- a/backup/demo/src/app/components/modal/demos/focus/modal-focus.module.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import {
- NgbdModalConfirm,
- NgbdModalConfirmAutofocus,
- NgbdModalFocus
-} from './modal-focus';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalFocus, NgbdModalConfirm, NgbdModalConfirmAutofocus],
- exports: [NgbdModalFocus],
- bootstrap: [NgbdModalFocus],
- entryComponents: [NgbdModalConfirm, NgbdModalConfirmAutofocus]
-})
-export class NgbdModalFocusModule {}
diff --git a/backup/demo/src/app/components/modal/demos/focus/modal-focus.ts b/backup/demo/src/app/components/modal/demos/focus/modal-focus.ts
deleted file mode 100644
index 6f0ac0c..0000000
--- a/backup/demo/src/app/components/modal/demos/focus/modal-focus.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { Component } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-modal-confirm',
- template: `
-
-
-
Are you sure you want to delete "John Doe" profile?
-
All information associated to this user profile will be permanently deleted.
- This operation can not be undone.
-
-
-
- `
-})
-export class NgbdModalConfirm {
- constructor(public modal: NgbActiveModal) {}
-}
-
-@Component({
- selector: 'ngbd-modal-confirm-autofocus',
- template: `
-
-
-
Are you sure you want to delete "John Doe" profile?
-
All information associated to this user profile will be permanently deleted.
- This operation can not be undone.
-
-
-
- `
-})
-export class NgbdModalConfirmAutofocus {
- constructor(public modal: NgbActiveModal) {}
-}
-
-const MODALS = {
- focusFirst: NgbdModalConfirm,
- autofocus: NgbdModalConfirmAutofocus
-};
-
-@Component({
- selector: 'ngbd-modal-focus',
- templateUrl: './modal-focus.html'
-})
-export class NgbdModalFocus {
- withAutofocus = `Ok `;
-
- constructor(private _modalService: NgbModal) {}
-
- open(name: string) {
- this._modalService.open(MODALS[name]);
- }
-}
diff --git a/backup/demo/src/app/components/modal/demos/options/modal-options.html b/backup/demo/src/app/components/modal/demos/options/modal-options.html
deleted file mode 100644
index f3d7c3a..0000000
--- a/backup/demo/src/app/components/modal/demos/options/modal-options.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
-
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.
-
Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
-
-
-
-
-Modal with window custom class
-Modal with backdrop custom class
-Small modal
-Large modal
-Extra large modal
-Modal vertically centered
-Modal scrollable content
diff --git a/backup/demo/src/app/components/modal/demos/options/modal-options.module.ts b/backup/demo/src/app/components/modal/demos/options/modal-options.module.ts
deleted file mode 100644
index 75c9a0d..0000000
--- a/backup/demo/src/app/components/modal/demos/options/modal-options.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdModalOptions } from './modal-options';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalOptions],
- exports: [NgbdModalOptions],
- bootstrap: [NgbdModalOptions]
-})
-export class NgbdModalOptionsModule {}
diff --git a/backup/demo/src/app/components/modal/demos/options/modal-options.ts b/backup/demo/src/app/components/modal/demos/options/modal-options.ts
deleted file mode 100644
index 1753062..0000000
--- a/backup/demo/src/app/components/modal/demos/options/modal-options.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-modal-options',
- templateUrl: './modal-options.html',
- encapsulation: ViewEncapsulation.None,
- styles: [`
- .dark-modal .modal-content {
- background-color: #292b2c;
- color: white;
- }
- .dark-modal .close {
- color: white;
- }
- .light-blue-backdrop {
- background-color: #5cb3fd;
- }
- `]
-})
-export class NgbdModalOptions {
- closeResult: string;
-
- constructor(private modalService: NgbModal) {}
-
- openBackDropCustomClass(content) {
- this.modalService.open(content, {backdropClass: 'light-blue-backdrop'});
- }
-
- openWindowCustomClass(content) {
- this.modalService.open(content, { windowClass: 'dark-modal' });
- }
-
- openSm(content) {
- this.modalService.open(content, { size: 'sm' });
- }
-
- openLg(content) {
- this.modalService.open(content, { size: 'lg' });
- }
-
- openXl(content) { this.modalService.open(content, {size: 'xl'}); }
-
- openVerticallyCentered(content) {
- this.modalService.open(content, { centered: true });
- }
-
- openScrollableContent(longContent) {
- this.modalService.open(longContent, { scrollable: true });
- }
-}
diff --git a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.html b/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.html
deleted file mode 100644
index aab661a..0000000
--- a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.html
+++ /dev/null
@@ -1 +0,0 @@
-Launch demo modal
diff --git a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.module.ts b/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.module.ts
deleted file mode 100644
index be1fc53..0000000
--- a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.module.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import {
- NgbdModal1Content,
- NgbdModal2Content,
- NgbdModalStacked
-} from './modal-stacked';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdModalStacked, NgbdModal1Content, NgbdModal2Content],
- exports: [NgbdModalStacked],
- bootstrap: [NgbdModalStacked],
- entryComponents: [NgbdModal1Content, NgbdModal2Content]
-})
-export class NgbdModalStackedModule {}
diff --git a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.ts b/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.ts
deleted file mode 100644
index c2a0181..0000000
--- a/backup/demo/src/app/components/modal/demos/stacked/modal-stacked.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-import { Component } from '@angular/core';
-import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- template: `
-
-
-
Hello, World!
-
Launch demo modal
-
-
- `
-})
-export class NgbdModal1Content {
- constructor(private modalService: NgbModal, public activeModal: NgbActiveModal) {}
-
- open() {
- this.modalService.open(NgbdModal2Content, {
- size: 'lg'
- });
- }
-}
-
-@Component({
- template: `
-
-
-
- `
-})
-export class NgbdModal2Content {
- constructor(public activeModal: NgbActiveModal) {}
-}
-
-@Component({
- selector: 'ngbd-modal-stacked',
- templateUrl: './modal-stacked.html'
-})
-export class NgbdModalStacked {
- constructor(private modalService: NgbModal) {}
-
- open() {
- this.modalService.open(NgbdModal1Content);
- }
-}
diff --git a/backup/demo/src/app/components/modal/modal.module.ts b/backup/demo/src/app/components/modal/modal.module.ts
deleted file mode 100644
index 9d3b462..0000000
--- a/backup/demo/src/app/components/modal/modal.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdModalBasic } from './demos/basic/modal-basic';
-import { NgbdModalBasicModule } from './demos/basic/modal-basic.module';
-import { NgbdModalComponent } from './demos/component/modal-component';
-import { NgbdModalComponentModule } from './demos/component/modal-component.module';
-import { NgbdModalConfig } from './demos/config/modal-config';
-import { NgbdModalConfigModule } from './demos/config/modal-config.module';
-import { NgbdModalFocus } from './demos/focus/modal-focus';
-import { NgbdModalFocusModule } from './demos/focus/modal-focus.module';
-import { NgbdModalOptions } from './demos/options/modal-options';
-import { NgbdModalOptionsModule } from './demos/options/modal-options.module';
-import { NgbdModalStacked } from './demos/stacked/modal-stacked';
-import { NgbdModalStackedModule } from './demos/stacked/modal-stacked.module';
-
-const DEMOS = {
- basic: {
- title: 'Modal with default options',
- type: NgbdModalBasic,
- code: require('!!raw-loader!./demos/basic/modal-basic'),
- markup: require('!!raw-loader!./demos/basic/modal-basic.html')
- },
- component: {
- title: 'Components as content',
- type: NgbdModalComponent,
- code: require('!!raw-loader!./demos/component/modal-component'),
- markup: require('!!raw-loader!./demos/component/modal-component.html')
- },
- focus: {
- title: 'Focus management',
- type: NgbdModalFocus,
- code: require('!!raw-loader!./demos/focus/modal-focus'),
- markup: require('!!raw-loader!./demos/focus/modal-focus.html')
- },
- options: {
- title: 'Modal with options',
- type: NgbdModalOptions,
- code: require('!!raw-loader!./demos/options/modal-options'),
- markup: require('!!raw-loader!./demos/options/modal-options.html')
- },
- stacked: {
- title: 'Stacked modals',
- type: NgbdModalStacked,
- code: require('!!raw-loader!./demos/stacked/modal-stacked'),
- markup: require('!!raw-loader!./demos/stacked/modal-stacked.html')
- },
- config: {
- title: 'Global configuration of modals',
- type: NgbdModalConfig,
- code: require('!!raw-loader!./demos/config/modal-config'),
- markup: require('!!raw-loader!./demos/config/modal-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdModalBasicModule,
- NgbdModalComponentModule,
- NgbdModalOptionsModule,
- NgbdModalStackedModule,
- NgbdModalConfigModule,
- NgbdModalFocusModule
- ]
-})
-export class NgbdModalModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('modal', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.html b/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.html
deleted file mode 100644
index 5387101..0000000
--- a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.html
+++ /dev/null
@@ -1,12 +0,0 @@
-Restricted size, no rotation:
-
-
-Restricted size with rotation:
-
-
-Restricted size with rotation and no ellipses:
-
-
-
-
-Current page: {{page}}
diff --git a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.module.ts b/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.module.ts
deleted file mode 100644
index 9fe2655..0000000
--- a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationAdvanced } from './pagination-advanced';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationAdvanced],
- exports: [NgbdPaginationAdvanced],
- bootstrap: [NgbdPaginationAdvanced]
-})
-export class NgbdPaginationAdvancedModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.ts b/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.ts
deleted file mode 100644
index fe2de8b..0000000
--- a/backup/demo/src/app/components/pagination/demos/advanced/pagination-advanced.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-pagination-advanced',
- templateUrl: './pagination-advanced.html'
-})
-export class NgbdPaginationAdvanced {
- page = 1;
-}
diff --git a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.html b/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.html
deleted file mode 100644
index 6a6ac7e..0000000
--- a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.html
+++ /dev/null
@@ -1,12 +0,0 @@
-Default pagination:
-
-
-No direction links:
-
-
-With boundary links:
-
-
-
-
-Current page: {{page}}
diff --git a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.module.ts b/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.module.ts
deleted file mode 100644
index 3627b19..0000000
--- a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationBasic } from './pagination-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationBasic],
- exports: [NgbdPaginationBasic],
- bootstrap: [NgbdPaginationBasic]
-})
-export class NgbdPaginationBasicModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.ts b/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.ts
deleted file mode 100644
index d0a5a94..0000000
--- a/backup/demo/src/app/components/pagination/demos/basic/pagination-basic.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-pagination-basic',
- templateUrl: './pagination-basic.html'
-})
-export class NgbdPaginationBasic {
- page = 4;
-}
diff --git a/backup/demo/src/app/components/pagination/demos/config/pagination-config.html b/backup/demo/src/app/components/pagination/demos/config/pagination-config.html
deleted file mode 100644
index d84752f..0000000
--- a/backup/demo/src/app/components/pagination/demos/config/pagination-config.html
+++ /dev/null
@@ -1,2 +0,0 @@
-This pagination uses custom default values
-
diff --git a/backup/demo/src/app/components/pagination/demos/config/pagination-config.module.ts b/backup/demo/src/app/components/pagination/demos/config/pagination-config.module.ts
deleted file mode 100644
index 3d5ad75..0000000
--- a/backup/demo/src/app/components/pagination/demos/config/pagination-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationConfig } from './pagination-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationConfig],
- exports: [NgbdPaginationConfig],
- bootstrap: [NgbdPaginationConfig]
-})
-export class NgbdPaginationConfigModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/config/pagination-config.ts b/backup/demo/src/app/components/pagination/demos/config/pagination-config.ts
deleted file mode 100644
index c331b8d..0000000
--- a/backup/demo/src/app/components/pagination/demos/config/pagination-config.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbPaginationConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-pagination-config',
- templateUrl: './pagination-config.html',
- providers: [NgbPaginationConfig] // add NgbPaginationConfig to the component providers
-})
-export class NgbdPaginationConfig {
- page = 4;
-
- constructor(config: NgbPaginationConfig) {
- // customize default values of paginations used by this component tree
- config.size = 'sm';
- config.boundaryLinks = true;
- }
-}
diff --git a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.html b/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.html
deleted file mode 100644
index e379fd5..0000000
--- a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.html
+++ /dev/null
@@ -1,9 +0,0 @@
-A pagination with customized links:
-
- Prev
- Next
- {{ getPageSymbol(p) }}
-
-
-
-Current page: {{page}}
diff --git a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.module.ts b/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.module.ts
deleted file mode 100644
index 8649597..0000000
--- a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationCustomization } from './pagination-customization';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationCustomization],
- exports: [NgbdPaginationCustomization],
- bootstrap: [NgbdPaginationCustomization]
-})
-export class NgbdPaginationCustomizationModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.ts b/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.ts
deleted file mode 100644
index b781bc6..0000000
--- a/backup/demo/src/app/components/pagination/demos/customization/pagination-customization.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-pagination-customization',
- templateUrl: './pagination-customization.html'
-})
-export class NgbdPaginationCustomization {
- page = 4;
-
- getPageSymbol(current: number) {
- return ['A', 'B', 'C', 'D', 'E', 'F', 'G'][current - 1];
- }
-}
diff --git a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.html b/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.html
deleted file mode 100644
index da1a8f0..0000000
--- a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.html
+++ /dev/null
@@ -1,6 +0,0 @@
-Pagination control can be disabled:
-
-
-
- Toggle disabled
-
diff --git a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.module.ts b/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.module.ts
deleted file mode 100644
index eaa0d90..0000000
--- a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationDisabled } from './pagination-disabled';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationDisabled],
- exports: [NgbdPaginationDisabled],
- bootstrap: [NgbdPaginationDisabled]
-})
-export class NgbdPaginationDisabledModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.ts b/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.ts
deleted file mode 100644
index f8cade2..0000000
--- a/backup/demo/src/app/components/pagination/demos/disabled/pagination-disabled.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbPaginationConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-pagination-disabled',
- templateUrl: './pagination-disabled.html'
-})
-export class NgbdPaginationDisabled {
- page = 3;
- isDisabled = true;
-
- toggleDisabled() {
- this.isDisabled = !this.isDisabled;
- }
-}
diff --git a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.html b/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.html
deleted file mode 100755
index 8de0145..0000000
--- a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Change the alignment of pagination components with flexbox utilities.
-
-
-
-
diff --git a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.module.ts b/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.module.ts
deleted file mode 100644
index 71fc508..0000000
--- a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationJustify } from './pagination-justify';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationJustify],
- exports: [NgbdPaginationJustify],
- bootstrap: [NgbdPaginationJustify]
-})
-export class NgbdPaginationJustifyModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.ts b/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.ts
deleted file mode 100755
index 7d85179..0000000
--- a/backup/demo/src/app/components/pagination/demos/justify/pagination-justify.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-pagination-justify',
- templateUrl: './pagination-justify.html'
-})
-export class NgbdPaginationJustify {
- page = 4;
-}
diff --git a/backup/demo/src/app/components/pagination/demos/size/pagination-size.html b/backup/demo/src/app/components/pagination/demos/size/pagination-size.html
deleted file mode 100644
index 6a4b0c4..0000000
--- a/backup/demo/src/app/components/pagination/demos/size/pagination-size.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/backup/demo/src/app/components/pagination/demos/size/pagination-size.module.ts b/backup/demo/src/app/components/pagination/demos/size/pagination-size.module.ts
deleted file mode 100644
index f47e27f..0000000
--- a/backup/demo/src/app/components/pagination/demos/size/pagination-size.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPaginationSize } from './pagination-size';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPaginationSize],
- exports: [NgbdPaginationSize],
- bootstrap: [NgbdPaginationSize]
-})
-export class NgbdPaginationSizeModule {}
diff --git a/backup/demo/src/app/components/pagination/demos/size/pagination-size.ts b/backup/demo/src/app/components/pagination/demos/size/pagination-size.ts
deleted file mode 100644
index 1ae8b2e..0000000
--- a/backup/demo/src/app/components/pagination/demos/size/pagination-size.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-pagination-size',
- templateUrl: './pagination-size.html'
-})
-export class NgbdPaginationSize {
- currentPage = 3;
-}
diff --git a/backup/demo/src/app/components/pagination/overview/pagination-overview.component.html b/backup/demo/src/app/components/pagination/overview/pagination-overview.component.html
deleted file mode 100644
index a5aa1b1..0000000
--- a/backup/demo/src/app/components/pagination/overview/pagination-overview.component.html
+++ /dev/null
@@ -1,86 +0,0 @@
-
- Pagination is a component that only displays page numbers. It will not manipulate your data collection. You will have
- to split your data collection into pages yourself.
-
-
-
-
-
- In order to properly operate a pagination behaviour, there are 3 important notions you have to be familiar with,
- which are actually available as @Input()
on the widget:
-
-
- collectionSize
- Number of elements/items in the collection.
- i.e. the total number of items the
- pagination should handle.
- pageSize
- Number of elements/items per page.
- page
- The current page.
-
-
- To split the data collection yourself, use *ngFor
associated with the slice
pipe to extract (or slice ) a sub-part of it.
-
- Corresponding code could be something like:
-
- and the associated <ngb-pagination>
would be like:
-
-
-
-
- Be aware that both page
and pageSize
have default values,
- which are respectively 1
and 10
.
-
-
- Filtering and sorting
-
- To add filtering or sorting on top of your pagination, you will have to update the way you split your
- data collection. As mentionned in Angular documentation , you don't need to reimplement dedicated pipes for
- that purpose.
- Recommendation is to move filtering and sorting logic into the component itself where some property getters could
- be exposed.
-
-
-
-
-
- It is possible to customize what exactly is displayed in each pagination link and there are several ways of doing it.
-
-
-
- You could use the Angular i18n API as all labels are translated. For instance you could replace the default
- '«'
(previous arrow) with the 'Prev'
text by providing a different translation for the
- ngb.pagination.previous
key in your i18n file and ngb.pagination.previous-aria
for the
- corresponding aria-label
attribute.
-
-
-
- You could also override the CSS to hide the default span
and provide an alternative content.
- For example for the previous arrow:
-
-
-
-
- Using templates
-
-
-
-
- Sometimes you would want to display an icon, an image or any arbitrary markup instead of the page number.
- In this case since you could use the template-based API to override any pagination link:
-
-
-
-
- In this case we customize all pagination links, but you can pick only the ones you need of course.
- The template NgbPaginationLinkContext
- is available for all templates and for page numbers there is a
- NgbPaginationNumberContext
- that adds displayed number on top.
-
-
-
- Also see the Customization example for a
- live version.
-
-
diff --git a/backup/demo/src/app/components/pagination/overview/pagination-overview.component.ts b/backup/demo/src/app/components/pagination/overview/pagination-overview.component.ts
deleted file mode 100644
index 232ba8c..0000000
--- a/backup/demo/src/app/components/pagination/overview/pagination-overview.component.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import {Component} from '@angular/core';
-
-import {Snippet} from '../../../shared/code/snippet';
-import {NgbdDemoList} from '../../shared';
-import {NgbdOverview} from '../../shared/overview';
-
-
-@Component({
- selector: 'ngbd-pagination-overview',
- templateUrl: './pagination-overview.component.html',
- host: {'[class.overview]': 'true'}
-})
-export class NgbdPaginationOverviewComponent {
- NGFOR = Snippet({
- lang: 'html',
- code: `
-
- `,
- });
-
- NGB_PAGINATION = Snippet({
- lang: 'html',
- code: `
-
- `,
- });
-
- CUSTOM_CSS = Snippet({
- lang: 'css',
- code: `
- ngb-pagination li {
- &:first-child a {
- span {
- display: none;
- }
- &:before {
- /* provide your content here */
- }
- }
- }
- `,
- });
-
- CUSTOM_TPL = Snippet({
- lang: 'html',
- code: `
-
- First
- Last
- Prev
- Next
- ...
- {{ page }}
-
- `,
- });
-
- sections: NgbdOverview = {};
-
- constructor(demoList: NgbdDemoList) {
- this.sections = demoList.getOverviewSections('pagination');
- }
-}
diff --git a/backup/demo/src/app/components/pagination/pagination.module.ts b/backup/demo/src/app/components/pagination/pagination.module.ts
deleted file mode 100644
index 104157f..0000000
--- a/backup/demo/src/app/components/pagination/pagination.module.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdPaginationAdvanced } from './demos/advanced/pagination-advanced';
-import { NgbdPaginationAdvancedModule } from './demos/advanced/pagination-advanced.module';
-import { NgbdPaginationBasic } from './demos/basic/pagination-basic';
-import { NgbdPaginationBasicModule } from './demos/basic/pagination-basic.module';
-import { NgbdPaginationConfig } from './demos/config/pagination-config';
-import { NgbdPaginationConfigModule } from './demos/config/pagination-config.module';
-import { NgbdPaginationCustomization } from './demos/customization/pagination-customization';
-import { NgbdPaginationCustomizationModule } from './demos/customization/pagination-customization.module';
-import { NgbdPaginationDisabled } from './demos/disabled/pagination-disabled';
-import { NgbdPaginationDisabledModule } from './demos/disabled/pagination-disabled.module';
-import { NgbdPaginationJustify } from './demos/justify/pagination-justify';
-import { NgbdPaginationJustifyModule } from './demos/justify/pagination-justify.module';
-import { NgbdPaginationSize } from './demos/size/pagination-size';
-import { NgbdPaginationSizeModule } from './demos/size/pagination-size.module';
-import { NgbdPaginationOverviewComponent } from './overview/pagination-overview.component';
-
-const OVERVIEW = {
- 'basic-usage': 'Basic Usage',
- customization: 'Customization'
-};
-
-const DEMOS = {
- basic: {
- title: 'Basic pagination',
- type: NgbdPaginationBasic,
- code: require('!!raw-loader!./demos/basic/pagination-basic'),
- markup: require('!!raw-loader!./demos/basic/pagination-basic.html')
- },
- advanced: {
- title: 'Advanced pagination',
- type: NgbdPaginationAdvanced,
- code: require('!!raw-loader!./demos/advanced/pagination-advanced'),
- markup: require('!!raw-loader!./demos/advanced/pagination-advanced.html')
- },
- customization: {
- title: 'Custom links',
- type: NgbdPaginationCustomization,
- code: require('!!raw-loader!./demos/customization/pagination-customization'),
- markup: require('!!raw-loader!./demos/customization/pagination-customization.html')
- },
- size: {
- title: 'Pagination size',
- type: NgbdPaginationSize,
- code: require('!!raw-loader!./demos/size/pagination-size'),
- markup: require('!!raw-loader!./demos/size/pagination-size.html')
- },
- justify: {
- title: 'Pagination alignment',
- type: NgbdPaginationJustify,
- code: require('!!raw-loader!./demos/justify/pagination-justify'),
- markup: require('!!raw-loader!./demos/justify/pagination-justify.html')
- },
- disabled: {
- title: 'Disabled pagination',
- type: NgbdPaginationDisabled,
- code: require('!!raw-loader!./demos/disabled/pagination-disabled'),
- markup: require('!!raw-loader!./demos/disabled/pagination-disabled.html')
- },
- config: {
- title: 'Global configuration',
- type: NgbdPaginationConfig,
- code: require('!!raw-loader!./demos/config/pagination-config'),
- markup: require('!!raw-loader!./demos/config/pagination-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'overview' },
- {
- path: '',
- component: ComponentWrapper,
- data: { OVERVIEW },
- children: [
- { path: 'overview', component: NgbdPaginationOverviewComponent },
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdPaginationAdvancedModule,
- NgbdPaginationBasicModule,
- NgbdPaginationSizeModule,
- NgbdPaginationConfigModule,
- NgbdPaginationCustomizationModule,
- NgbdPaginationDisabledModule,
- NgbdPaginationJustifyModule
- ],
- declarations: [NgbdPaginationOverviewComponent]
-})
-export class NgbdPaginationModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('pagination', DEMOS, OVERVIEW);
- }
-}
diff --git a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.html b/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.html
deleted file mode 100644
index 98a0454..0000000
--- a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.html
+++ /dev/null
@@ -1,39 +0,0 @@
-As for some other popup-based widgets, you can set the popover to close automatically upon some events.
-In the following examples, they will all close on Escape
as well as:
-
-
-
- click inside:
-
- Click to toggle
-
-
-
-
- click outside:
-
- Click to toggle
-
-
-
-
- all clicks:
-
- Click to toggle
-
-
-
- Click to toggle the external popover
-
-
-
diff --git a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.module.ts b/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.module.ts
deleted file mode 100644
index 114818b..0000000
--- a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverAutoclose } from './popover-autoclose';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverAutoclose],
- exports: [NgbdPopoverAutoclose],
- bootstrap: [NgbdPopoverAutoclose]
-})
-export class NgbdPopoverAutocloseModule {}
diff --git a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.ts b/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.ts
deleted file mode 100644
index cde20c3..0000000
--- a/backup/demo/src/app/components/popover/demos/autoclose/popover-autoclose.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-
-
-@Component({
- selector: 'ngbd-popover-autoclose',
- templateUrl: './popover-autoclose.html'
-})
-export class NgbdPopoverAutoclose {}
diff --git a/backup/demo/src/app/components/popover/demos/basic/popover-basic.html b/backup/demo/src/app/components/popover/demos/basic/popover-basic.html
deleted file mode 100644
index ab9e3b4..0000000
--- a/backup/demo/src/app/components/popover/demos/basic/popover-basic.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
- Popover on top
-
-
-
- Popover on right
-
-
-
- Popover on bottom
-
-
-
- Popover on left
-
diff --git a/backup/demo/src/app/components/popover/demos/basic/popover-basic.module.ts b/backup/demo/src/app/components/popover/demos/basic/popover-basic.module.ts
deleted file mode 100644
index 8d84297..0000000
--- a/backup/demo/src/app/components/popover/demos/basic/popover-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverBasic } from './popover-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverBasic],
- exports: [NgbdPopoverBasic],
- bootstrap: [NgbdPopoverBasic]
-})
-export class NgbdPopoverBasicModule {}
diff --git a/backup/demo/src/app/components/popover/demos/basic/popover-basic.ts b/backup/demo/src/app/components/popover/demos/basic/popover-basic.ts
deleted file mode 100644
index 9de05c0..0000000
--- a/backup/demo/src/app/components/popover/demos/basic/popover-basic.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-basic',
- templateUrl: './popover-basic.html'
-})
-export class NgbdPopoverBasic {
-}
diff --git a/backup/demo/src/app/components/popover/demos/config/popover-config.html b/backup/demo/src/app/components/popover/demos/config/popover-config.html
deleted file mode 100644
index 831b599..0000000
--- a/backup/demo/src/app/components/popover/demos/config/popover-config.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Customized popover
-
diff --git a/backup/demo/src/app/components/popover/demos/config/popover-config.module.ts b/backup/demo/src/app/components/popover/demos/config/popover-config.module.ts
deleted file mode 100644
index 3158c22..0000000
--- a/backup/demo/src/app/components/popover/demos/config/popover-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverConfig } from './popover-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverConfig],
- exports: [NgbdPopoverConfig],
- bootstrap: [NgbdPopoverConfig]
-})
-export class NgbdPopoverConfigModule {}
diff --git a/backup/demo/src/app/components/popover/demos/config/popover-config.ts b/backup/demo/src/app/components/popover/demos/config/popover-config.ts
deleted file mode 100644
index 482818f..0000000
--- a/backup/demo/src/app/components/popover/demos/config/popover-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbPopoverConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-popover-config',
- templateUrl: './popover-config.html',
- providers: [NgbPopoverConfig] // add NgbPopoverConfig to the component providers
-})
-export class NgbdPopoverConfig {
- constructor(config: NgbPopoverConfig) {
- // customize default values of popovers used by this component tree
- config.placement = 'right';
- config.triggers = 'hover';
- }
-}
diff --git a/backup/demo/src/app/components/popover/demos/container/popover-container.html b/backup/demo/src/app/components/popover/demos/container/popover-container.html
deleted file mode 100644
index 3d51559..0000000
--- a/backup/demo/src/app/components/popover/demos/container/popover-container.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- Set the container
property to "body" to have the popover be appended to the body instead of the triggering element's parent. This option is useful if the element triggering the popover is inside an element that clips its contents (i.e. overflow: hidden
).
-
-
-
-
-
- Default popover
-
-
- Popover appended to body
-
-
-
diff --git a/backup/demo/src/app/components/popover/demos/container/popover-container.module.ts b/backup/demo/src/app/components/popover/demos/container/popover-container.module.ts
deleted file mode 100644
index 4820deb..0000000
--- a/backup/demo/src/app/components/popover/demos/container/popover-container.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverContainer } from './popover-container';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverContainer],
- exports: [NgbdPopoverContainer],
- bootstrap: [NgbdPopoverContainer]
-})
-export class NgbdPopoverContainerModule {}
diff --git a/backup/demo/src/app/components/popover/demos/container/popover-container.ts b/backup/demo/src/app/components/popover/demos/container/popover-container.ts
deleted file mode 100644
index cfb5fc0..0000000
--- a/backup/demo/src/app/components/popover/demos/container/popover-container.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-container',
- templateUrl: './popover-container.html',
- styles: ['.card { overflow: hidden }']
-})
-export class NgbdPopoverContainer {
-}
diff --git a/backup/demo/src/app/components/popover/demos/customclass/popover-custom-class.module.ts b/backup/demo/src/app/components/popover/demos/customclass/popover-custom-class.module.ts
deleted file mode 100644
index ecd15d7..0000000
--- a/backup/demo/src/app/components/popover/demos/customclass/popover-custom-class.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverCustomclass } from './popover-customclass';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverCustomclass],
- exports: [NgbdPopoverCustomclass],
- bootstrap: [NgbdPopoverCustomclass]
-})
-export class NgbdPopoverCustomClassModule {}
diff --git a/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.html b/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.html
deleted file mode 100644
index 210bff9..0000000
--- a/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
- You can optionally pass in a custom class via popoverClass
-
-
-
- Popover with custom class
-
diff --git a/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.ts b/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.ts
deleted file mode 100644
index 9e0484c..0000000
--- a/backup/demo/src/app/components/popover/demos/customclass/popover-customclass.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component, ViewEncapsulation} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-customclass',
- templateUrl: './popover-customclass.html',
- encapsulation: ViewEncapsulation.None,
- styles: [`
- .my-custom-class {
- background: aliceblue;
- font-size: 125%;
- }
- .my-custom-class .arrow::after {
- border-top-color: aliceblue;
- }
- `]
-})
-export class NgbdPopoverCustomclass {
-}
diff --git a/backup/demo/src/app/components/popover/demos/delay/popover-delay.html b/backup/demo/src/app/components/popover/demos/delay/popover-delay.html
deleted file mode 100644
index 2fcd355..0000000
--- a/backup/demo/src/app/components/popover/demos/delay/popover-delay.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- When using non-manual triggers, you can control the delay to open and close the popover through the openDelay
and
- closeDelay
properties. Note that the autoClose
feature does not use the close delay, it closes the popover immediately.
-
-
-
- Hover 300ms here
-
-
-
- Hover 1s here
-
diff --git a/backup/demo/src/app/components/popover/demos/delay/popover-delay.module.ts b/backup/demo/src/app/components/popover/demos/delay/popover-delay.module.ts
deleted file mode 100644
index dc4978e..0000000
--- a/backup/demo/src/app/components/popover/demos/delay/popover-delay.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverDelay } from './popover-delay';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverDelay],
- exports: [NgbdPopoverDelay],
- bootstrap: [NgbdPopoverDelay]
-})
-export class NgbdPopoverDelayModule {}
diff --git a/backup/demo/src/app/components/popover/demos/delay/popover-delay.ts b/backup/demo/src/app/components/popover/demos/delay/popover-delay.ts
deleted file mode 100644
index d11ab36..0000000
--- a/backup/demo/src/app/components/popover/demos/delay/popover-delay.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-delay',
- templateUrl: './popover-delay.html'
-})
-export class NgbdPopoverDelay {
-}
diff --git a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tpl-content.module.ts b/backup/demo/src/app/components/popover/demos/tplcontent/popover-tpl-content.module.ts
deleted file mode 100644
index 1af0a58..0000000
--- a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tpl-content.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverTplcontent } from './popover-tplcontent';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverTplcontent],
- exports: [NgbdPopoverTplcontent],
- bootstrap: [NgbdPopoverTplcontent]
-})
-export class NgbdPopoverTplContentModule {}
diff --git a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.html b/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.html
deleted file mode 100644
index 9de0870..0000000
--- a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Popovers can contain any arbitrary HTML, Angular bindings and even directives!
- Simply enclose desired content or title in a <ng-template>
element.
-
-
-Hello, {{name}} !
-Fancy content!!
-
- I've got markup and bindings in my popover!
-
diff --git a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.ts b/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.ts
deleted file mode 100644
index da07919..0000000
--- a/backup/demo/src/app/components/popover/demos/tplcontent/popover-tplcontent.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-tplcontent',
- templateUrl: './popover-tplcontent.html'
-})
-export class NgbdPopoverTplcontent {
- name = 'World';
-}
diff --git a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tpl-with-context.module.ts b/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tpl-with-context.module.ts
deleted file mode 100644
index 169507d..0000000
--- a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tpl-with-context.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverTplwithcontext } from './popover-tplwithcontext';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverTplwithcontext],
- exports: [NgbdPopoverTplwithcontext],
- bootstrap: [NgbdPopoverTplwithcontext]
-})
-export class NgbdPopoverTplWithContextModule {}
diff --git a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.html b/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.html
deleted file mode 100644
index 5376297..0000000
--- a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
- You can optionally pass in a context when manually triggering a popover.
-
-
-{{greeting}}, {{name}} !
-Greeting in {{language}}
-
- French
-
-
- German
-
-
- English
-
diff --git a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.ts b/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.ts
deleted file mode 100644
index 54728e5..0000000
--- a/backup/demo/src/app/components/popover/demos/tplwithcontext/popover-tplwithcontext.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-tplwithcontext',
- templateUrl: './popover-tplwithcontext.html'
-})
-export class NgbdPopoverTplwithcontext {
- name = 'World';
-
- toggleWithGreeting(popover, greeting: string, language: string) {
- if (popover.isOpen()) {
- popover.close();
- } else {
- popover.open({greeting, language});
- }
- }
-}
diff --git a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.html b/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.html
deleted file mode 100644
index 4db24d3..0000000
--- a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
- You can easily override open and close triggers by specifying event names (separated by :
) in the triggers
property.
-
-
-
- Hover over me!
-
-
-
-
- Alternatively you can take full manual control over popover opening / closing events.
-
-
-
- Click me to open a popover
-
-
- Click me to close a popover
-
diff --git a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.module.ts b/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.module.ts
deleted file mode 100644
index e7dea15..0000000
--- a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverTriggers } from './popover-triggers';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverTriggers],
- exports: [NgbdPopoverTriggers],
- bootstrap: [NgbdPopoverTriggers]
-})
-export class NgbdPopoverTriggersModule {}
diff --git a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.ts b/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.ts
deleted file mode 100644
index 213a8e8..0000000
--- a/backup/demo/src/app/components/popover/demos/triggers/popover-triggers.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-triggers',
- templateUrl: './popover-triggers.html'
-})
-export class NgbdPopoverTriggers {
-}
diff --git a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.html b/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.html
deleted file mode 100644
index 0c52854..0000000
--- a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
- Open Popover
-
-
-
-
-
- Popover is currently: {{ popover.isOpen() ? 'open' : 'closed' }}
- Last shown at: {{lastShown | date:'h:mm:ss'}}
- Last hidden at: {{lastHidden | date:'h:mm:ss'}}
-
diff --git a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.module.ts b/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.module.ts
deleted file mode 100644
index fe0da14..0000000
--- a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdPopoverVisibility } from './popover-visibility';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdPopoverVisibility],
- exports: [NgbdPopoverVisibility],
- bootstrap: [NgbdPopoverVisibility]
-})
-export class NgbdPopoverVisibilityModule {}
diff --git a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.ts b/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.ts
deleted file mode 100644
index 8c78e0f..0000000
--- a/backup/demo/src/app/components/popover/demos/visibility/popover-visibility.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-popover-visibility',
- templateUrl: './popover-visibility.html'
-})
-export class NgbdPopoverVisibility {
- lastShown: Date;
- lastHidden: Date;
-
- recordShown() {
- this.lastShown = new Date();
- }
-
- recordHidden() {
- this.lastHidden = new Date();
- }
-}
diff --git a/backup/demo/src/app/components/popover/popover.module.ts b/backup/demo/src/app/components/popover/popover.module.ts
deleted file mode 100644
index c7ad32e..0000000
--- a/backup/demo/src/app/components/popover/popover.module.ts
+++ /dev/null
@@ -1,124 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdPopoverAutoclose } from './demos/autoclose/popover-autoclose';
-import { NgbdPopoverAutocloseModule } from './demos/autoclose/popover-autoclose.module';
-import { NgbdPopoverBasic } from './demos/basic/popover-basic';
-import { NgbdPopoverBasicModule } from './demos/basic/popover-basic.module';
-import { NgbdPopoverConfig } from './demos/config/popover-config';
-import { NgbdPopoverConfigModule } from './demos/config/popover-config.module';
-import { NgbdPopoverContainer } from './demos/container/popover-container';
-import { NgbdPopoverContainerModule } from './demos/container/popover-container.module';
-import { NgbdPopoverCustomClassModule } from './demos/customclass/popover-custom-class.module';
-import { NgbdPopoverCustomclass } from './demos/customclass/popover-customclass';
-import { NgbdPopoverDelay } from './demos/delay/popover-delay';
-import { NgbdPopoverDelayModule } from './demos/delay/popover-delay.module';
-import { NgbdPopoverTplContentModule } from './demos/tplcontent/popover-tpl-content.module';
-import { NgbdPopoverTplcontent } from './demos/tplcontent/popover-tplcontent';
-import { NgbdPopoverTplWithContextModule } from './demos/tplwithcontext/popover-tpl-with-context.module';
-import { NgbdPopoverTplwithcontext } from './demos/tplwithcontext/popover-tplwithcontext';
-import { NgbdPopoverTriggers } from './demos/triggers/popover-triggers';
-import { NgbdPopoverTriggersModule } from './demos/triggers/popover-triggers.module';
-import { NgbdPopoverVisibility } from './demos/visibility/popover-visibility';
-import { NgbdPopoverVisibilityModule } from './demos/visibility/popover-visibility.module';
-
-const DEMOS = {
- basic: {
- title: 'Quick and easy popovers',
- type: NgbdPopoverBasic,
- code: require('!!raw-loader!./demos/basic/popover-basic'),
- markup: require('!!raw-loader!./demos/basic/popover-basic.html')
- },
- tplcontent: {
- title: 'HTML and bindings in popovers',
- type: NgbdPopoverTplcontent,
- code: require('!!raw-loader!./demos/tplcontent/popover-tplcontent'),
- markup: require('!!raw-loader!./demos/tplcontent/popover-tplcontent.html')
- },
- triggers: {
- title: 'Custom and manual triggers',
- type: NgbdPopoverTriggers,
- code: require('!!raw-loader!./demos/triggers/popover-triggers'),
- markup: require('!!raw-loader!./demos/triggers/popover-triggers.html')
- },
- autoclose: {
- title: 'Automatic closing with keyboard and mouse',
- type: NgbdPopoverAutoclose,
- code: require('!!raw-loader!./demos/autoclose/popover-autoclose'),
- markup: require('!!raw-loader!./demos/autoclose/popover-autoclose.html')
- },
- tplwithcontext: {
- title: 'Context and manual triggers',
- type: NgbdPopoverTplwithcontext,
- code: require('!!raw-loader!./demos/tplwithcontext/popover-tplwithcontext'),
- markup: require('!!raw-loader!./demos/tplwithcontext/popover-tplwithcontext.html')
- },
- delay: {
- title: 'Open and close delays',
- type: NgbdPopoverDelay,
- code: require('!!raw-loader!./demos/delay/popover-delay'),
- markup: require('!!raw-loader!./demos/delay/popover-delay.html')
- },
- visibility: {
- title: 'Popover visibility events',
- type: NgbdPopoverVisibility,
- code: require('!!raw-loader!./demos/visibility/popover-visibility'),
- markup: require('!!raw-loader!./demos/visibility/popover-visibility.html')
- },
- container: {
- title: 'Append popover in the body',
- type: NgbdPopoverContainer,
- code: require('!!raw-loader!./demos/container/popover-container'),
- markup: require('!!raw-loader!./demos/container/popover-container.html')
- },
- customclass: {
- title: 'Popover with custom class',
- type: NgbdPopoverCustomclass,
- code: require('!!raw-loader!./demos/customclass/popover-customclass'),
- markup: require('!!raw-loader!./demos/customclass/popover-customclass.html')
- },
- config: {
- title: 'Global configuration of popovers',
- type: NgbdPopoverConfig,
- code: require('!!raw-loader!./demos/config/popover-config'),
- markup: require('!!raw-loader!./demos/config/popover-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdPopoverBasicModule,
- NgbdPopoverTplContentModule,
- NgbdPopoverTplWithContextModule,
- NgbdPopoverTriggersModule,
- NgbdPopoverAutocloseModule,
- NgbdPopoverVisibilityModule,
- NgbdPopoverContainerModule,
- NgbdPopoverCustomClassModule,
- NgbdPopoverDelayModule,
- NgbdPopoverConfigModule
- ]
-})
-export class NgbdPopoverModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('popover', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.html b/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.html
deleted file mode 100644
index 2770946..0000000
--- a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.module.ts b/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.module.ts
deleted file mode 100644
index c83922e..0000000
--- a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarBasic } from './progressbar-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarBasic],
- exports: [NgbdProgressbarBasic],
- bootstrap: [NgbdProgressbarBasic]
-})
-export class NgbdProgressbarBasicModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.ts b/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.ts
deleted file mode 100644
index 73d6aec..0000000
--- a/backup/demo/src/app/components/progressbar/demos/basic/progressbar-basic.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-progressbar-basic',
- templateUrl: './progressbar-basic.html',
- styles: [`
- ngb-progressbar {
- margin-top: 5rem;
- }
- `]
-})
-export class NgbdProgressbarBasic {
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.html b/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.html
deleted file mode 100644
index 44569a7..0000000
--- a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.html
+++ /dev/null
@@ -1,5 +0,0 @@
-This progress bar uses the customized default values.
-
-
-This progress bar uses the customized default values, but changes the type using an input.
-
diff --git a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.module.ts b/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.module.ts
deleted file mode 100644
index 3140ef3..0000000
--- a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarConfig } from './progressbar-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarConfig],
- exports: [NgbdProgressbarConfig],
- bootstrap: [NgbdProgressbarConfig]
-})
-export class NgbdProgressbarConfigModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.ts b/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.ts
deleted file mode 100644
index db51347..0000000
--- a/backup/demo/src/app/components/progressbar/demos/config/progressbar-config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbProgressbarConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-progressbar-config',
- templateUrl: './progressbar-config.html',
- providers: [NgbProgressbarConfig] // add the NgbProgressbarConfig to the component providers
-})
-export class NgbdProgressbarConfig {
- constructor(config: NgbProgressbarConfig) {
- // customize default values of progress bars used by this component tree
- config.max = 1000;
- config.striped = true;
- config.animated = true;
- config.type = 'success';
- config.height = '20px';
- }
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.html b/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.html
deleted file mode 100644
index 1858258..0000000
--- a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.html
+++ /dev/null
@@ -1,4 +0,0 @@
-default
-10px
-.5rem
-{{height}}
\ No newline at end of file
diff --git a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.module.ts b/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.module.ts
deleted file mode 100644
index 7c74f97..0000000
--- a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarHeight } from './progressbar-height';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarHeight],
- exports: [NgbdProgressbarHeight],
- bootstrap: [NgbdProgressbarHeight]
-})
-export class NgbdProgressbarHeightModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.ts b/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.ts
deleted file mode 100644
index 77f7ac4..0000000
--- a/backup/demo/src/app/components/progressbar/demos/height/progressbar-height.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-progressbar-height',
- templateUrl: './progressbar-height.html',
- styles: [`
- ngb-progressbar {
- margin-top: 5rem;
- }
- `]
-})
-export class NgbdProgressbarHeight {
- height = '20px';
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.html b/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.html
deleted file mode 100644
index 0934423..0000000
--- a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.html
+++ /dev/null
@@ -1,4 +0,0 @@
-25
-Copying file 2 of 4 ...
-50%
-Completed!
diff --git a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.module.ts b/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.module.ts
deleted file mode 100644
index f0a9373..0000000
--- a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarLabels } from './progressbar-labels';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarLabels],
- exports: [NgbdProgressbarLabels],
- bootstrap: [NgbdProgressbarLabels]
-})
-export class NgbdProgressbarLabelsModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.ts b/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.ts
deleted file mode 100644
index 76ff540..0000000
--- a/backup/demo/src/app/components/progressbar/demos/labels/progressbar-labels.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-progressbar-labels',
- templateUrl: './progressbar-labels.html',
- styles: [`
- ngb-progressbar {
- margin-top: 5rem;
- }
- `]
-})
-export class NgbdProgressbarLabels {
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-show-value.module.ts b/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-show-value.module.ts
deleted file mode 100644
index 579cb5c..0000000
--- a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-show-value.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarShowvalue } from './progressbar-showvalue';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarShowvalue],
- exports: [NgbdProgressbarShowvalue],
- bootstrap: [NgbdProgressbarShowvalue]
-})
-export class NgbdProgressbarShowValueModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.html b/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.html
deleted file mode 100644
index 4dca48c..0000000
--- a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.ts b/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.ts
deleted file mode 100644
index 0f9a0ec..0000000
--- a/backup/demo/src/app/components/progressbar/demos/showvalue/progressbar-showvalue.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-progressbar-showvalue',
- templateUrl: './progressbar-showvalue.html',
- styles: [`
- ngb-progressbar {
- margin-top: 5rem;
- }
- `]
-})
-export class NgbdProgressbarShowvalue {
-}
diff --git a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.html b/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.html
deleted file mode 100644
index f38a0bc..0000000
--- a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.module.ts b/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.module.ts
deleted file mode 100644
index fad90ad..0000000
--- a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdProgressbarStriped } from './progressbar-striped';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdProgressbarStriped],
- exports: [NgbdProgressbarStriped],
- bootstrap: [NgbdProgressbarStriped]
-})
-export class NgbdProgressbarStripedModule {}
diff --git a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.ts b/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.ts
deleted file mode 100644
index ded36a0..0000000
--- a/backup/demo/src/app/components/progressbar/demos/striped/progressbar-striped.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-progressbar-striped',
- templateUrl: './progressbar-striped.html'
-})
-export class NgbdProgressbarStriped {
-}
diff --git a/backup/demo/src/app/components/progressbar/progressbar.module.ts b/backup/demo/src/app/components/progressbar/progressbar.module.ts
deleted file mode 100644
index 8f3babb..0000000
--- a/backup/demo/src/app/components/progressbar/progressbar.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdProgressbarBasic } from './demos/basic/progressbar-basic';
-import { NgbdProgressbarBasicModule } from './demos/basic/progressbar-basic.module';
-import { NgbdProgressbarConfig } from './demos/config/progressbar-config';
-import { NgbdProgressbarConfigModule } from './demos/config/progressbar-config.module';
-import { NgbdProgressbarHeight } from './demos/height/progressbar-height';
-import { NgbdProgressbarHeightModule } from './demos/height/progressbar-height.module';
-import { NgbdProgressbarLabels } from './demos/labels/progressbar-labels';
-import { NgbdProgressbarLabelsModule } from './demos/labels/progressbar-labels.module';
-import { NgbdProgressbarShowValueModule } from './demos/showvalue/progressbar-show-value.module';
-import { NgbdProgressbarShowvalue } from './demos/showvalue/progressbar-showvalue';
-import { NgbdProgressbarStriped } from './demos/striped/progressbar-striped';
-import { NgbdProgressbarStripedModule } from './demos/striped/progressbar-striped.module';
-
-const DEMOS = {
- basic: {
- title: 'Contextual progress bars',
- type: NgbdProgressbarBasic,
- code: require('!!raw-loader!./demos/basic/progressbar-basic'),
- markup: require('!!raw-loader!./demos/basic/progressbar-basic.html')
- },
- showvalue: {
- title: 'Progress bars with current value labels',
- type: NgbdProgressbarShowvalue,
- code: require('!!raw-loader!./demos/showvalue/progressbar-showvalue'),
- markup: require('!!raw-loader!./demos/showvalue/progressbar-showvalue.html')
- },
- striped: {
- title: 'Striped progress bars',
- type: NgbdProgressbarStriped,
- code: require('!!raw-loader!./demos/striped/progressbar-striped'),
- markup: require('!!raw-loader!./demos/striped/progressbar-striped.html')
- },
- labels: {
- title: 'Progress bars with custom labels',
- type: NgbdProgressbarLabels,
- code: require('!!raw-loader!./demos/labels/progressbar-labels'),
- markup: require('!!raw-loader!./demos/labels/progressbar-labels.html')
- },
- height: {
- title: 'Progress bars with height',
- type: NgbdProgressbarHeight,
- code: require('!!raw-loader!./demos/height/progressbar-height'),
- markup: require('!!raw-loader!./demos/height/progressbar-height.html')
- },
- config: {
- title: 'Global configuration of progress bars',
- type: NgbdProgressbarConfig,
- code: require('!!raw-loader!./demos/config/progressbar-config'),
- markup: require('!!raw-loader!./demos/config/progressbar-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdProgressbarBasicModule,
- NgbdProgressbarShowValueModule,
- NgbdProgressbarStripedModule,
- NgbdProgressbarConfigModule,
- NgbdProgressbarLabelsModule,
- NgbdProgressbarHeightModule
- ]
-})
-export class NgbdProgressbarModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('progressbar', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/rating/demos/basic/rating-basic.html b/backup/demo/src/app/components/rating/demos/basic/rating-basic.html
deleted file mode 100644
index 79d4881..0000000
--- a/backup/demo/src/app/components/rating/demos/basic/rating-basic.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-Rate: {{currentRate}}
diff --git a/backup/demo/src/app/components/rating/demos/basic/rating-basic.module.ts b/backup/demo/src/app/components/rating/demos/basic/rating-basic.module.ts
deleted file mode 100644
index e1b8237..0000000
--- a/backup/demo/src/app/components/rating/demos/basic/rating-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingBasic } from './rating-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdRatingBasic],
- exports: [NgbdRatingBasic],
- bootstrap: [NgbdRatingBasic]
-})
-export class NgbdRatingBasicModule {}
diff --git a/backup/demo/src/app/components/rating/demos/basic/rating-basic.ts b/backup/demo/src/app/components/rating/demos/basic/rating-basic.ts
deleted file mode 100644
index f94da7a..0000000
--- a/backup/demo/src/app/components/rating/demos/basic/rating-basic.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-rating-basic',
- templateUrl: './rating-basic.html'
-})
-export class NgbdRatingBasic {
- currentRate = 8;
-}
diff --git a/backup/demo/src/app/components/rating/demos/config/rating-config.html b/backup/demo/src/app/components/rating/demos/config/rating-config.html
deleted file mode 100644
index b89df28..0000000
--- a/backup/demo/src/app/components/rating/demos/config/rating-config.html
+++ /dev/null
@@ -1,3 +0,0 @@
-This rating uses customized default values.
-
-
diff --git a/backup/demo/src/app/components/rating/demos/config/rating-config.module.ts b/backup/demo/src/app/components/rating/demos/config/rating-config.module.ts
deleted file mode 100644
index 7bce6ee..0000000
--- a/backup/demo/src/app/components/rating/demos/config/rating-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingConfig } from './rating-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdRatingConfig],
- exports: [NgbdRatingConfig],
- bootstrap: [NgbdRatingConfig]
-})
-export class NgbdRatingConfigModule {}
diff --git a/backup/demo/src/app/components/rating/demos/config/rating-config.ts b/backup/demo/src/app/components/rating/demos/config/rating-config.ts
deleted file mode 100644
index 281a3f7..0000000
--- a/backup/demo/src/app/components/rating/demos/config/rating-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbRatingConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-rating-config',
- templateUrl: './rating-config.html',
- providers: [NgbRatingConfig] // add NgbRatingConfig to the component providers
-})
-export class NgbdRatingConfig {
- constructor(config: NgbRatingConfig) {
- // customize default values of ratings used by this component tree
- config.max = 5;
- config.readonly = true;
- }
-}
diff --git a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.html b/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.html
deleted file mode 100644
index 83a7a99..0000000
--- a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.html
+++ /dev/null
@@ -1,14 +0,0 @@
-Custom rating template provided via a variable. Shows fine-grained rating display
-
-
-
- ♥ ♥
-
-
-
-
-
-
-Rate: {{currentRate}}
-1.35
-4.72
diff --git a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.module.ts b/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.module.ts
deleted file mode 100644
index 0059994..0000000
--- a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingDecimal } from './rating-decimal';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdRatingDecimal],
- exports: [NgbdRatingDecimal],
- bootstrap: [NgbdRatingDecimal]
-})
-export class NgbdRatingDecimalModule {}
diff --git a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.ts b/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.ts
deleted file mode 100644
index 798d6d9..0000000
--- a/backup/demo/src/app/components/rating/demos/decimal/rating-decimal.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-rating-decimal',
- templateUrl: './rating-decimal.html',
- styles: [`
- .star {
- position: relative;
- display: inline-block;
- font-size: 3rem;
- color: #d3d3d3;
- }
- .full {
- color: red;
- }
- .half {
- position: absolute;
- display: inline-block;
- overflow: hidden;
- color: red;
- }
- `]
-})
-export class NgbdRatingDecimal {
- currentRate = 3.14;
-}
diff --git a/backup/demo/src/app/components/rating/demos/events/rating-events.html b/backup/demo/src/app/components/rating/demos/events/rating-events.html
deleted file mode 100644
index 7ec2131..0000000
--- a/backup/demo/src/app/components/rating/demos/events/rating-events.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-Selected: {{selected}}
-Hovered: {{hovered}}
-
-
- {{ readonly ? "readonly" : "editable"}}
-
diff --git a/backup/demo/src/app/components/rating/demos/events/rating-events.module.ts b/backup/demo/src/app/components/rating/demos/events/rating-events.module.ts
deleted file mode 100644
index eb5d95e..0000000
--- a/backup/demo/src/app/components/rating/demos/events/rating-events.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingEvents } from './rating-events';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdRatingEvents],
- exports: [NgbdRatingEvents],
- bootstrap: [NgbdRatingEvents]
-})
-export class NgbdRatingEventsModule {}
diff --git a/backup/demo/src/app/components/rating/demos/events/rating-events.ts b/backup/demo/src/app/components/rating/demos/events/rating-events.ts
deleted file mode 100644
index af9ec63..0000000
--- a/backup/demo/src/app/components/rating/demos/events/rating-events.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-rating-events',
- templateUrl: './rating-events.html'
-})
-export class NgbdRatingEvents {
- selected = 0;
- hovered = 0;
- readonly = false;
-}
diff --git a/backup/demo/src/app/components/rating/demos/form/rating-form.html b/backup/demo/src/app/components/rating/demos/form/rating-form.html
deleted file mode 100644
index 35000ab..0000000
--- a/backup/demo/src/app/components/rating/demos/form/rating-form.html
+++ /dev/null
@@ -1,16 +0,0 @@
-NgModel and reactive forms can be used without the 'rate' binding
-
-
-
-
-Model: {{ ctrl.value }}
-
- {{ ctrl.disabled ? "control disabled" : " control enabled" }}
-
-Clear
diff --git a/backup/demo/src/app/components/rating/demos/form/rating-form.module.ts b/backup/demo/src/app/components/rating/demos/form/rating-form.module.ts
deleted file mode 100644
index 794c576..0000000
--- a/backup/demo/src/app/components/rating/demos/form/rating-form.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingForm } from './rating-form';
-
-@NgModule({
- imports: [BrowserModule, ReactiveFormsModule, NgbModule],
- declarations: [NgbdRatingForm],
- exports: [NgbdRatingForm],
- bootstrap: [NgbdRatingForm]
-})
-export class NgbdRatingFormModule {}
diff --git a/backup/demo/src/app/components/rating/demos/form/rating-form.ts b/backup/demo/src/app/components/rating/demos/form/rating-form.ts
deleted file mode 100644
index 6c95edc..0000000
--- a/backup/demo/src/app/components/rating/demos/form/rating-form.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component} from '@angular/core';
-import {FormControl, Validators} from '@angular/forms';
-
-@Component({
- selector: 'ngbd-rating-form',
- templateUrl: './rating-form.html'
-})
-export class NgbdRatingForm {
- ctrl = new FormControl(null, Validators.required);
-
- toggle() {
- if (this.ctrl.disabled) {
- this.ctrl.enable();
- } else {
- this.ctrl.disable();
- }
- }
-}
diff --git a/backup/demo/src/app/components/rating/demos/template/rating-template.html b/backup/demo/src/app/components/rating/demos/template/rating-template.html
deleted file mode 100644
index f73b55f..0000000
--- a/backup/demo/src/app/components/rating/demos/template/rating-template.html
+++ /dev/null
@@ -1,9 +0,0 @@
-Custom rating template provided as child element
-
-
-
- ★
-
-
-
-Rate: {{currentRate}}
diff --git a/backup/demo/src/app/components/rating/demos/template/rating-template.module.ts b/backup/demo/src/app/components/rating/demos/template/rating-template.module.ts
deleted file mode 100644
index 433c0a0..0000000
--- a/backup/demo/src/app/components/rating/demos/template/rating-template.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdRatingTemplate } from './rating-template';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdRatingTemplate],
- exports: [NgbdRatingTemplate],
- bootstrap: [NgbdRatingTemplate]
-})
-export class NgbdRatingTemplateModule {}
diff --git a/backup/demo/src/app/components/rating/demos/template/rating-template.ts b/backup/demo/src/app/components/rating/demos/template/rating-template.ts
deleted file mode 100644
index 9f26183..0000000
--- a/backup/demo/src/app/components/rating/demos/template/rating-template.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-rating-template',
- templateUrl: './rating-template.html',
- styles: [`
- .star {
- font-size: 1.5rem;
- color: #b0c4de;
- }
- .filled {
- color: #1e90ff;
- }
- .bad {
- color: #deb0b0;
- }
- .filled.bad {
- color: #ff1e1e;
- }
- `]
-})
-export class NgbdRatingTemplate {
- currentRate = 6;
-}
diff --git a/backup/demo/src/app/components/rating/rating.module.ts b/backup/demo/src/app/components/rating/rating.module.ts
deleted file mode 100644
index 830a854..0000000
--- a/backup/demo/src/app/components/rating/rating.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdRatingBasic } from './demos/basic/rating-basic';
-import { NgbdRatingBasicModule } from './demos/basic/rating-basic.module';
-import { NgbdRatingConfig } from './demos/config/rating-config';
-import { NgbdRatingConfigModule } from './demos/config/rating-config.module';
-import { NgbdRatingDecimal } from './demos/decimal/rating-decimal';
-import { NgbdRatingDecimalModule } from './demos/decimal/rating-decimal.module';
-import { NgbdRatingEvents } from './demos/events/rating-events';
-import { NgbdRatingEventsModule } from './demos/events/rating-events.module';
-import { NgbdRatingForm } from './demos/form/rating-form';
-import { NgbdRatingFormModule } from './demos/form/rating-form.module';
-import { NgbdRatingTemplate } from './demos/template/rating-template';
-import { NgbdRatingTemplateModule } from './demos/template/rating-template.module';
-
-const DEMOS = {
- basic: {
- title: 'Basic demo',
- type: NgbdRatingBasic,
- code: require('!!raw-loader!./demos/basic/rating-basic'),
- markup: require('!!raw-loader!./demos/basic/rating-basic.html')
- },
- events: {
- title: 'Events and readonly ratings',
- type: NgbdRatingEvents,
- code: require('!!raw-loader!./demos/events/rating-events'),
- markup: require('!!raw-loader!./demos/events/rating-events.html')
- },
- template: {
- title: 'Custom star template',
- type: NgbdRatingTemplate,
- code: require('!!raw-loader!./demos/template/rating-template'),
- markup: require('!!raw-loader!./demos/template/rating-template.html')
- },
- decimal: {
- title: 'Custom decimal rating',
- type: NgbdRatingDecimal,
- code: require('!!raw-loader!./demos/decimal/rating-decimal'),
- markup: require('!!raw-loader!./demos/decimal/rating-decimal.html')
- },
- form: {
- title: 'Form integration',
- type: NgbdRatingForm,
- code: require('!!raw-loader!./demos/form/rating-form'),
- markup: require('!!raw-loader!./demos/form/rating-form.html')
- },
- config: {
- title: 'Global configuration of ratings',
- type: NgbdRatingConfig,
- code: require('!!raw-loader!./demos/config/rating-config'),
- markup: require('!!raw-loader!./demos/config/rating-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdRatingBasicModule,
- NgbdRatingConfigModule,
- NgbdRatingTemplateModule,
- NgbdRatingEventsModule,
- NgbdRatingDecimalModule,
- NgbdRatingFormModule
- ]
-})
-export class NgbdRatingModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('rating', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs-badge.component.ts b/backup/demo/src/app/components/shared/api-docs/api-docs-badge.component.ts
deleted file mode 100644
index 93c9fbe..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs-badge.component.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
-
-const BADGES = {
- 'Directive': 'success',
- 'Component': 'success',
- 'Service': 'primary',
- 'Configuration': 'primary',
- 'Class': 'danger',
- 'Interface': 'danger'
-};
-
-@Component({
- selector: 'ngbd-api-docs-badge',
- template: `
-
- Deprecated {{ deprecated.version }} &ngsp;
- Since {{ since.version }} &ngsp;
- {{text}}
-
- `,
- changeDetection: ChangeDetectionStrategy.OnPush
-})
-export class NgbdApiDocsBadge {
-
- badgeClass;
- text;
-
- @Input() deprecated: {version: string};
-
- @Input() since: {version: string};
-
- @Input()
- set type(type: string) {
- this.text = type;
- this.badgeClass = `badge-${BADGES[type] || 'secondary'}`;
- }
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.html b/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.html
deleted file mode 100644
index 717bbe7..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
- {{apiDocs.className}}<{{apiDocs.typeParameter}}>
-
-
-
-
-
-
-
{{ apiDocs.deprecated.description }}
-
-
-
-
- Properties
-
-
-
-
- {{prop.name}}
- since {{ prop.since.version }} &ngsp;
- deprecated {{ prop.deprecated.version }}
-
-
- {{ prop.deprecated.description }}
-
-
-
-
-
-
-
-
-
-
-
- Methods
-
-
-
-
- {{method.name}}
- since {{ method.since.version }} &ngsp;
- deprecated {{ method.deprecated.version }}
-
-
-
- {{methodSignature(method)}}
&ngsp;
- => {{ method.returnType }}
-
- {{ method.deprecated.description }}
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.ts b/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.ts
deleted file mode 100644
index de6b26a..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs-class.component.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import {Component, ChangeDetectionStrategy, Input} from '@angular/core';
-import docs from '../../../../api-docs';
-import {ClassDesc, MethodDesc, signature} from './api-docs.model';
-import {Analytics} from '../../../shared/analytics/analytics';
-
-/**
- * Displays the API docs of a class, which is not a directive.
- *
- * For Config services, use NgbdApiDocsConfig instead.
- */
-@Component({
- selector: 'ngbd-api-docs-class',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './api-docs-class.component.html',
- styles: [`
- .label-cell {
- width: 25%;
- }
- .content-cell {
- width: 75%;
- }
- `
- ]
-})
-export class NgbdApiDocsClass {
- apiDocs: ClassDesc;
-
- constructor(private _analytics: Analytics) {}
-
- @Input() set type(typeName: string) {
- this.apiDocs = docs[typeName];
- }
-
- methodSignature(method: MethodDesc): string { return signature(method); }
-
- trackSourceClick() {
- this._analytics.trackEvent('Source File View', this.apiDocs.className);
- }
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.html b/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.html
deleted file mode 100644
index 51888db..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
- {{apiDocs.className}}<{{apiDocs.typeParameter}}>
-
-
-
-
-
-
-
{{ apiDocs.deprecated.description }}
-
-
-
-
- Properties
-
-
- {{ property.name }}
&ngsp;
-
-
- Documentation available in {{ directiveName }}
-
-
-
-
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.ts b/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.ts
deleted file mode 100644
index a3b5296..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs-config.component.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {Component, ChangeDetectionStrategy, Input} from '@angular/core';
-import docs from '../../../../api-docs';
-import {ClassDesc} from './api-docs.model';
-import {Analytics} from '../../../shared/analytics/analytics';
-
-const CONFIG_SUFFIX_LENGTH = 'Config'.length;
-
-/**
- * Displays the API docs of a Config service. A Config service for a component Foo is named, by convention,
- * FooConfig, and only has properties, whose name matches with an input of the directive.
- * In order to avoid cluttering the demo pages, the only things displayed by this component
- * is the description of the Config service and the list of its properties, whose documentation and
- * default value is documented in the directive itself.
- */
-@Component({
- selector: 'ngbd-api-docs-config',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './api-docs-config.component.html'
-})
-export class NgbdApiDocsConfig {
- apiDocs: ClassDesc;
- directiveName: string;
-
- constructor(private _analytics: Analytics) {}
-
- @Input() set type(typeName: string) {
- this.apiDocs = docs[typeName];
- this.directiveName = typeName.slice(0, -CONFIG_SUFFIX_LENGTH);
- }
-
- trackSourceClick() {
- this._analytics.trackEvent('Source File View', this.apiDocs.className);
- }
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs.component.html b/backup/demo/src/app/components/shared/api-docs/api-docs.component.html
deleted file mode 100644
index fec023d..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs.component.html
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
-
-
- {{apiDocs.className}}<{{apiDocs.typeParameter}}>
-
-
-
-
-
-
-
{{ apiDocs.deprecated.description }}
-
-
-
-
- Selector {{apiDocs.selector}}
- Exported as {{apiDocs.exportAs}}
-
-
-
-
- Inputs
-
-
-
-
- {{input.name}}
- since {{ input.since.version }} &ngsp;
- deprecated {{ input.deprecated.version }}
-
-
- {{ input.deprecated.description }}
-
-
-
-
-
-
-
-
-
-
-
- Outputs
-
-
-
-
- {{output.name}}
- since {{ output.since.version }} &ngsp;
- deprecated {{ output.deprecated.version }}
-
-
- {{ output.deprecated.description }}
-
-
-
-
-
-
-
-
-
-
- Methods
-
-
-
-
- {{method.name}}
- since {{ method.since.version }} &ngsp;
- deprecated {{ method.deprecated.version }}
-
-
-
- {{methodSignature(method)}}
&ngsp;
- => {{ method.returnType }}
-
- {{ method.deprecated.description }}
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs.component.ts b/backup/demo/src/app/components/shared/api-docs/api-docs.component.ts
deleted file mode 100644
index 6eda10a..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs.component.ts
+++ /dev/null
@@ -1,77 +0,0 @@
-import {Component, ChangeDetectionStrategy, Input} from '@angular/core';
-import docs from '../../../../api-docs';
-import {PropertyDesc, DirectiveDesc, InputDesc, MethodDesc, ClassDesc, signature} from './api-docs.model';
-import {Analytics} from '../../../shared/analytics/analytics';
-
-/**
- * Displays the API docs of a directive.
- *
- * The default values of its inputs are looked for in the directive api doc itself, or in the matching property
- * of associated Config service, if any.
- *
- * The config service of a directive NgbFoo is, by convention, named NgbFooConfig.
- */
-@Component({
- selector: 'ngbd-api-docs',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './api-docs.component.html',
- styles: [`
- .label-cell {
- width: 25%;
- }
- .content-cell {
- width: 75%;
- }
- `
- ]
-})
-export class NgbdApiDocs {
-
- /**
- * Object which contains, for each input name of the directive, the corresponding property of the associated config
- * service (if any)
- */
- private _configProperties: {[propertyName: string]: PropertyDesc};
-
- apiDocs: DirectiveDesc;
- configServiceName: string;
-
- constructor(private _analytics: Analytics) {}
-
- @Input() set directive(directiveName: string) {
- this.apiDocs = docs[directiveName];
- this.configServiceName = `${directiveName}Config`;
- const configApiDocs = docs[this.configServiceName];
- this._configProperties = {};
- if (configApiDocs) {
- this.apiDocs.inputs.forEach(
- input => this._configProperties[input.name] = this._findInputConfigProperty(configApiDocs, input));
- }
- }
-
- /**
- * Returns the default value of the given directive input by first looking for it in the matching config service
- * property. If there is no matching config property, it reads it from the input.
- */
- defaultInputValue(input: InputDesc): string {
- const configProperty = this._configProperties[input.name];
- return configProperty ? configProperty.defaultValue : input.defaultValue;
- }
-
- /**
- * Returns true if there is a config service property matching with the given directive input
- */
- hasConfigProperty(input: InputDesc): boolean {
- return !!this._configProperties[input.name];
- }
-
- methodSignature(method: MethodDesc): string { return signature(method); }
-
- trackSourceClick() {
- this._analytics.trackEvent('Source File View', this.apiDocs.className);
- }
-
- private _findInputConfigProperty(configApiDocs: ClassDesc, input: InputDesc): PropertyDesc {
- return configApiDocs.properties.filter(prop => prop.name === input.name)[0];
- }
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/api-docs.model.ts b/backup/demo/src/app/components/shared/api-docs/api-docs.model.ts
deleted file mode 100644
index e1ed598..0000000
--- a/backup/demo/src/app/components/shared/api-docs/api-docs.model.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-export interface ClassDesc {
- type: string;
- typeParameter: string;
- fileName: string;
- className: string;
- description: string;
- deprecated?: VersionDesc;
- since?: VersionDesc;
- properties: PropertyDesc[];
- methods: MethodDesc[];
-}
-
-export interface DirectiveDesc extends ClassDesc {
- selector: string;
- exportAs?: string;
- inputs: InputDesc[];
- outputs: OutputDesc[];
-}
-
-export interface PropertyDesc {
- name: string;
- type: string;
- description: string;
- deprecated?: VersionDesc;
- since?: VersionDesc;
- defaultValue?: string;
-}
-
-export interface MethodDesc {
- name: string;
- description: string;
- deprecated?: VersionDesc;
- since?: VersionDesc;
- args: ArgumentDesc[];
- returnType: string;
-}
-
-export interface VersionDesc {
- version: string;
- description: string;
-}
-
-export interface ArgumentDesc {
- name: string;
- type: string;
-}
-
-export interface InputDesc extends PropertyDesc {}
-
-export interface OutputDesc extends PropertyDesc {}
-
-export function signature(method: MethodDesc): string {
- const args = method['args'].map(arg => `${arg.name}: ${arg.type}`).join(', ');
- return `${method.name}(${args})`;
-}
diff --git a/backup/demo/src/app/components/shared/api-docs/index.ts b/backup/demo/src/app/components/shared/api-docs/index.ts
deleted file mode 100644
index c3f4dfb..0000000
--- a/backup/demo/src/app/components/shared/api-docs/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export * from './api-docs.component';
-export * from './api-docs-badge.component';
-export * from './api-docs-class.component';
-export * from './api-docs-config.component';
diff --git a/backup/demo/src/app/components/shared/api-page/api.component.ts b/backup/demo/src/app/components/shared/api-page/api.component.ts
deleted file mode 100644
index 0345e63..0000000
--- a/backup/demo/src/app/components/shared/api-page/api.component.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-import { ActivatedRoute } from '@angular/router';
-
-import apiDocs from '../../../../api-docs';
-
-export function getApis(component) {
- const components = [];
- const classes = [];
- const configs = [];
- Object.values(apiDocs)
- .filter(entity => entity.fileName.startsWith(`src/${component}`))
- .forEach(entity => {
- switch (entity.type) {
- case 'Directive':
- case 'Component':
- components.push(entity.className);
- break;
-
- case 'Service':
- if (entity.className.endsWith('Config')) {
- configs.push(entity.className);
- } else {
- classes.push(entity.className);
- }
- break;
- default:
- classes.push(entity.className);
- break;
- }
- });
- return { components, classes, configs };
-}
-
-@Component({
- changeDetection: ChangeDetectionStrategy.OnPush,
- template: `
-
-
-
- `
-})
-export class NgbdApiPage {
- classes: string[];
- components: string[];
- configs: string[];
-
- constructor(route: ActivatedRoute) {
- const component = route.parent.parent.snapshot.url[1].path;
- const apis = getApis(component);
- this.components = apis.components.sort();
- this.classes = apis.classes.sort();
- this.configs = apis.configs.sort();
- }
-}
diff --git a/backup/demo/src/app/components/shared/demo-list.ts b/backup/demo/src/app/components/shared/demo-list.ts
deleted file mode 100644
index 0cb88d6..0000000
--- a/backup/demo/src/app/components/shared/demo-list.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import {Injectable} from '@angular/core';
-
-export interface NgbdDemoConfig {
- title: string;
- code?: string;
- markup?: string;
- type: any;
- files?: Array<{[name: string]: string}>;
- showCode?: boolean;
-}
-
-export interface NgbdDemoListConfig { [demo: string]: NgbdDemoConfig; }
-
-export interface NgbdDemoOverviewConfig { [anchor: string]: string; }
-
-@Injectable({providedIn: 'root'})
-export class NgbdDemoList {
- private _demos: {[widget: string]: NgbdDemoListConfig} = {};
-
- private _overviews: {[widget: string]: NgbdDemoOverviewConfig} = {};
-
-
- register(widget: string, list: NgbdDemoListConfig, overview?: NgbdDemoOverviewConfig) {
- this._demos[widget] = list;
- if (overview) {
- this._overviews[widget] = overview;
- }
- }
-
- getDemos(widget: string) { return this._demos[widget]; }
-
- getOverviewSections(widget: string) {
- const overview = this._overviews[widget];
- const sections = {};
- if (overview) {
- Object.keys(overview).forEach(fragment => { sections[fragment] = {fragment, title: overview[fragment]}; });
- }
- return sections;
- }
-}
diff --git a/backup/demo/src/app/components/shared/examples-page/demo.component.html b/backup/demo/src/app/components/shared/examples-page/demo.component.html
deleted file mode 100644
index d3488c4..0000000
--- a/backup/demo/src/app/components/shared/examples-page/demo.component.html
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
- {{ demoTitle }}
-
-
-
-
- Code
-
-
-
- StackBlitz
-
-
-
-
-
-
-
-
- {{file.name}}
-
-
-
-
-
-
-
-
-
-
- {{component}}-{{id}}.html
-
-
-
-
-
-
-
- {{component}}-{{id}}.ts
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/components/shared/examples-page/demo.component.ts b/backup/demo/src/app/components/shared/examples-page/demo.component.ts
deleted file mode 100644
index d1b47b8..0000000
--- a/backup/demo/src/app/components/shared/examples-page/demo.component.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
-
-import {Analytics} from '../../../shared/analytics/analytics';
-import {Snippet} from '../../../shared/code/snippet';
-
-@Component({
- selector: 'ngbd-widget-demo',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './demo.component.html'
-})
-export class NgbdWidgetDemoComponent {
- @Input() demoTitle: string;
- @Input() component: string;
- @Input() id: string;
- @Input() code: string;
- @Input() markup: string;
- @Input() files: { name: string; source: string }[];
- @Input() showCode = false;
-
- get markupSnippet() { return Snippet({lang: 'html', code: this.markup}); }
- get codeSnippet() { return Snippet({lang: 'typescript', code: this.code}); }
-
- getFileSnippet({name, source}) {
- return Snippet({code: source, lang: name.split('.').pop()});
- }
-
- get hasManyFiles() {
- return this.files && this.files.length > 5;
- }
-
- constructor(private _analytics: Analytics) {}
-
- tabType(name: string) {
- const ext = name.split('.').pop();
- return (
- {
- html: 'HTML',
- scss: 'Style (SCSS)',
- css: 'Style (CSS)',
- ts: 'Typescript'
- }[ext] || 'Code'
- );
- }
-
- trackStackBlitzClick() {
- this._analytics.trackEvent(
- 'StackBlitz View',
- this.component + ' ' + this.id
- );
- }
- trackShowCodeClick() {
- if (this.showCode) {
- this._analytics.trackEvent(
- 'Show Code View',
- this.component + ' ' + this.id
- );
- }
- }
-}
diff --git a/backup/demo/src/app/components/shared/examples-page/examples.component.ts b/backup/demo/src/app/components/shared/examples-page/examples.component.ts
deleted file mode 100644
index d2b52cf..0000000
--- a/backup/demo/src/app/components/shared/examples-page/examples.component.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import {Component} from '@angular/core';
-import {ActivatedRoute} from '@angular/router';
-
-import {NgbdDemoList} from '../demo-list';
-
-@Component({
- template: `
-
-
-
- `
-})
-export class NgbdExamplesPage {
- component: string;
- demos = [];
-
- constructor(route: ActivatedRoute, demoList: NgbdDemoList) {
- // We go up to parent route defining /components/:widget to read the widget name
- // This route is declared in root app.routing.ts.
- const componentName = (this.component =
- route.parent.parent.snapshot.url[1].path);
- if (componentName) {
- const demos = demoList.getDemos(componentName);
- if (demos) {
- this.demos = Object.keys(demos).map(id => {
- return { id, ...demos[id] };
- });
- }
- }
- }
-}
diff --git a/backup/demo/src/app/components/shared/index.ts b/backup/demo/src/app/components/shared/index.ts
deleted file mode 100644
index 82e5348..0000000
--- a/backup/demo/src/app/components/shared/index.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { NgbdApiDocs, NgbdApiDocsBadge, NgbdApiDocsClass, NgbdApiDocsConfig } from './api-docs';
-import { NgbdApiPage } from './api-page/api.component';
-import { NgbdWidgetDemoComponent } from './examples-page/demo.component';
-import { NgbdExamplesPage } from './examples-page/examples.component';
-import { NgbdOverviewDirective, NgbdOverviewSectionComponent } from './overview';
-
-export * from './demo-list';
-
-@NgModule({
- imports: [NgbdSharedModule],
- declarations: [
- NgbdApiDocsBadge,
- NgbdApiDocs,
- NgbdApiDocsClass,
- NgbdApiDocsConfig,
- NgbdOverviewDirective,
- NgbdOverviewSectionComponent,
- NgbdExamplesPage,
- NgbdApiPage,
- NgbdWidgetDemoComponent
- ],
- exports: [
- NgbdApiDocsBadge,
- NgbdApiDocs,
- NgbdApiDocsClass,
- NgbdApiDocsConfig,
- NgbdOverviewDirective,
- NgbdOverviewSectionComponent,
- NgbdExamplesPage,
- NgbdApiPage,
- NgbdWidgetDemoComponent
- ]
-})
-export class NgbdComponentsSharedModule {}
diff --git a/backup/demo/src/app/components/shared/overview/index.ts b/backup/demo/src/app/components/shared/overview/index.ts
deleted file mode 100644
index 069033e..0000000
--- a/backup/demo/src/app/components/shared/overview/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './overview';
-export * from './overview.directive';
-export * from './overview-section.component';
diff --git a/backup/demo/src/app/components/shared/overview/overview-section.component.ts b/backup/demo/src/app/components/shared/overview/overview-section.component.ts
deleted file mode 100644
index 92adcd4..0000000
--- a/backup/demo/src/app/components/shared/overview/overview-section.component.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
-
-import { NgbdOverviewSection } from './overview';
-
-@Component({
- selector: 'ngbd-overview-section',
- changeDetection: ChangeDetectionStrategy.OnPush,
- host: {
- 'class': 'd-block'
- },
- template: `
-
-
-
-
- {{ section.title }}
-
-
-
- `
-})
-export class NgbdOverviewSectionComponent {
- @Input() section: NgbdOverviewSection;
-}
diff --git a/backup/demo/src/app/components/shared/overview/overview.directive.ts b/backup/demo/src/app/components/shared/overview/overview.directive.ts
deleted file mode 100644
index 31478cc..0000000
--- a/backup/demo/src/app/components/shared/overview/overview.directive.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import {Directive} from '@angular/core';
-
-@Directive({
- selector: '[ngbdOverview]'
-})
-export class NgbdOverviewDirective {
-}
diff --git a/backup/demo/src/app/components/shared/overview/overview.ts b/backup/demo/src/app/components/shared/overview/overview.ts
deleted file mode 100644
index b6e7a8f..0000000
--- a/backup/demo/src/app/components/shared/overview/overview.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export interface NgbdOverviewSection {
- title: string | false;
- fragment?: string;
-}
-
-export interface NgbdOverview {
- [fragment: string]: NgbdOverviewSection;
-}
diff --git a/backup/demo/src/app/components/table/demos/basic/table-basic.html b/backup/demo/src/app/components/table/demos/basic/table-basic.html
deleted file mode 100644
index 450d906..0000000
--- a/backup/demo/src/app/components/table/demos/basic/table-basic.html
+++ /dev/null
@@ -1,23 +0,0 @@
-Table is just a mapping of objects to table rows with ngFor
-
-
-
-
- #
- Country
- Area
- Population
-
-
-
-
- {{ i + 1 }}
-
-
- {{ country.name }}
-
- {{ country.area | number }}
- {{ country.population | number }}
-
-
-
diff --git a/backup/demo/src/app/components/table/demos/basic/table-basic.module.ts b/backup/demo/src/app/components/table/demos/basic/table-basic.module.ts
deleted file mode 100644
index f088e73..0000000
--- a/backup/demo/src/app/components/table/demos/basic/table-basic.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTableBasic } from './table-basic';
-
-@NgModule({
- imports: [BrowserModule, CommonModule, NgbModule],
- declarations: [NgbdTableBasic],
- exports: [NgbdTableBasic],
- bootstrap: [NgbdTableBasic]
-})
-export class NgbdTableBasicModule {}
diff --git a/backup/demo/src/app/components/table/demos/basic/table-basic.ts b/backup/demo/src/app/components/table/demos/basic/table-basic.ts
deleted file mode 100644
index bef9a4c..0000000
--- a/backup/demo/src/app/components/table/demos/basic/table-basic.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-import { Component } from '@angular/core';
-
-interface Country {
- name: string;
- flag: string;
- area: number;
- population: number;
-}
-
-const COUNTRIES: Country[] = [
- {
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- },
- {
- name: 'China',
- flag: 'f/fa/Flag_of_the_People%27s_Republic_of_China.svg',
- area: 9596960,
- population: 1409517397
- }
-];
-
-@Component({
- selector: 'ngbd-table-basic',
- templateUrl: './table-basic.html'
-})
-export class NgbdTableBasic {
-
- countries = COUNTRIES;
-}
diff --git a/backup/demo/src/app/components/table/demos/complete/countries.ts b/backup/demo/src/app/components/table/demos/complete/countries.ts
deleted file mode 100644
index b7fd4be..0000000
--- a/backup/demo/src/app/components/table/demos/complete/countries.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import {Country} from './country';
-
-export const COUNTRIES: Country[] = [
- {
- id: 1,
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- id: 2,
- name: 'France',
- flag: 'c/c3/Flag_of_France.svg',
- area: 640679,
- population: 64979548
- },
- {
- id: 3,
- name: 'Germany',
- flag: 'b/ba/Flag_of_Germany.svg',
- area: 357114,
- population: 82114224
- },
- {
- id: 4,
- name: 'Portugal',
- flag: '5/5c/Flag_of_Portugal.svg',
- area: 92090,
- population: 10329506
- },
- {
- id: 5,
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- id: 6,
- name: 'Vietnam',
- flag: '2/21/Flag_of_Vietnam.svg',
- area: 331212,
- population: 95540800
- },
- {
- id: 7,
- name: 'Brazil',
- flag: '0/05/Flag_of_Brazil.svg',
- area: 8515767,
- population: 209288278
- },
- {
- id: 8,
- name: 'Mexico',
- flag: 'f/fc/Flag_of_Mexico.svg',
- area: 1964375,
- population: 129163276
- },
- {
- id: 9,
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- },
- {
- id: 10,
- name: 'India',
- flag: '4/41/Flag_of_India.svg',
- area: 3287263,
- population: 1324171354
- },
- {
- id: 11,
- name: 'Indonesia',
- flag: '9/9f/Flag_of_Indonesia.svg',
- area: 1910931,
- population: 263991379
- },
- {
- id: 12,
- name: 'Tuvalu',
- flag: '3/38/Flag_of_Tuvalu.svg',
- area: 26,
- population: 11097
- },
- {
- id: 13,
- name: 'China',
- flag: 'f/fa/Flag_of_the_People%27s_Republic_of_China.svg',
- area: 9596960,
- population: 1409517397
- }
-];
diff --git a/backup/demo/src/app/components/table/demos/complete/country.service.ts b/backup/demo/src/app/components/table/demos/complete/country.service.ts
deleted file mode 100644
index 5b31652..0000000
--- a/backup/demo/src/app/components/table/demos/complete/country.service.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import {Injectable, PipeTransform} from '@angular/core';
-
-import {BehaviorSubject, Observable, of, Subject} from 'rxjs';
-
-import {Country} from './country';
-import {COUNTRIES} from './countries';
-import {DecimalPipe} from '@angular/common';
-import {debounceTime, delay, switchMap, tap} from 'rxjs/operators';
-import {SortDirection} from './sortable.directive';
-
-interface SearchResult {
- countries: Country[];
- total: number;
-}
-
-interface State {
- page: number;
- pageSize: number;
- searchTerm: string;
- sortColumn: string;
- sortDirection: SortDirection;
-}
-
-function compare(v1, v2) {
- return v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
-}
-
-function sort(countries: Country[], column: string, direction: string): Country[] {
- if (direction === '') {
- return countries;
- } else {
- return [...countries].sort((a, b) => {
- const res = compare(a[column], b[column]);
- return direction === 'asc' ? res : -res;
- });
- }
-}
-
-function matches(country: Country, term: string, pipe: PipeTransform) {
- return country.name.toLowerCase().includes(term.toLowerCase())
- || pipe.transform(country.area).includes(term)
- || pipe.transform(country.population).includes(term);
-}
-
-@Injectable({providedIn: 'root'})
-export class CountryService {
- private _loading$ = new BehaviorSubject(true);
- private _search$ = new Subject();
- private _countries$ = new BehaviorSubject([]);
- private _total$ = new BehaviorSubject(0);
-
- private _state: State = {
- page: 1,
- pageSize: 4,
- searchTerm: '',
- sortColumn: '',
- sortDirection: ''
- };
-
- constructor(private pipe: DecimalPipe) {
- this._search$.pipe(
- tap(() => this._loading$.next(true)),
- debounceTime(200),
- switchMap(() => this._search()),
- delay(200),
- tap(() => this._loading$.next(false))
- ).subscribe(result => {
- this._countries$.next(result.countries);
- this._total$.next(result.total);
- });
-
- this._search$.next();
- }
-
- get countries$() { return this._countries$.asObservable(); }
- get total$() { return this._total$.asObservable(); }
- get loading$() { return this._loading$.asObservable(); }
- get page() { return this._state.page; }
- get pageSize() { return this._state.pageSize; }
- get searchTerm() { return this._state.searchTerm; }
-
- set page(page: number) { this._set({page}); }
- set pageSize(pageSize: number) { this._set({pageSize}); }
- set searchTerm(searchTerm: string) { this._set({searchTerm}); }
- set sortColumn(sortColumn: string) { this._set({sortColumn}); }
- set sortDirection(sortDirection: SortDirection) { this._set({sortDirection}); }
-
- private _set(patch: Partial) {
- Object.assign(this._state, patch);
- this._search$.next();
- }
-
- private _search(): Observable {
- const {sortColumn, sortDirection, pageSize, page, searchTerm} = this._state;
-
- // 1. sort
- let countries = sort(COUNTRIES, sortColumn, sortDirection);
-
- // 2. filter
- countries = countries.filter(country => matches(country, searchTerm, this.pipe));
- const total = countries.length;
-
- // 3. paginate
- countries = countries.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize);
- return of({countries, total});
- }
-}
diff --git a/backup/demo/src/app/components/table/demos/complete/country.ts b/backup/demo/src/app/components/table/demos/complete/country.ts
deleted file mode 100644
index da1820b..0000000
--- a/backup/demo/src/app/components/table/demos/complete/country.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export interface Country {
- id: number;
- name: string;
- flag: string;
- area: number;
- population: number;
-}
diff --git a/backup/demo/src/app/components/table/demos/complete/sortable.directive.ts b/backup/demo/src/app/components/table/demos/complete/sortable.directive.ts
deleted file mode 100644
index d8f11d1..0000000
--- a/backup/demo/src/app/components/table/demos/complete/sortable.directive.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import {Directive, EventEmitter, Input, Output} from '@angular/core';
-
-export type SortDirection = 'asc' | 'desc' | '';
-const rotate: {[key: string]: SortDirection} = { 'asc': 'desc', 'desc': '', '': 'asc' };
-
-export interface SortEvent {
- column: string;
- direction: SortDirection;
-}
-
-@Directive({
- selector: 'th[sortable]',
- host: {
- '[class.asc]': 'direction === "asc"',
- '[class.desc]': 'direction === "desc"',
- '(click)': 'rotate()'
- }
-})
-export class NgbdSortableHeader {
-
- @Input() sortable: string;
- @Input() direction: SortDirection = '';
- @Output() sort = new EventEmitter();
-
- rotate() {
- this.direction = rotate[this.direction];
- this.sort.emit({column: this.sortable, direction: this.direction});
- }
-}
diff --git a/backup/demo/src/app/components/table/demos/complete/table-complete.html b/backup/demo/src/app/components/table/demos/complete/table-complete.html
deleted file mode 100644
index 9413bb1..0000000
--- a/backup/demo/src/app/components/table/demos/complete/table-complete.html
+++ /dev/null
@@ -1,50 +0,0 @@
-This is a more complete example with a service that simulates server calling:
-
-
- an observable async service to fetch a list of countries
- sorting, filtering and pagination
- simulated delay and loading indicator
- debouncing of search requests
-
-
-
diff --git a/backup/demo/src/app/components/table/demos/complete/table-complete.module.ts b/backup/demo/src/app/components/table/demos/complete/table-complete.module.ts
deleted file mode 100644
index 033d34c..0000000
--- a/backup/demo/src/app/components/table/demos/complete/table-complete.module.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdSortableHeader } from './sortable.directive';
-import { NgbdTableComplete } from './table-complete';
-
-@NgModule({
- imports: [
- BrowserModule,
- CommonModule,
- FormsModule,
- ReactiveFormsModule,
- NgbModule
- ],
- declarations: [NgbdTableComplete, NgbdSortableHeader],
- exports: [NgbdTableComplete],
- bootstrap: [NgbdTableComplete]
-})
-export class NgbdTableCompleteModule {}
diff --git a/backup/demo/src/app/components/table/demos/complete/table-complete.ts b/backup/demo/src/app/components/table/demos/complete/table-complete.ts
deleted file mode 100644
index 9f5cc55..0000000
--- a/backup/demo/src/app/components/table/demos/complete/table-complete.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {DecimalPipe} from '@angular/common';
-import {Component, QueryList, ViewChildren} from '@angular/core';
-import {Observable} from 'rxjs';
-
-import {Country} from './country';
-import {CountryService} from './country.service';
-import {NgbdSortableHeader, SortEvent} from './sortable.directive';
-
-
-@Component(
- {selector: 'ngbd-table-complete', templateUrl: './table-complete.html', providers: [CountryService, DecimalPipe]})
-export class NgbdTableComplete {
- countries$: Observable;
- total$: Observable;
-
- @ViewChildren(NgbdSortableHeader) headers: QueryList;
-
- constructor(public service: CountryService) {
- this.countries$ = service.countries$;
- this.total$ = service.total$;
- }
-
- onSort({column, direction}: SortEvent) {
- // resetting other headers
- this.headers.forEach(header => {
- if (header.sortable !== column) {
- header.direction = '';
- }
- });
-
- this.service.sortColumn = column;
- this.service.sortDirection = direction;
- }
-}
diff --git a/backup/demo/src/app/components/table/demos/filtering/table-filtering.html b/backup/demo/src/app/components/table/demos/filtering/table-filtering.html
deleted file mode 100644
index 2d8ed2d..0000000
--- a/backup/demo/src/app/components/table/demos/filtering/table-filtering.html
+++ /dev/null
@@ -1,29 +0,0 @@
-You can do filter table data, in this case with observables and our NgbHighlight
component used in Typeahead
-
-
-
-
-
-
- #
- Country
- Area
- Population
-
-
-
-
- {{ i + 1 }}
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/components/table/demos/filtering/table-filtering.module.ts b/backup/demo/src/app/components/table/demos/filtering/table-filtering.module.ts
deleted file mode 100644
index d31acad..0000000
--- a/backup/demo/src/app/components/table/demos/filtering/table-filtering.module.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTableFiltering } from './table-filtering';
-
-@NgModule({
- imports: [
- BrowserModule,
- CommonModule,
- FormsModule,
- ReactiveFormsModule,
- NgbModule
- ],
- declarations: [NgbdTableFiltering],
- exports: [NgbdTableFiltering],
- bootstrap: [NgbdTableFiltering]
-})
-export class NgbdTableFilteringModule {}
diff --git a/backup/demo/src/app/components/table/demos/filtering/table-filtering.ts b/backup/demo/src/app/components/table/demos/filtering/table-filtering.ts
deleted file mode 100644
index 6bb32e5..0000000
--- a/backup/demo/src/app/components/table/demos/filtering/table-filtering.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Component, PipeTransform } from '@angular/core';
-import { DecimalPipe } from '@angular/common';
-import { FormControl } from '@angular/forms';
-
-import { Observable } from 'rxjs';
-import { map, startWith } from 'rxjs/operators';
-
-interface Country {
- name: string;
- flag: string;
- area: number;
- population: number;
-}
-
-const COUNTRIES: Country[] = [
- {
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- },
- {
- name: 'China',
- flag: 'f/fa/Flag_of_the_People%27s_Republic_of_China.svg',
- area: 9596960,
- population: 1409517397
- }
-];
-
-function search(text: string, pipe: PipeTransform): Country[] {
- return COUNTRIES.filter(country => {
- const term = text.toLowerCase();
- return country.name.toLowerCase().includes(term)
- || pipe.transform(country.area).includes(term)
- || pipe.transform(country.population).includes(term);
- });
-}
-
-@Component({
- selector: 'ngbd-table-filtering',
- templateUrl: './table-filtering.html',
- providers: [DecimalPipe]
-})
-export class NgbdTableFiltering {
-
- countries$: Observable;
- filter = new FormControl('');
-
- constructor(pipe: DecimalPipe) {
- this.countries$ = this.filter.valueChanges.pipe(
- startWith(''),
- map(text => search(text, pipe))
- );
- }
-}
diff --git a/backup/demo/src/app/components/table/demos/pagination/table-pagination.html b/backup/demo/src/app/components/table/demos/pagination/table-pagination.html
deleted file mode 100644
index 7423244..0000000
--- a/backup/demo/src/app/components/table/demos/pagination/table-pagination.html
+++ /dev/null
@@ -1,34 +0,0 @@
-You can bind our NgbPagination
component with slicing the data list
-
-
-
-
- #
- Country
- Area
- Population
-
-
-
-
- {{ country.id }}
-
-
- {{ country.name }}
-
- {{ country.area | number}}
- {{ country.population | number }}
-
-
-
-
-
-
-
-
-
- 2 items per page
- 4 items per page
- 6 items per page
-
-
diff --git a/backup/demo/src/app/components/table/demos/pagination/table-pagination.module.ts b/backup/demo/src/app/components/table/demos/pagination/table-pagination.module.ts
deleted file mode 100644
index 5a326d0..0000000
--- a/backup/demo/src/app/components/table/demos/pagination/table-pagination.module.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTablePagination } from './table-pagination';
-
-@NgModule({
- imports: [BrowserModule, CommonModule, FormsModule, NgbModule],
- declarations: [NgbdTablePagination],
- exports: [NgbdTablePagination],
- bootstrap: [NgbdTablePagination]
-})
-export class NgbdTablePaginationModule {}
diff --git a/backup/demo/src/app/components/table/demos/pagination/table-pagination.ts b/backup/demo/src/app/components/table/demos/pagination/table-pagination.ts
deleted file mode 100644
index 1f553cf..0000000
--- a/backup/demo/src/app/components/table/demos/pagination/table-pagination.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import { Component } from '@angular/core';
-
-interface Country {
- id?: number;
- name: string;
- flag: string;
- area: number;
- population: number;
-}
-
-const COUNTRIES: Country[] = [
- {
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- name: 'France',
- flag: 'c/c3/Flag_of_France.svg',
- area: 640679,
- population: 64979548
- },
- {
- name: 'Germany',
- flag: 'b/ba/Flag_of_Germany.svg',
- area: 357114,
- population: 82114224
- },
- {
- name: 'Portugal',
- flag: '5/5c/Flag_of_Portugal.svg',
- area: 92090,
- population: 10329506
- },
- {
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- name: 'Vietnam',
- flag: '2/21/Flag_of_Vietnam.svg',
- area: 331212,
- population: 95540800
- },
- {
- name: 'Brazil',
- flag: '0/05/Flag_of_Brazil.svg',
- area: 8515767,
- population: 209288278
- },
- {
- name: 'Mexico',
- flag: 'f/fc/Flag_of_Mexico.svg',
- area: 1964375,
- population: 129163276
- },
- {
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- },
- {
- name: 'India',
- flag: '4/41/Flag_of_India.svg',
- area: 3287263,
- population: 1324171354
- },
- {
- name: 'Indonesia',
- flag: '9/9f/Flag_of_Indonesia.svg',
- area: 1910931,
- population: 263991379
- },
- {
- name: 'Tuvalu',
- flag: '3/38/Flag_of_Tuvalu.svg',
- area: 26,
- population: 11097
- },
- {
- name: 'China',
- flag: 'f/fa/Flag_of_the_People%27s_Republic_of_China.svg',
- area: 9596960,
- population: 1409517397
- }
-];
-
-@Component({
- selector: 'ngbd-table-pagination',
- templateUrl: './table-pagination.html'
-})
-export class NgbdTablePagination {
-
- page = 1;
- pageSize = 4;
- collectionSize = COUNTRIES.length;
-
- get countries(): Country[] {
- return COUNTRIES
- .map((country, i) => ({id: i + 1, ...country}))
- .slice((this.page - 1) * this.pageSize, (this.page - 1) * this.pageSize + this.pageSize);
- }
-}
diff --git a/backup/demo/src/app/components/table/demos/sortable/table-sortable.html b/backup/demo/src/app/components/table/demos/sortable/table-sortable.html
deleted file mode 100644
index 18acb18..0000000
--- a/backup/demo/src/app/components/table/demos/sortable/table-sortable.html
+++ /dev/null
@@ -1,23 +0,0 @@
-You can introduce custom directives for table headers to sort columns
-
-
-
-
- #
- Country
- Area
- Population
-
-
-
-
- {{ country.id }}
-
-
- {{ country.name }}
-
- {{ country.area | number }}
- {{ country.population | number }}
-
-
-
diff --git a/backup/demo/src/app/components/table/demos/sortable/table-sortable.module.ts b/backup/demo/src/app/components/table/demos/sortable/table-sortable.module.ts
deleted file mode 100644
index 7590bbc..0000000
--- a/backup/demo/src/app/components/table/demos/sortable/table-sortable.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { CommonModule } from '@angular/common';
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdSortableHeader, NgbdTableSortable } from './table-sortable';
-
-@NgModule({
- imports: [BrowserModule, CommonModule, NgbModule],
- declarations: [NgbdTableSortable, NgbdSortableHeader],
- exports: [NgbdTableSortable],
- bootstrap: [NgbdTableSortable]
-})
-export class NgbdTableSortableModule {}
diff --git a/backup/demo/src/app/components/table/demos/sortable/table-sortable.ts b/backup/demo/src/app/components/table/demos/sortable/table-sortable.ts
deleted file mode 100644
index 1d232f6..0000000
--- a/backup/demo/src/app/components/table/demos/sortable/table-sortable.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-import { Component, Directive, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core';
-
-interface Country {
- id: number;
- name: string;
- flag: string;
- area: number;
- population: number;
-}
-
-const COUNTRIES: Country[] = [
- {
- id: 1,
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- id: 2,
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- id: 3,
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- },
- {
- id: 4,
- name: 'China',
- flag: 'f/fa/Flag_of_the_People%27s_Republic_of_China.svg',
- area: 9596960,
- population: 1409517397
- }
-];
-
-export type SortDirection = 'asc' | 'desc' | '';
-const rotate: {[key: string]: SortDirection} = { 'asc': 'desc', 'desc': '', '': 'asc' };
-export const compare = (v1, v2) => v1 < v2 ? -1 : v1 > v2 ? 1 : 0;
-
-export interface SortEvent {
- column: string;
- direction: SortDirection;
-}
-
-@Directive({
- selector: 'th[sortable]',
- host: {
- '[class.asc]': 'direction === "asc"',
- '[class.desc]': 'direction === "desc"',
- '(click)': 'rotate()'
- }
-})
-export class NgbdSortableHeader {
-
- @Input() sortable: string;
- @Input() direction: SortDirection = '';
- @Output() sort = new EventEmitter();
-
- rotate() {
- this.direction = rotate[this.direction];
- this.sort.emit({column: this.sortable, direction: this.direction});
- }
-}
-
-@Component({
- selector: 'ngbd-table-sortable',
- templateUrl: './table-sortable.html'
-})
-export class NgbdTableSortable {
-
- countries = COUNTRIES;
-
- @ViewChildren(NgbdSortableHeader) headers: QueryList;
-
- onSort({column, direction}: SortEvent) {
-
- // resetting other headers
- this.headers.forEach(header => {
- if (header.sortable !== column) {
- header.direction = '';
- }
- });
-
- // sorting countries
- if (direction === '') {
- this.countries = COUNTRIES;
- } else {
- this.countries = [...COUNTRIES].sort((a, b) => {
- const res = compare(a[column], b[column]);
- return direction === 'asc' ? res : -res;
- });
- }
- }
-
-}
diff --git a/backup/demo/src/app/components/table/overview/demo/table-overview-demo.component.ts b/backup/demo/src/app/components/table/overview/demo/table-overview-demo.component.ts
deleted file mode 100644
index 8746d24..0000000
--- a/backup/demo/src/app/components/table/overview/demo/table-overview-demo.component.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import { Component } from '@angular/core';
-
-interface Country {
- name: string;
- flag: string;
- area: number;
- population: number;
-}
-
-@Component({
- selector: 'ngbd-table-overview-demo',
- template: `
-
-
-
- #
- Country
- Area
- Population
-
-
-
-
- {{ i + 1 }}
-
-
- {{ country.name }}
-
- {{ country.area | number }}
- {{ country.population | number }}
-
-
-
- `
-})
-export class NgbdTableOverviewDemo {
-
- countries: Country[] = [
- {
- name: 'Russia',
- flag: 'f/f3/Flag_of_Russia.svg',
- area: 17075200,
- population: 146989754
- },
- {
- name: 'Canada',
- flag: 'c/cf/Flag_of_Canada.svg',
- area: 9976140,
- population: 36624199
- },
- {
- name: 'United States',
- flag: 'a/a4/Flag_of_the_United_States.svg',
- area: 9629091,
- population: 324459463
- }
- ];
-}
diff --git a/backup/demo/src/app/components/table/overview/table-overview.component.html b/backup/demo/src/app/components/table/overview/table-overview.component.html
deleted file mode 100644
index 97a46a8..0000000
--- a/backup/demo/src/app/components/table/overview/table-overview.component.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
- Bootstrap provides the some basic styling for the tables
- including CSS classes for responsiveness, striping odd/even rows, changing borders and captions, hovering rows, etc.
- These styles are opt-in and can be used with pure Angular to produce something like this:
-
-
-
-
-
-
-
- At the moment we do not have plans to provide a dedicated component like NgbTable
or NgbGrid
- as a part of ng-bootstrap project. As usual we're open to the productive discussion on GitHub.
-
-
-
-
- Most importantly, there are way too many different use cases and options for such a complex component.
- Instead of building a monster-of-a-widget with hundreds of options and customizations, we would
- encourage you to use composition and pure Angular. Most tables don't need all the features
- and if you want a spreadsheet-like functionality there are dedicated libraries available.
-
-
-
- Think about implementing the features you need and wrapping them into a component for your application.
- It might be simpler than it seems.
-
-
-
- If you decide to choose a library for tables, make sure that it plays nicely with Angular:
-
-
-
- doesn't trigger change detection excessively
- doesn't generate thousands of DOM nodes
- doesn't bloat your resulting bundle size by bringing 3rd party dependencies
- doesn't pretend to be an Angular library by wrapping something else
-
-
-
-
-
- Having said that, we decided to give you some simple examples of common table features.
- Take a look at them for the inspiration and maybe even use them as a starting point.
-
-
-
-
- Sorting -
- shows a sample NgbdSortableHeader
directive that you can stick on a <th>
- element to handle sorting
-
-
- Pagination -
- shows how to use a NgbPagination
component together with the table
-
-
- Search / filtering -
- full text search example over the table data
-
-
- Service example -
- a service that will handle sorting, pagination and filtering in an asynchronous manner.
- It is based on observables and simulates debouncing and a custom delay for the data fetch.
-
-
-
diff --git a/backup/demo/src/app/components/table/overview/table-overview.component.ts b/backup/demo/src/app/components/table/overview/table-overview.component.ts
deleted file mode 100644
index ed22f32..0000000
--- a/backup/demo/src/app/components/table/overview/table-overview.component.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-
-import { environment } from '../../../../environments/environment';
-
-import { NgbdDemoList } from '../../shared';
-import { NgbdOverview } from '../../shared/overview';
-
-@Component({
- selector: 'ngbd-table-overview',
- changeDetection: ChangeDetectionStrategy.OnPush,
- templateUrl: './table-overview.component.html',
- host: {
- '[class.overview]': 'true'
- }
-})
-export class NgbdTableOverviewComponent {
-
- bootstrapVersion = environment.bootstrap;
-
- sections: NgbdOverview = {};
-
- constructor(demoList: NgbdDemoList) {
- this.sections = demoList.getOverviewSections('table');
- }
-}
diff --git a/backup/demo/src/app/components/table/table.module.ts b/backup/demo/src/app/components/table/table.module.ts
deleted file mode 100644
index 2eabf9d..0000000
--- a/backup/demo/src/app/components/table/table.module.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdTableBasic } from './demos/basic/table-basic';
-import { NgbdTableBasicModule } from './demos/basic/table-basic.module';
-import { NgbdTableComplete } from './demos/complete/table-complete';
-import { NgbdTableCompleteModule } from './demos/complete/table-complete.module';
-import { NgbdTableFiltering } from './demos/filtering/table-filtering';
-import { NgbdTableFilteringModule } from './demos/filtering/table-filtering.module';
-import { NgbdTablePagination } from './demos/pagination/table-pagination';
-import { NgbdTablePaginationModule } from './demos/pagination/table-pagination.module';
-import { NgbdTableSortable } from './demos/sortable/table-sortable';
-import { NgbdTableSortableModule } from './demos/sortable/table-sortable.module';
-import { NgbdTableOverviewDemo } from './overview/demo/table-overview-demo.component';
-import { NgbdTableOverviewComponent } from './overview/table-overview.component';
-
-const OVERVIEW = {
- 'why-not': 'Why not?',
- examples: 'Code examples'
-};
-
-const DEMOS = {
- basic: {
- title: 'Basic table',
- type: NgbdTableBasic,
- files: [
- {
- name: 'table-basic.html',
- source: require('!!raw-loader!./demos/basic/table-basic.html')
- },
- {
- name: 'table-basic.ts',
- source: require('!!raw-loader!./demos/basic/table-basic')
- }
- ]
- },
- sortable: {
- title: 'Sortable table',
- type: NgbdTableSortable,
- files: [
- {
- name: 'table-sortable.html',
- source: require('!!raw-loader!./demos/sortable/table-sortable.html')
- },
- {
- name: 'table-sortable.ts',
- source: require('!!raw-loader!./demos/sortable/table-sortable')
- }
- ]
- },
- filtering: {
- title: 'Search and filtering',
- type: NgbdTableFiltering,
- files: [
- {
- name: 'table-filtering.html',
- source: require('!!raw-loader!./demos/filtering/table-filtering.html')
- },
- {
- name: 'table-filtering.ts',
- source: require('!!raw-loader!./demos/filtering/table-filtering')
- }
- ]
- },
- pagination: {
- title: 'Pagination',
- type: NgbdTablePagination,
- files: [
- {
- name: 'table-pagination.html',
- source: require('!!raw-loader!./demos/pagination/table-pagination.html')
- },
- {
- name: 'table-pagination.ts',
- source: require('!!raw-loader!./demos/pagination/table-pagination')
- }
- ]
- },
- complete: {
- title: 'Complete example',
- type: NgbdTableComplete,
- files: [
- {
- name: 'countries.ts',
- source: require('!!raw-loader!./demos/complete/countries')
- },
- {
- name: 'country.service.ts',
- source: require('!!raw-loader!./demos/complete/country.service')
- },
- {
- name: 'country.ts',
- source: require('!!raw-loader!./demos/complete/country')
- },
- {
- name: 'table-complete.html',
- source: require('!!raw-loader!./demos/complete/table-complete.html')
- },
- {
- name: 'table-complete.ts',
- source: require('!!raw-loader!./demos/complete/table-complete')
- },
- {
- name: 'sortable.directive.ts',
- source: require('!!raw-loader!./demos/complete/sortable.directive')
- }
- ]
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'overview' },
- {
- path: '',
- component: ComponentWrapper,
- data: { OVERVIEW },
- children: [
- { path: 'overview', component: NgbdTableOverviewComponent },
- { path: 'examples', component: NgbdExamplesPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdTableBasicModule,
- NgbdTableSortableModule,
- NgbdTableFilteringModule,
- NgbdTablePaginationModule,
- NgbdTableCompleteModule
- ],
- declarations: [NgbdTableOverviewComponent, NgbdTableOverviewDemo]
-})
-export class NgbdTableModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('table', DEMOS, OVERVIEW);
- }
-}
diff --git a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.html b/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.html
deleted file mode 100644
index 033545d..0000000
--- a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Fancy title
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
- Sed commodo, leo at suscipit dictum, quam est porttitor sapien, eget sodales nibh elit id diam. Nulla facilisi. Donec egestas ligula vitae odio interdum aliquet. Duis lectus turpis, luctus eget tincidunt eu, congue et odio. Duis pharetra et nisl at faucibus. Quisque luctus pulvinar arcu, et molestie lectus ultrices et. Sed diam urna, egestas ut ipsum vel, volutpat volutpat neque. Praesent fringilla tortor arcu. Vivamus faucibus nisl enim, nec tristique ipsum euismod facilisis. Morbi ut bibendum est, eu tincidunt odio. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris aliquet odio ac lorem aliquet ultricies in eget neque. Phasellus nec tortor vel tellus pulvinar feugiat.
-
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.module.ts b/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.module.ts
deleted file mode 100644
index c7d5dcb..0000000
--- a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetBasic } from './tabset-basic';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdTabsetBasic],
- exports: [NgbdTabsetBasic],
- bootstrap: [NgbdTabsetBasic]
-})
-export class NgbdTabsetBasicModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.ts b/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.ts
deleted file mode 100644
index e76b2ff..0000000
--- a/backup/demo/src/app/components/tabset/demos/basic/tabset-basic.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tabset-basic',
- templateUrl: './tabset-basic.html'
-})
-export class NgbdTabsetBasic { }
diff --git a/backup/demo/src/app/components/tabset/demos/config/tabset-config.html b/backup/demo/src/app/components/tabset/demos/config/tabset-config.html
deleted file mode 100644
index e9c53ce..0000000
--- a/backup/demo/src/app/components/tabset/demos/config/tabset-config.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- These tabs are displayed as pills...
-
-
-
-
- Because default values have been customized.
-
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/config/tabset-config.module.ts b/backup/demo/src/app/components/tabset/demos/config/tabset-config.module.ts
deleted file mode 100644
index 7f9f8b7..0000000
--- a/backup/demo/src/app/components/tabset/demos/config/tabset-config.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetConfig } from './tabset-config';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdTabsetConfig],
- exports: [NgbdTabsetConfig],
- bootstrap: [NgbdTabsetConfig]
-})
-export class NgbdTabsetConfigModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/config/tabset-config.ts b/backup/demo/src/app/components/tabset/demos/config/tabset-config.ts
deleted file mode 100644
index 7820fb5..0000000
--- a/backup/demo/src/app/components/tabset/demos/config/tabset-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTabsetConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-tabset-config',
- templateUrl: './tabset-config.html',
- providers: [NgbTabsetConfig] // add NgbTabsetConfig to the component providers
-})
-export class NgbdTabsetConfig {
- constructor(config: NgbTabsetConfig) {
- // customize default values of tabsets used by this component tree
- config.justify = 'center';
- config.type = 'pills';
- }
-}
diff --git a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.html b/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.html
deleted file mode 100644
index 782833e..0000000
--- a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.html
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Fancy title
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
- Sed commodo, leo at suscipit dictum, quam est porttitor sapien, eget sodales nibh elit id diam. Nulla facilisi. Donec egestas ligula vitae odio interdum aliquet. Duis lectus turpis, luctus eget tincidunt eu, congue et odio. Duis pharetra et nisl at faucibus. Quisque luctus pulvinar arcu, et molestie lectus ultrices et. Sed diam urna, egestas ut ipsum vel, volutpat volutpat neque. Praesent fringilla tortor arcu. Vivamus faucibus nisl enim, nec tristique ipsum euismod facilisis. Morbi ut bibendum est, eu tincidunt odio. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris aliquet odio ac lorem aliquet ultricies in eget neque. Phasellus nec tortor vel tellus pulvinar feugiat.
-
-
-
-
-
-
- Start
-
-
- Center
-
-
- End
-
-
- Fill
-
-
- Justified
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.module.ts b/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.module.ts
deleted file mode 100644
index 426e05e..0000000
--- a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetJustify } from './tabset-justify';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTabsetJustify],
- exports: [NgbdTabsetJustify],
- bootstrap: [NgbdTabsetJustify]
-})
-export class NgbdTabsetJustifyModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.ts b/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.ts
deleted file mode 100644
index 11150e5..0000000
--- a/backup/demo/src/app/components/tabset/demos/justify/tabset-justify.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tabset-justify',
- templateUrl: './tabset-justify.html'
-})
-export class NgbdTabsetJustify {
- currentJustify = 'start';
- }
diff --git a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.html b/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.html
deleted file mode 100644
index 3a87eb2..0000000
--- a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Fancy title
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
- Sed commodo, leo at suscipit dictum, quam est porttitor sapien, eget sodales nibh elit id diam. Nulla facilisi. Donec egestas ligula vitae odio interdum aliquet. Duis lectus turpis, luctus eget tincidunt eu, congue et odio. Duis pharetra et nisl at faucibus. Quisque luctus pulvinar arcu, et molestie lectus ultrices et. Sed diam urna, egestas ut ipsum vel, volutpat volutpat neque. Praesent fringilla tortor arcu. Vivamus faucibus nisl enim, nec tristique ipsum euismod facilisis. Morbi ut bibendum est, eu tincidunt odio. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris aliquet odio ac lorem aliquet ultricies in eget neque. Phasellus nec tortor vel tellus pulvinar feugiat.
-
-
-
-
-
-
- Horizontal
-
-
- Vertical
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.module.ts b/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.module.ts
deleted file mode 100644
index 5b078dd..0000000
--- a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetOrientation } from './tabset-orientation';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTabsetOrientation],
- exports: [NgbdTabsetOrientation],
- bootstrap: [NgbdTabsetOrientation]
-})
-export class NgbdTabsetOrientationModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.ts b/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.ts
deleted file mode 100644
index 37f131b..0000000
--- a/backup/demo/src/app/components/tabset/demos/orientation/tabset-orientation.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tabset-orientation',
- templateUrl: './tabset-orientation.html'
-})
-export class NgbdTabsetOrientation {
- currentOrientation = 'horizontal';
-}
diff --git a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.html b/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.html
deleted file mode 100644
index 44537f1..0000000
--- a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Fancy title
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
- Sed commodo, leo at suscipit dictum, quam est porttitor sapien, eget sodales nibh elit id diam. Nulla facilisi. Donec egestas ligula vitae odio interdum aliquet. Duis lectus turpis, luctus eget tincidunt eu, congue et odio. Duis pharetra et nisl at faucibus. Quisque luctus pulvinar arcu, et molestie lectus ultrices et. Sed diam urna, egestas ut ipsum vel, volutpat volutpat neque. Praesent fringilla tortor arcu. Vivamus faucibus nisl enim, nec tristique ipsum euismod facilisis. Morbi ut bibendum est, eu tincidunt odio. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris aliquet odio ac lorem aliquet ultricies in eget neque. Phasellus nec tortor vel tellus pulvinar feugiat.
-
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.module.ts b/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.module.ts
deleted file mode 100644
index dcc3ae8..0000000
--- a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetPills } from './tabset-pills';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdTabsetPills],
- exports: [NgbdTabsetPills],
- bootstrap: [NgbdTabsetPills]
-})
-export class NgbdTabsetPillsModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.ts b/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.ts
deleted file mode 100644
index 8ea4b03..0000000
--- a/backup/demo/src/app/components/tabset/demos/pills/tabset-pills.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tabset-pills',
- templateUrl: './tabset-pills.html'
-})
-export class NgbdTabsetPills { }
diff --git a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-prevent-change.module.ts b/backup/demo/src/app/components/tabset/demos/preventchange/tabset-prevent-change.module.ts
deleted file mode 100644
index 5be9607..0000000
--- a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-prevent-change.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetPreventchange } from './tabset-preventchange';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdTabsetPreventchange],
- exports: [NgbdTabsetPreventchange],
- bootstrap: [NgbdTabsetPreventchange]
-})
-export class NgbdTabsetPreventChangeModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.html b/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.html
deleted file mode 100644
index b20e28c..0000000
--- a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
- Sed commodo, leo at suscipit dictum, quam est porttitor sapien, eget sodales nibh elit id diam. Nulla facilisi. Donec egestas ligula vitae odio interdum aliquet. Duis lectus turpis, luctus eget tincidunt eu, congue et odio. Duis pharetra et nisl at faucibus. Quisque luctus pulvinar arcu, et molestie lectus ultrices et. Sed diam urna, egestas ut ipsum vel, volutpat volutpat neque. Praesent fringilla tortor arcu. Vivamus faucibus nisl enim, nec tristique ipsum euismod facilisis. Morbi ut bibendum est, eu tincidunt odio. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris aliquet odio ac lorem aliquet ultricies in eget neque. Phasellus nec tortor vel tellus pulvinar feugiat.
-
-
-
diff --git a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.ts b/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.ts
deleted file mode 100644
index f700599..0000000
--- a/backup/demo/src/app/components/tabset/demos/preventchange/tabset-preventchange.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-tabset-preventchange',
- templateUrl: './tabset-preventchange.html'
-})
-export class NgbdTabsetPreventchange {
- public beforeChange($event: NgbTabChangeEvent) {
- if ($event.nextId === 'tab-preventchange2') {
- $event.preventDefault();
- }
- }
-}
diff --git a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.html b/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.html
deleted file mode 100644
index 5b37821..0000000
--- a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
- master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
- dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
- iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.
-
-
-
- Fancy title
- Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
- Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
- craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
- cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
- yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
- shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
- sint qui sapiente accusamus tattooed echo park.
-
-
-
-
-
- Selected tab with "tab-selectbyid2" id
-
diff --git a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.module.ts b/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.module.ts
deleted file mode 100644
index 0ec4622..0000000
--- a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTabsetSelectbyid } from './tabset-selectbyid';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdTabsetSelectbyid],
- exports: [NgbdTabsetSelectbyid],
- bootstrap: [NgbdTabsetSelectbyid]
-})
-export class NgbdTabsetSelectbyidModule {}
diff --git a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.ts b/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.ts
deleted file mode 100644
index 0b1f1fa..0000000
--- a/backup/demo/src/app/components/tabset/demos/selectbyid/tabset-selectbyid.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tabset-selectbyid',
- templateUrl: './tabset-selectbyid.html'
-})
-export class NgbdTabsetSelectbyid {
-}
diff --git a/backup/demo/src/app/components/tabset/tabset.module.ts b/backup/demo/src/app/components/tabset/tabset.module.ts
deleted file mode 100644
index 4453f77..0000000
--- a/backup/demo/src/app/components/tabset/tabset.module.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdTabsetBasic } from './demos/basic/tabset-basic';
-import { NgbdTabsetBasicModule } from './demos/basic/tabset-basic.module';
-import { NgbdTabsetConfig } from './demos/config/tabset-config';
-import { NgbdTabsetConfigModule } from './demos/config/tabset-config.module';
-import { NgbdTabsetJustify } from './demos/justify/tabset-justify';
-import { NgbdTabsetJustifyModule } from './demos/justify/tabset-justify.module';
-import { NgbdTabsetOrientation } from './demos/orientation/tabset-orientation';
-import { NgbdTabsetOrientationModule } from './demos/orientation/tabset-orientation.module';
-import { NgbdTabsetPills } from './demos/pills/tabset-pills';
-import { NgbdTabsetPillsModule } from './demos/pills/tabset-pills.module';
-import { NgbdTabsetPreventChangeModule } from './demos/preventchange/tabset-prevent-change.module';
-import { NgbdTabsetPreventchange } from './demos/preventchange/tabset-preventchange';
-import { NgbdTabsetSelectbyid } from './demos/selectbyid/tabset-selectbyid';
-import { NgbdTabsetSelectbyidModule } from './demos/selectbyid/tabset-selectbyid.module';
-
-const DEMOS = {
- basic: {
- title: 'Tabset',
- type: NgbdTabsetBasic,
- code: require('!!raw-loader!./demos/basic/tabset-basic'),
- markup: require('!!raw-loader!./demos/basic/tabset-basic.html')
- },
- pills: {
- title: 'Pills',
- type: NgbdTabsetPills,
- code: require('!!raw-loader!./demos/pills/tabset-pills'),
- markup: require('!!raw-loader!./demos/pills/tabset-pills.html')
- },
- selectbyid: {
- title: 'Select an active tab by id',
- type: NgbdTabsetSelectbyid,
- code: require('!!raw-loader!./demos/selectbyid/tabset-selectbyid'),
- markup: require('!!raw-loader!./demos/selectbyid/tabset-selectbyid.html')
- },
- preventchange: {
- title: 'Prevent tab change',
- type: NgbdTabsetPreventchange,
- code: require('!!raw-loader!./demos/preventchange/tabset-preventchange'),
- markup: require('!!raw-loader!./demos/preventchange/tabset-preventchange.html')
- },
- justify: {
- title: 'Nav justification',
- type: NgbdTabsetJustify,
- code: require('!!raw-loader!./demos/justify/tabset-justify'),
- markup: require('!!raw-loader!./demos/justify/tabset-justify.html')
- },
- orientation: {
- title: 'Nav orientation',
- type: NgbdTabsetOrientation,
- code: require('!!raw-loader!./demos/orientation/tabset-orientation'),
- markup: require('!!raw-loader!./demos/orientation/tabset-orientation.html')
- },
- config: {
- title: 'Global configuration of tabs',
- type: NgbdTabsetConfig,
- code: require('!!raw-loader!./demos/config/tabset-config'),
- markup: require('!!raw-loader!./demos/config/tabset-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdTabsetBasicModule,
- NgbdTabsetPillsModule,
- NgbdTabsetPreventChangeModule,
- NgbdTabsetSelectbyidModule,
- NgbdTabsetConfigModule,
- NgbdTabsetJustifyModule,
- NgbdTabsetOrientationModule
- ]
-})
-export class NgbdTabsetModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('tabset', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.html b/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.html
deleted file mode 100644
index 894ce19..0000000
--- a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.html
+++ /dev/null
@@ -1,6 +0,0 @@
-This timepicker uses a custom Time adapter that lets you use your own model implementation.
- In this example we are converting from and to an ISO string (with the format HH:mm:ss
)
-
-
-
-Selected time: {{ time }}
diff --git a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.module.ts b/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.module.ts
deleted file mode 100644
index 9e17a25..0000000
--- a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerAdapter } from './timepicker-adapter';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerAdapter],
- exports: [NgbdTimepickerAdapter],
- bootstrap: [NgbdTimepickerAdapter]
-})
-export class NgbdTimepickerAdapterModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.ts b/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.ts
deleted file mode 100644
index 6455873..0000000
--- a/backup/demo/src/app/components/timepicker/demos/adapter/timepicker-adapter.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {NgbTimeStruct, NgbTimeAdapter} from '@ng-bootstrap/ng-bootstrap';
-
-/**
- * Example of a String Time adapter
- */
-@Injectable()
-export class NgbTimeStringAdapter extends NgbTimeAdapter {
-
- fromModel(value: string): NgbTimeStruct {
- if (!value) {
- return null;
- }
- const split = value.split(':');
- return {
- hour: parseInt(split[0], 10),
- minute: parseInt(split[1], 10),
- second: parseInt(split[2], 10)
- };
- }
-
- toModel(time: NgbTimeStruct): string {
- if (!time) {
- return null;
- }
- return `${this.pad(time.hour)}:${this.pad(time.minute)}:${this.pad(time.second)}`;
- }
-
- private pad(i: number): string {
- return i < 10 ? `0${i}` : `${i}`;
- }
-}
-
-@Component({
- selector: 'ngbd-timepicker-adapter',
- templateUrl: './timepicker-adapter.html',
- // NOTE: For this example we are only providing current component, but probably
- // NOTE: you will want to provide your main App Module
- providers: [{provide: NgbTimeAdapter, useClass: NgbTimeStringAdapter}]
-})
-export class NgbdTimepickerAdapter {
- time: '13:30:00';
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.html b/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.html
deleted file mode 100644
index a84d6cd..0000000
--- a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-Selected time: {{time | json}}
diff --git a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.module.ts b/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.module.ts
deleted file mode 100644
index 38eadea..0000000
--- a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerBasic } from './timepicker-basic';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerBasic],
- exports: [NgbdTimepickerBasic],
- bootstrap: [NgbdTimepickerBasic]
-})
-export class NgbdTimepickerBasicModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.ts b/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.ts
deleted file mode 100644
index ae5ab41..0000000
--- a/backup/demo/src/app/components/timepicker/demos/basic/timepicker-basic.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-timepicker-basic',
- templateUrl: './timepicker-basic.html'
-})
-export class NgbdTimepickerBasic {
- time = {hour: 13, minute: 30};
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.html b/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.html
deleted file mode 100644
index 120036a..0000000
--- a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.html
+++ /dev/null
@@ -1,3 +0,0 @@
-This timepicker uses customized default values.
-
-
diff --git a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.module.ts b/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.module.ts
deleted file mode 100644
index f1a8539..0000000
--- a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerConfig } from './timepicker-config';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerConfig],
- exports: [NgbdTimepickerConfig],
- bootstrap: [NgbdTimepickerConfig]
-})
-export class NgbdTimepickerConfigModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.ts b/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.ts
deleted file mode 100644
index 65d8fbd..0000000
--- a/backup/demo/src/app/components/timepicker/demos/config/timepicker-config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTimepickerConfig} from '@ng-bootstrap/ng-bootstrap';
-import {NgbTimeStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-timepicker-config',
- templateUrl: './timepicker-config.html',
- providers: [NgbTimepickerConfig] // add NgbTimepickerConfig to the component providers
-})
-export class NgbdTimepickerConfig {
- time: NgbTimeStruct = {hour: 13, minute: 30, second: 0};
-
- constructor(config: NgbTimepickerConfig) {
- // customize default values of ratings used by this component tree
- config.seconds = true;
- config.spinners = false;
- }
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.html b/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.html
deleted file mode 100644
index e261d0e..0000000
--- a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
- If you configure the locale and register the locale data as explained in the
- i18n guide , the time picker will honor
- the locale and use the day periods ("AM" and "PM") from the locale data. You can however
- provide a custom service, as demonstrated in this example, to customize the
- days and months names the way you want to.
-
-
-Timepicker in Greek
-
-
diff --git a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.module.ts b/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.module.ts
deleted file mode 100644
index 2557895..0000000
--- a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.module.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {NgModule} from '@angular/core';
-import {FormsModule} from '@angular/forms';
-import {BrowserModule} from '@angular/platform-browser';
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-
-import {NgbdTimepickerI18n} from './timepicker-i18n';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerI18n],
- exports: [NgbdTimepickerI18n],
- bootstrap: [NgbdTimepickerI18n]
-})
-export class NgbdTimepickerI18nModule {
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.ts b/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.ts
deleted file mode 100644
index fa6d5aa..0000000
--- a/backup/demo/src/app/components/timepicker/demos/i18n/timepicker-i18n.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {NgbTimepickerI18n} from '@ng-bootstrap/ng-bootstrap';
-
-const I18N_VALUES = {
- 'el': {periods: ['πμ', 'μμ']}
- // other languages you would support
-};
-
-// Define a service holding the language. You probably already have one if your app is i18ned. Or you could also
-// use the Angular LOCALE_ID value
-@Injectable()
-export class I18n {
- language = 'el';
-}
-
-// Define custom service providing the "AM" and "PM" translations.
-@Injectable()
-export class CustomTimepickerI18n extends NgbTimepickerI18n {
- constructor(private _i18n: I18n) { super(); }
-
- getMorningPeriod(): string { return I18N_VALUES[this._i18n.language].periods[0]; }
-
- getAfternoonPeriod(): string { return I18N_VALUES[this._i18n.language].periods[1]; }
-}
-
-@Component({
- selector: 'ngbd-timepicker-i18n',
- templateUrl: './timepicker-i18n.html',
- providers:
- [I18n, {provide: NgbTimepickerI18n, useClass: CustomTimepickerI18n}] // define custom NgbTimepickerI18n provider
-})
-export class NgbdTimepickerI18n {
- model = {hour: 13, minute: 30};
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.html b/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.html
deleted file mode 100644
index cf874b7..0000000
--- a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- Meridian - {{meridian ? "ON" : "OFF"}}
-
-
-Selected time: {{time | json}}
diff --git a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.module.ts b/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.module.ts
deleted file mode 100644
index c0cc7f2..0000000
--- a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerMeridian } from './timepicker-meridian';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerMeridian],
- exports: [NgbdTimepickerMeridian],
- bootstrap: [NgbdTimepickerMeridian]
-})
-export class NgbdTimepickerMeridianModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.ts b/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.ts
deleted file mode 100644
index 89330ca..0000000
--- a/backup/demo/src/app/components/timepicker/demos/meridian/timepicker-meridian.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-timepicker-meridian',
- templateUrl: './timepicker-meridian.html'
-})
-export class NgbdTimepickerMeridian {
- time = {hour: 13, minute: 30};
- meridian = true;
-
- toggleMeridian() {
- this.meridian = !this.meridian;
- }
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.html b/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.html
deleted file mode 100644
index 3b5ecb3..0000000
--- a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- Seconds - {{seconds ? "ON" : "OFF"}}
-
-
-Selected time: {{time | json}}
diff --git a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.module.ts b/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.module.ts
deleted file mode 100644
index 52f792c..0000000
--- a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerSeconds } from './timepicker-seconds';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerSeconds],
- exports: [NgbdTimepickerSeconds],
- bootstrap: [NgbdTimepickerSeconds]
-})
-export class NgbdTimepickerSecondsModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.ts b/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.ts
deleted file mode 100644
index c4c58b0..0000000
--- a/backup/demo/src/app/components/timepicker/demos/seconds/timepicker-seconds.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTimeStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-timepicker-seconds',
- templateUrl: './timepicker-seconds.html'
-})
-export class NgbdTimepickerSeconds {
- time: NgbTimeStruct = {hour: 13, minute: 30, second: 30};
- seconds = true;
-
- toggleSeconds() {
- this.seconds = !this.seconds;
- }
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.html b/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.html
deleted file mode 100644
index 2b02323..0000000
--- a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
- Spinners - {{spinners ? "ON" : "OFF"}}
-
diff --git a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.module.ts b/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.module.ts
deleted file mode 100644
index b3e1fea..0000000
--- a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerSpinners } from './timepicker-spinners';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerSpinners],
- exports: [NgbdTimepickerSpinners],
- bootstrap: [NgbdTimepickerSpinners]
-})
-export class NgbdTimepickerSpinnersModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.ts b/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.ts
deleted file mode 100644
index 658f1bc..0000000
--- a/backup/demo/src/app/components/timepicker/demos/spinners/timepicker-spinners.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-timepicker-spinners',
- templateUrl: './timepicker-spinners.html'
-})
-export class NgbdTimepickerSpinners {
- time = {hour: 13, minute: 30};
- spinners = true;
-
- toggleSpinners() {
- this.spinners = !this.spinners;
- }
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.html b/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.html
deleted file mode 100644
index d687767..0000000
--- a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-Selected time: {{time | json}}
diff --git a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.module.ts b/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.module.ts
deleted file mode 100644
index b25b1f8..0000000
--- a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerSteps } from './timepicker-steps';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTimepickerSteps],
- exports: [NgbdTimepickerSteps],
- bootstrap: [NgbdTimepickerSteps]
-})
-export class NgbdTimepickerStepsModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.ts b/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.ts
deleted file mode 100644
index 77bc31a..0000000
--- a/backup/demo/src/app/components/timepicker/demos/steps/timepicker-steps.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTimeStruct} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-timepicker-steps',
- templateUrl: './timepicker-steps.html'
-})
-export class NgbdTimepickerSteps {
- time: NgbTimeStruct = {hour: 13, minute: 30, second: 0};
- hourStep = 1;
- minuteStep = 15;
- secondStep = 30;
-}
diff --git a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.html b/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.html
deleted file mode 100644
index ac54ab0..0000000
--- a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.html
+++ /dev/null
@@ -1,14 +0,0 @@
-Illustrates custom validation, you have to select time between 12:00 and 13:59
-
-
-
-
-Selected time: {{ctrl.value | json}}
diff --git a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.module.ts b/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.module.ts
deleted file mode 100644
index 941e820..0000000
--- a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { ReactiveFormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTimepickerValidation } from './timepicker-validation';
-
-@NgModule({
- imports: [BrowserModule, ReactiveFormsModule, NgbModule],
- declarations: [NgbdTimepickerValidation],
- exports: [NgbdTimepickerValidation],
- bootstrap: [NgbdTimepickerValidation]
-})
-export class NgbdTimepickerValidationModule {}
diff --git a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.ts b/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.ts
deleted file mode 100644
index 77fb1cd..0000000
--- a/backup/demo/src/app/components/timepicker/demos/validation/timepicker-validation.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {Component} from '@angular/core';
-import {FormControl} from '@angular/forms';
-
-@Component({
- selector: 'ngbd-timepicker-validation',
- templateUrl: './timepicker-validation.html'
-})
-export class NgbdTimepickerValidation {
-
- ctrl = new FormControl('', (control: FormControl) => {
- const value = control.value;
-
- if (!value) {
- return null;
- }
-
- if (value.hour < 12) {
- return {tooEarly: true};
- }
- if (value.hour > 13) {
- return {tooLate: true};
- }
-
- return null;
- });
-}
diff --git a/backup/demo/src/app/components/timepicker/timepicker.module.ts b/backup/demo/src/app/components/timepicker/timepicker.module.ts
deleted file mode 100644
index f39b64e..0000000
--- a/backup/demo/src/app/components/timepicker/timepicker.module.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdTimepickerAdapter } from './demos/adapter/timepicker-adapter';
-import { NgbdTimepickerAdapterModule } from './demos/adapter/timepicker-adapter.module';
-import { NgbdTimepickerBasic } from './demos/basic/timepicker-basic';
-import { NgbdTimepickerBasicModule } from './demos/basic/timepicker-basic.module';
-import { NgbdTimepickerConfig } from './demos/config/timepicker-config';
-import { NgbdTimepickerConfigModule } from './demos/config/timepicker-config.module';
-import { NgbdTimepickerMeridian } from './demos/meridian/timepicker-meridian';
-import { NgbdTimepickerMeridianModule } from './demos/meridian/timepicker-meridian.module';
-import { NgbdTimepickerSeconds } from './demos/seconds/timepicker-seconds';
-import { NgbdTimepickerSecondsModule } from './demos/seconds/timepicker-seconds.module';
-import { NgbdTimepickerSpinners } from './demos/spinners/timepicker-spinners';
-import { NgbdTimepickerSpinnersModule } from './demos/spinners/timepicker-spinners.module';
-import { NgbdTimepickerSteps } from './demos/steps/timepicker-steps';
-import { NgbdTimepickerStepsModule } from './demos/steps/timepicker-steps.module';
-import { NgbdTimepickerValidation } from './demos/validation/timepicker-validation';
-import { NgbdTimepickerValidationModule } from './demos/validation/timepicker-validation.module';
-import { NgbdTimepickerI18n } from './demos/i18n/timepicker-i18n';
-import { NgbdTimepickerI18nModule } from './demos/i18n/timepicker-i18n.module';
-
-const DEMOS = {
- basic: {
- title: 'Timepicker',
- type: NgbdTimepickerBasic,
- code: require('!!raw-loader!./demos/basic/timepicker-basic'),
- markup: require('!!raw-loader!./demos/basic/timepicker-basic.html')
- },
- meridian: {
- title: 'Meridian',
- type: NgbdTimepickerMeridian,
- code: require('!!raw-loader!./demos/meridian/timepicker-meridian'),
- markup: require('!!raw-loader!./demos/meridian/timepicker-meridian.html')
- },
- seconds: {
- title: 'Seconds',
- type: NgbdTimepickerSeconds,
- code: require('!!raw-loader!./demos/seconds/timepicker-seconds'),
- markup: require('!!raw-loader!./demos/seconds/timepicker-seconds.html')
- },
- spinners: {
- title: 'Spinners',
- type: NgbdTimepickerSpinners,
- code: require('!!raw-loader!./demos/spinners/timepicker-spinners'),
- markup: require('!!raw-loader!./demos/spinners/timepicker-spinners.html')
- },
- steps: {
- title: 'Custom steps',
- type: NgbdTimepickerSteps,
- code: require('!!raw-loader!./demos/steps/timepicker-steps'),
- markup: require('!!raw-loader!./demos/steps/timepicker-steps.html')
- },
- validation: {
- title: 'Custom validation',
- type: NgbdTimepickerValidation,
- code: require('!!raw-loader!./demos/validation/timepicker-validation'),
- markup: require('!!raw-loader!./demos/validation/timepicker-validation.html')
- },
- adapter: {
- title: 'Custom time adapter',
- type: NgbdTimepickerAdapter,
- code: require('!!raw-loader!./demos/adapter/timepicker-adapter'),
- markup: require('!!raw-loader!./demos/adapter/timepicker-adapter.html')
- },
- i18n: {
- title: 'Internationalization of timepickers',
- type: NgbdTimepickerI18n,
- code: require('!!raw-loader!./demos/i18n/timepicker-i18n'),
- markup: require('!!raw-loader!./demos/i18n/timepicker-i18n.html')
- },
- config: {
- title: 'Global configuration of timepickers',
- type: NgbdTimepickerConfig,
- code: require('!!raw-loader!./demos/config/timepicker-config'),
- markup: require('!!raw-loader!./demos/config/timepicker-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdTimepickerBasicModule,
- NgbdTimepickerI18nModule,
- NgbdTimepickerMeridianModule,
- NgbdTimepickerSecondsModule,
- NgbdTimepickerSpinnersModule,
- NgbdTimepickerStepsModule,
- NgbdTimepickerValidationModule,
- NgbdTimepickerAdapterModule,
- NgbdTimepickerConfigModule
- ]
-})
-export class NgbdTimepickerModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('timepicker', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.html b/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.html
deleted file mode 100644
index 801e3ba..0000000
--- a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
- If you close me, I will automatically re-appear after a few seconds.
-
-I'll be back!
diff --git a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.module.ts b/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.module.ts
deleted file mode 100644
index f9990c9..0000000
--- a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.module.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import {NgModule} from '@angular/core';
-import {BrowserModule} from '@angular/platform-browser';
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-
-import {NgbdToastCloseable} from './toast-closeable';
-
-
-@NgModule({imports: [BrowserModule, NgbModule], declarations: [NgbdToastCloseable], bootstrap: [NgbdToastCloseable]})
-export class NgbdToastCloseableModule {
-}
diff --git a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.ts b/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.ts
deleted file mode 100644
index 6bf565e..0000000
--- a/backup/demo/src/app/components/toast/demos/closeable/toast-closeable.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({selector: 'ngbd-toast-closeable', templateUrl: './toast-closeable.html'})
-
-export class NgbdToastCloseable {
- show = true;
-
- close() {
- this.show = false;
- setTimeout(() => this.show = true, 5000);
- }
-}
diff --git a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.html b/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.html
deleted file mode 100644
index 9d8e8c0..0000000
--- a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
- Fancy header here
-
- Hello, I am toast. Have you noticed my header has been generated from a Template?
-
-Clicking on the close icon won't do anything in this example.
diff --git a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.module.ts b/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.module.ts
deleted file mode 100644
index 6745f63..0000000
--- a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdToastCustomHeader } from './toast-custom-header';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdToastCustomHeader],
- bootstrap: [NgbdToastCustomHeader]
-})
-export class NgbdToastCustomHeaderModule {}
diff --git a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.ts b/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.ts
deleted file mode 100644
index 5071038..0000000
--- a/backup/demo/src/app/components/toast/demos/custom-header/toast-custom-header.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({ selector: 'ngbd-toast-customheader', templateUrl: './toast-custom-header.html' })
-export class NgbdToastCustomHeader {}
diff --git a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.html b/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.html
deleted file mode 100644
index 238febb..0000000
--- a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.html
+++ /dev/null
@@ -1,11 +0,0 @@
-Please click one of the button to see a Toast being displayed in the top right corner of your screen:
-Standard toast
-Success toast
-
-
-
- Danger Danger !
-
-Danger toast
-
-
diff --git a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.ts b/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.ts
deleted file mode 100644
index 496a5dd..0000000
--- a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.component.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Component } from '@angular/core';
-
-import { ToastService } from './toast-service';
-
-@Component({ selector: 'ngbd-toast-global', templateUrl: './toast-global.component.html' })
-export class NgbdToastGlobal {
- constructor(public toastService: ToastService) {}
-
- showStandard() {
- this.toastService.show('I am a standard toast');
- }
-
- showSuccess() {
- this.toastService.show('I am a success toast', { classname: 'bg-success text-light', delay: 10000 });
- }
-
- showDanger(dangerTpl) {
- this.toastService.show(dangerTpl, { classname: 'bg-danger text-light', delay: 15000 });
- }
-}
diff --git a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.module.ts b/backup/demo/src/app/components/toast/demos/howto-global/toast-global.module.ts
deleted file mode 100644
index 050cebc..0000000
--- a/backup/demo/src/app/components/toast/demos/howto-global/toast-global.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdToastGlobal } from './toast-global.component';
-import { ToastsContainer } from './toasts-container.component';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdToastGlobal, ToastsContainer],
- bootstrap: [NgbdToastGlobal]
-})
-export class NgbdToastGlobalModule {}
diff --git a/backup/demo/src/app/components/toast/demos/howto-global/toast-service.ts b/backup/demo/src/app/components/toast/demos/howto-global/toast-service.ts
deleted file mode 100644
index 1bc7699..0000000
--- a/backup/demo/src/app/components/toast/demos/howto-global/toast-service.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Injectable, TemplateRef } from '@angular/core';
-
-@Injectable({ providedIn: 'root' })
-export class ToastService {
- toasts: any[] = [];
-
- show(textOrTpl: string | TemplateRef, options: any = {}) {
- this.toasts.push({ textOrTpl, ...options });
- }
-
- remove(toast) {
- this.toasts = this.toasts.filter(t => t !== toast);
- }
-}
diff --git a/backup/demo/src/app/components/toast/demos/howto-global/toasts-container.component.ts b/backup/demo/src/app/components/toast/demos/howto-global/toasts-container.component.ts
deleted file mode 100644
index b36d129..0000000
--- a/backup/demo/src/app/components/toast/demos/howto-global/toasts-container.component.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import {Component, TemplateRef} from '@angular/core';
-
-import {ToastService} from './toast-service';
-
-
-@Component({
- selector: 'app-toasts',
- template: `
-
-
-
-
-
- {{ toast.textOrTpl }}
-
- `,
- host: {'[class.ngb-toasts]': 'true'}
-})
-export class ToastsContainer {
- constructor(public toastService: ToastService) {}
-
- isTemplate(toast) { return toast.textOrTpl instanceof TemplateRef; }
-}
diff --git a/backup/demo/src/app/components/toast/demos/inline/toast-inline.html b/backup/demo/src/app/components/toast/demos/inline/toast-inline.html
deleted file mode 100644
index 3703964..0000000
--- a/backup/demo/src/app/components/toast/demos/inline/toast-inline.html
+++ /dev/null
@@ -1,10 +0,0 @@
-Body only
-
- I am a simple static toast.
-
-
-With a text header
-
- I am a simple static toast with a header.
-
-Clicking on the close icon won't do anything in this example.
diff --git a/backup/demo/src/app/components/toast/demos/inline/toast-inline.module.ts b/backup/demo/src/app/components/toast/demos/inline/toast-inline.module.ts
deleted file mode 100644
index 6ad3f34..0000000
--- a/backup/demo/src/app/components/toast/demos/inline/toast-inline.module.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdToastInline } from './toast-inline';
-
-@NgModule({ imports: [BrowserModule, NgbModule], declarations: [NgbdToastInline], bootstrap: [NgbdToastInline] })
-export class NgbdToastInlineModule {}
diff --git a/backup/demo/src/app/components/toast/demos/inline/toast-inline.ts b/backup/demo/src/app/components/toast/demos/inline/toast-inline.ts
deleted file mode 100644
index 8ca19d2..0000000
--- a/backup/demo/src/app/components/toast/demos/inline/toast-inline.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({ selector: 'ngbd-toast-inline', templateUrl: './toast-inline.html' })
-export class NgbdToastInline {}
diff --git a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.html b/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.html
deleted file mode 100644
index 9a10d76..0000000
--- a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
- In this demo, you can show a toast by clicking the button below. It will hide itself after a 5 seconds delay unless you simply hover it with your mouse.
-
-
- Click me to show a toast
-
-
-
-
- Try to mouse hover me.
-
-
- I will remain visible until you leave again.
-
-
diff --git a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.module.ts b/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.module.ts
deleted file mode 100644
index 6069b6b..0000000
--- a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {NgModule} from '@angular/core';
-import {BrowserModule} from '@angular/platform-browser';
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-
-import {NgbdToastPreventAutohide} from './toast-prevent-autohide';
-
-@NgModule({
- imports: [BrowserModule, NgbModule],
- declarations: [NgbdToastPreventAutohide],
- bootstrap: [NgbdToastPreventAutohide]
-})
-export class NgbdToastPreventAutohideModule {
-}
diff --git a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.ts b/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.ts
deleted file mode 100644
index c05a46f..0000000
--- a/backup/demo/src/app/components/toast/demos/prevent-autohide/toast-prevent-autohide.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({selector: 'ngbd-toast-prevent-autohide', templateUrl: './toast-prevent-autohide.html'})
-
-export class NgbdToastPreventAutohide {
- show = false;
- autohide = true;
-}
diff --git a/backup/demo/src/app/components/toast/overview/toast-overview.component.html b/backup/demo/src/app/components/toast/overview/toast-overview.component.html
deleted file mode 100644
index 5ae6e0b..0000000
--- a/backup/demo/src/app/components/toast/overview/toast-overview.component.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
- Toasts provide feedback messages as notifications to the user.
- Goal is to mimic the push notifications available both on mobile and desktop operating systems.
-
-
-
- NgbToast component allows you to only render the corresponding markup. Use it in one of your templates, and you are done. It will render a toast.
-
-
- Live example available here .
-
- Nonetheless, with this inline technique, you must handle the toast's lifecycle yourself, i.e. it won't disappear automagically or in other words we don't remove the markup, nor destroy the component.
-
- To make it disappear, you can listen to the (hide)
- output and remove/destroy/hide it yourself, and next section details how to do that in a real application environment.
-
-
-
-
-
- Let's take the opportunity to demonstrate how to simply build a global toast management service.
-
- TLDR;
- You don't feel reading these long explanations? Go to the live example here .
-
-
- In order to create our global toast system, 3 simple steps need to be done:
-
- Create a global AppToastService
to act as a global storage for toasts.
- Create a container component <app-toasts>
, acting as the host in the application to display your toasts.
- You could use <ngb-toast>
with an *ngFor
to read the list of toasts to display from the service.
- Finally, use this container component in your application.
-
-
- 1. Global toast service
-
- Relying on Angular dependency injection to share some piece of logic application-wide is always a good and solid starting choice.
-
-
- The service manages a collection of toasts. It also provides a public method to push a new toast to that same collection.
-
-
-
-
-
- You could also create an interface to type your toast instead of using any[]
here.
-
-
- Additionally, a method to remove an existing toast from the collection is also implemented.
-
-
-
- 2. Toast container component
-
- As stated previously, <ngb-toast>
only generates a valid Bootstrap toast markup.
- You'll still have to position them properly on the screen.
-
- Thus, as a suggestion, toasts could be rendered in the top right corner of the application, as a kind of overlay.
-
-
- To achieve that, you could create a dedicated container component/element to render all toasts in a convenient way.
- For example, this container could be positionned using CSS property position: static
.
-
-
-
-
-
-
-
-
-
We provide a dedicated ngb-toasts
CSS class you could use, or write your own styles in case some specificities would be needed.
-
-
-
-
-
-
-
-
- Lastly, let's use this container. Common sense would suggest to put it somewhere quite high in your hierarchy of components.
- Your root component would be a good candidate.
-
-
- You're done! Just inject and use your AppToastService
anywhere you want to create a new toast. <app-toasts>
will take care of displaying them.
-
-
-
-
-
-
- Note the accessibility attributes
aria-live="polite"
&
aria-atomic="true"
. They are
mandatory in order to be compliant with screen readers technology. More information available on
Bootstrap documentation .
-
-
-
-
- Click here to see an example a bit more advanced of this how-to.
-
-
diff --git a/backup/demo/src/app/components/toast/overview/toast-overview.component.ts b/backup/demo/src/app/components/toast/overview/toast-overview.component.ts
deleted file mode 100644
index 7dc9210..0000000
--- a/backup/demo/src/app/components/toast/overview/toast-overview.component.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-import {Component} from '@angular/core';
-
-import {Snippet} from '../../../shared/code/snippet';
-import {NgbdDemoList} from '../../shared';
-import {NgbdOverview} from '../../shared/overview';
-
-
-
-@Component({
- selector: 'ngbd-toast-overview',
- templateUrl: './toast-overview.component.html',
- host: {'[class.overview]': 'true'}
-})
-export class NgbdToastOverviewComponent {
- TOAST_INLINE_BASIC = Snippet({
- lang: 'html',
- code: `
-
- Content of the notification
- `
- });
-
- TOAST_INLINE_LIFECYCLE = Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
-
-
-
- `,
- });
-
- APP_TOAST_SERVICE = Snippet({
- lang: 'typescript',
- code: `
- @Injectable({ providedIn: 'root' })
- export class AppToastService {
- toasts: any[] = [];
-
- show(header: string, body: string) {
- this.toasts.push({ header, body });
- }
- }`,
- });
-
- APP_TOAST_SERVICE_REMOVE = Snippet({
- lang: 'typescript',
- code: `
- remove(toast) {
- this.toasts = this.toasts.filter(t => t != toast);
- }`,
- });
-
- APP_TOASTS_CONTAINER_TPL = Snippet({
- lang: 'html',
- code: `
- {{toast.body}} `,
- });
-
- APP_TOASTS_CONTAINER_STYLES = Snippet({
- lang: 'css',
- code: `
- :host {
- position: fixed;
- top: 0;
- right: 0;
- margin: 0.5em;
- z-index: 1200;
- }`,
- });
-
- APP_TOASTS_CONTAINER = Snippet({
- lang: 'typescript',
- code: `
- @Component({
- selector: 'app-toasts',
- template: ' ... ',
- styles: [' ... ']
- })
- export class AppToastsComponent {
- constructor(toastService: AppToastService) {}
- }`,
- });
-
- CONTAINER_USAGE = Snippet({
- lang: 'html',
- code: `
-
- `,
- });
-
- sections: NgbdOverview = {};
-
- constructor(demoList: NgbdDemoList) { this.sections = demoList.getOverviewSections('toast'); }
-}
diff --git a/backup/demo/src/app/components/toast/toast.module.ts b/backup/demo/src/app/components/toast/toast.module.ts
deleted file mode 100644
index 2ed4540..0000000
--- a/backup/demo/src/app/components/toast/toast.module.ts
+++ /dev/null
@@ -1,103 +0,0 @@
-import {NgModule} from '@angular/core';
-
-import {NgbdSharedModule} from '../../../app/shared';
-import {ComponentWrapper} from '../../shared/component-wrapper/component-wrapper.component';
-import {NgbdComponentsSharedModule, NgbdDemoList} from '../shared';
-import {NgbdApiPage} from '../shared/api-page/api.component';
-import {NgbdExamplesPage} from '../shared/examples-page/examples.component';
-import {NgbdToastCloseable} from './demos/closeable/toast-closeable';
-import {NgbdToastCloseableModule} from './demos/closeable/toast-closeable.module';
-import {NgbdToastCustomHeader} from './demos/custom-header/toast-custom-header';
-import {NgbdToastCustomHeaderModule} from './demos/custom-header/toast-custom-header.module';
-import {NgbdToastGlobal} from './demos/howto-global/toast-global.component';
-import {NgbdToastGlobalModule} from './demos/howto-global/toast-global.module';
-import {NgbdToastInline} from './demos/inline/toast-inline';
-import {NgbdToastInlineModule} from './demos/inline/toast-inline.module';
-import {NgbdToastPreventAutohide} from './demos/prevent-autohide/toast-prevent-autohide';
-import {NgbdToastPreventAutohideModule} from './demos/prevent-autohide/toast-prevent-autohide.module';
-import {NgbdToastOverviewComponent} from './overview/toast-overview.component';
-
-const OVERVIEW = {
- 'inline-usage': 'Declarative usage',
- 'toast-service': 'Building a toast management service'
-};
-
-const DEMOS = {
- inline: {
- title: 'Declarative inline usage',
- type: NgbdToastInline,
- code: require('!!raw-loader!./demos/inline/toast-inline'),
- markup: require('!!raw-loader!./demos/inline/toast-inline.html')
- },
- 'custom-header': {
- title: 'Using a Template as header',
- type: NgbdToastCustomHeader,
- files: [
- {
- name: 'toast-custom-header.html',
- source: require('!!raw-loader!./demos/custom-header/toast-custom-header.html')
- },
- {name: 'toast-custom-header.ts', source: require('!!raw-loader!./demos/custom-header/toast-custom-header')}
- ]
- },
- closeable: {
- title: 'Closeable toast',
- type: NgbdToastCloseable,
- files: [
- {name: 'toast-closeable.html', source: require('!!raw-loader!./demos/closeable/toast-closeable.html')},
- {name: 'toast-closeable.ts', source: require('!!raw-loader!./demos/closeable/toast-closeable.ts')}
- ]
- },
- 'prevent-autohide': {
- title: 'Prevent autohide on mouseover',
- type: NgbdToastPreventAutohide,
- files: [
- {
- name: 'toast-prevent-autohide.html',
- source: require('!!raw-loader!./demos/prevent-autohide/toast-prevent-autohide.html')
- },
- {
- name: 'toast-prevent-autohide.ts',
- source: require('!!raw-loader!./demos/prevent-autohide/toast-prevent-autohide.ts')
- }
- ]
- },
- global: {
- title: 'Toast management service',
- type: NgbdToastGlobal,
- files: [
- {name: 'toast-service.ts', source: require('!!raw-loader!./demos/howto-global/toast-service.ts')}, {
- name: 'toast-global.component.html',
- source: require('!!raw-loader!./demos/howto-global/toast-global.component.html')
- },
- {name: 'toast-global.component.ts', source: require('!!raw-loader!./demos/howto-global/toast-global.component')},
- {
- name: 'toasts-container.component.ts',
- source: require('!!raw-loader!./demos/howto-global/toasts-container.component')
- }
- ]
- }
-};
-
-export const ROUTES = [
- {path: '', pathMatch: 'full', redirectTo: 'overview'}, {
- path: '',
- component: ComponentWrapper,
- data: {OVERVIEW},
- children: [
- {path: 'overview', component: NgbdToastOverviewComponent}, {path: 'examples', component: NgbdExamplesPage},
- {path: 'api', component: NgbdApiPage}
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule, NgbdComponentsSharedModule, NgbdToastInlineModule, NgbdToastCloseableModule,
- NgbdToastCustomHeaderModule, NgbdToastPreventAutohideModule, NgbdToastGlobalModule
- ],
- declarations: [NgbdToastOverviewComponent]
-})
-export class NgbdToastModule {
- constructor(demoList: NgbdDemoList) { demoList.register('toast', DEMOS, OVERVIEW); }
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.html b/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.html
deleted file mode 100644
index d5163c3..0000000
--- a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.html
+++ /dev/null
@@ -1,41 +0,0 @@
-As for some other popup-based widgets, you can set the tooltip to close automatically upon some events.
-In the following examples, they will all close on Escape
as well as:
-
-
-
- click inside:
-
- Click to toggle
-
-
-
-
- click outside:
-
- Click to toggle
-
-
-
-
- all clicks:
-
- Click to toggle
-
-
-
-
-
- Click to toggle the external tooltip
-
-
-
diff --git a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.module.ts b/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.module.ts
deleted file mode 100644
index 915ac80..0000000
--- a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipAutoclose } from './tooltip-autoclose';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipAutoclose],
- exports: [NgbdTooltipAutoclose],
- bootstrap: [NgbdTooltipAutoclose]
-})
-export class NgbdTooltipAutocloseModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.ts b/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.ts
deleted file mode 100644
index d74600b..0000000
--- a/backup/demo/src/app/components/tooltip/demos/autoclose/tooltip-autoclose.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-
-
-@Component({
- selector: 'ngbd-tooltip-autoclose',
- templateUrl: './tooltip-autoclose.html'
-})
-export class NgbdTooltipAutoclose {}
diff --git a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.html b/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.html
deleted file mode 100644
index d9acf17..0000000
--- a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
- Tooltip on top
-
-
- Tooltip on right
-
-
- Tooltip on bottom
-
-
- Tooltip on left
-
diff --git a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.module.ts b/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.module.ts
deleted file mode 100644
index c82d0bc..0000000
--- a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipBasic } from './tooltip-basic';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipBasic],
- exports: [NgbdTooltipBasic],
- bootstrap: [NgbdTooltipBasic]
-})
-export class NgbdTooltipBasicModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.ts b/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.ts
deleted file mode 100644
index 7b63aae..0000000
--- a/backup/demo/src/app/components/tooltip/demos/basic/tooltip-basic.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-basic',
- templateUrl: './tooltip-basic.html'
-})
-export class NgbdTooltipBasic {
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.html b/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.html
deleted file mode 100644
index d35a925..0000000
--- a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Customized tooltip
-
diff --git a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.module.ts b/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.module.ts
deleted file mode 100644
index e265da8..0000000
--- a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipConfig } from './tooltip-config';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipConfig],
- exports: [NgbdTooltipConfig],
- bootstrap: [NgbdTooltipConfig]
-})
-export class NgbdTooltipConfigModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.ts b/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.ts
deleted file mode 100644
index b360fac..0000000
--- a/backup/demo/src/app/components/tooltip/demos/config/tooltip-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Component} from '@angular/core';
-import {NgbTooltipConfig} from '@ng-bootstrap/ng-bootstrap';
-
-@Component({
- selector: 'ngbd-tooltip-config',
- templateUrl: './tooltip-config.html',
- providers: [NgbTooltipConfig] // add NgbTooltipConfig to the component providers
-})
-export class NgbdTooltipConfig {
- constructor(config: NgbTooltipConfig) {
- // customize default values of tooltips used by this component tree
- config.placement = 'right';
- config.triggers = 'click';
- }
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.html b/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.html
deleted file mode 100644
index b772fe4..0000000
--- a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
- Set the container
property to "body" to have the tooltip be appended to the body instead of the triggering element's parent. This option is useful if the element triggering the tooltip is inside an element that clips its contents (i.e. overflow: hidden
).
-
-
-
-
-
- Default tooltip
-
-
- Tooltip appended to body
-
-
-
diff --git a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.module.ts b/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.module.ts
deleted file mode 100644
index 635671c..0000000
--- a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipContainer } from './tooltip-container';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipContainer],
- exports: [NgbdTooltipContainer],
- bootstrap: [NgbdTooltipContainer]
-})
-export class NgbdTooltipContainerModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.ts b/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.ts
deleted file mode 100644
index 37ddfd9..0000000
--- a/backup/demo/src/app/components/tooltip/demos/container/tooltip-container.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-container',
- templateUrl: './tooltip-container.html',
- styles: ['.card { overflow:hidden }']
-})
-export class NgbdTooltipContainer {
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-custom-class.module.ts b/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-custom-class.module.ts
deleted file mode 100644
index 04a4e50..0000000
--- a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-custom-class.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipCustomclass } from './tooltip-customclass';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipCustomclass],
- exports: [NgbdTooltipCustomclass],
- bootstrap: [NgbdTooltipCustomclass]
-})
-export class NgbdTooltipCustomClassModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.html b/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.html
deleted file mode 100644
index dd8de2e..0000000
--- a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
- You can optionally pass in a custom class via tooltipClass
-
-
-
- Tooltip with custom class
-
diff --git a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.ts b/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.ts
deleted file mode 100644
index 9e28986..0000000
--- a/backup/demo/src/app/components/tooltip/demos/customclass/tooltip-customclass.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import {Component, ViewEncapsulation} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-customclass',
- templateUrl: './tooltip-customclass.html',
- encapsulation: ViewEncapsulation.None,
- styles: [`
- .my-custom-class .tooltip-inner {
- background-color: darkgreen;
- font-size: 125%;
- }
- .my-custom-class .arrow::before {
- border-top-color: darkgreen;
- }
- `]
-})
-export class NgbdTooltipCustomclass {
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.html b/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.html
deleted file mode 100644
index d9bbf7b..0000000
--- a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
- When using non-manual triggers, you can control the delay to open and close the tooltip through the openDelay
and
- closeDelay
properties. Note that the autoClose
feature does not use the close delay, it closes the tooltip immediately.
-
-
-
- Hover 300ms here
-
-
- Hover 1s here
-
diff --git a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.module.ts b/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.module.ts
deleted file mode 100644
index 81c0201..0000000
--- a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipDelay } from './tooltip-delay';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipDelay],
- exports: [NgbdTooltipDelay],
- bootstrap: [NgbdTooltipDelay]
-})
-export class NgbdTooltipDelayModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.ts b/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.ts
deleted file mode 100644
index e4d8161..0000000
--- a/backup/demo/src/app/components/tooltip/demos/delay/tooltip-delay.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-delay',
- templateUrl: './tooltip-delay.html'
-})
-export class NgbdTooltipDelay {
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tpl-content.module.ts b/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tpl-content.module.ts
deleted file mode 100644
index 308b6ba..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tpl-content.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipTplcontent } from './tooltip-tplcontent';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipTplcontent],
- exports: [NgbdTooltipTplcontent],
- bootstrap: [NgbdTooltipTplcontent]
-})
-export class NgbdTooltipTplContentModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.html b/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.html
deleted file mode 100644
index d74943d..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
- Tooltips can contain any arbitrary HTML, Angular bindings and even directives!
- Simply enclose desired content in a <ng-template>
element.
-
-
-Hello, {{name}} !
-
- I've got markup and bindings in my tooltip!
-
diff --git a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.ts b/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.ts
deleted file mode 100644
index 89c5de1..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplcontent/tooltip-tplcontent.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-tplcontent',
- templateUrl: './tooltip-tplcontent.html'
-})
-export class NgbdTooltipTplcontent {
- name = 'World';
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tpl-with-context.module.ts b/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tpl-with-context.module.ts
deleted file mode 100644
index 3ec3aef..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tpl-with-context.module.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-import { NgbdTooltipTplwithcontext } from './tooltip-tplwithcontext';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipTplwithcontext],
- exports: [NgbdTooltipTplwithcontext],
- bootstrap: [NgbdTooltipTplwithcontext]
-})
-export class NgbdTooltipTplWithContextModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.html b/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.html
deleted file mode 100644
index 27b64d4..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
- You can optionally pass in a context when manually triggering a tooltip.
-
-
-{{greeting}}, {{name}} !
-
- French
-
-
- German
-
-
- English
-
diff --git a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.ts b/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.ts
deleted file mode 100644
index 2148807..0000000
--- a/backup/demo/src/app/components/tooltip/demos/tplwithcontext/tooltip-tplwithcontext.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-tplwithcontext',
- templateUrl: './tooltip-tplwithcontext.html'
-})
-export class NgbdTooltipTplwithcontext {
- name = 'World';
-
- toggleWithGreeting(tooltip, greeting: string) {
- if (tooltip.isOpen()) {
- tooltip.close();
- } else {
- tooltip.open({greeting});
- }
- }
-}
diff --git a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.html b/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.html
deleted file mode 100644
index 093870b..0000000
--- a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
- You can easily override open and close triggers by specifying event names (separated by :
) in the triggers
property.
-
-
-
- Click me!
-
-
-
-
- Alternatively you can take full manual control over tooltip opening / closing events.
-
-
-
- Click me to open a tooltip
-
-
- Click me to close a tooltip
-
diff --git a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.module.ts b/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.module.ts
deleted file mode 100644
index fa0593d..0000000
--- a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTooltipTriggers } from './tooltip-triggers';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTooltipTriggers],
- exports: [NgbdTooltipTriggers],
- bootstrap: [NgbdTooltipTriggers]
-})
-export class NgbdTooltipTriggersModule {}
diff --git a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.ts b/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.ts
deleted file mode 100644
index 2fe753d..0000000
--- a/backup/demo/src/app/components/tooltip/demos/triggers/tooltip-triggers.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {Component} from '@angular/core';
-
-@Component({
- selector: 'ngbd-tooltip-triggers',
- templateUrl: './tooltip-triggers.html'
-})
-export class NgbdTooltipTriggers {
-}
diff --git a/backup/demo/src/app/components/tooltip/tooltip.module.ts b/backup/demo/src/app/components/tooltip/tooltip.module.ts
deleted file mode 100644
index 229465c..0000000
--- a/backup/demo/src/app/components/tooltip/tooltip.module.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdTooltipAutoclose } from './demos/autoclose/tooltip-autoclose';
-import { NgbdTooltipAutocloseModule } from './demos/autoclose/tooltip-autoclose.module';
-import { NgbdTooltipBasic } from './demos/basic/tooltip-basic';
-import { NgbdTooltipBasicModule } from './demos/basic/tooltip-basic.module';
-import { NgbdTooltipConfig } from './demos/config/tooltip-config';
-import { NgbdTooltipConfigModule } from './demos/config/tooltip-config.module';
-import { NgbdTooltipContainer } from './demos/container/tooltip-container';
-import { NgbdTooltipContainerModule } from './demos/container/tooltip-container.module';
-import { NgbdTooltipCustomClassModule } from './demos/customclass/tooltip-custom-class.module';
-import { NgbdTooltipCustomclass } from './demos/customclass/tooltip-customclass';
-import { NgbdTooltipDelay } from './demos/delay/tooltip-delay';
-import { NgbdTooltipDelayModule } from './demos/delay/tooltip-delay.module';
-import { NgbdTooltipTplContentModule } from './demos/tplcontent/tooltip-tpl-content.module';
-import { NgbdTooltipTplcontent } from './demos/tplcontent/tooltip-tplcontent';
-import { NgbdTooltipTplWithContextModule } from './demos/tplwithcontext/tooltip-tpl-with-context.module';
-import { NgbdTooltipTplwithcontext } from './demos/tplwithcontext/tooltip-tplwithcontext';
-import { NgbdTooltipTriggers } from './demos/triggers/tooltip-triggers';
-import { NgbdTooltipTriggersModule } from './demos/triggers/tooltip-triggers.module';
-
-const DEMOS = {
- basic: {
- title: 'Quick and easy tooltips',
- type: NgbdTooltipBasic,
- code: require('!!raw-loader!./demos/basic/tooltip-basic'),
- markup: require('!!raw-loader!./demos/basic/tooltip-basic.html')
- },
- tplcontent: {
- title: 'HTML and bindings in tooltips',
- type: NgbdTooltipTplcontent,
- code: require('!!raw-loader!./demos/tplcontent/tooltip-tplcontent'),
- markup: require('!!raw-loader!./demos/tplcontent/tooltip-tplcontent.html')
- },
- triggers: {
- title: 'Custom and manual triggers',
- type: NgbdTooltipTriggers,
- code: require('!!raw-loader!./demos/triggers/tooltip-triggers'),
- markup: require('!!raw-loader!./demos/triggers/tooltip-triggers.html')
- },
- autoclose: {
- title: 'Automatic closing with keyboard and mouse',
- type: NgbdTooltipAutoclose,
- code: require('!!raw-loader!./demos/autoclose/tooltip-autoclose'),
- markup: require('!!raw-loader!./demos/autoclose/tooltip-autoclose.html')
- },
- tplwithcontext: {
- title: 'Context and manual triggers',
- type: NgbdTooltipTplwithcontext,
- code: require('!!raw-loader!./demos/tplwithcontext/tooltip-tplwithcontext'),
- markup: require('!!raw-loader!./demos/tplwithcontext/tooltip-tplwithcontext.html')
- },
- delay: {
- title: 'Open and close delays',
- type: NgbdTooltipDelay,
- code: require('!!raw-loader!./demos/delay/tooltip-delay'),
- markup: require('!!raw-loader!./demos/delay/tooltip-delay.html')
- },
- container: {
- title: 'Append tooltip in the body',
- type: NgbdTooltipContainer,
- code: require('!!raw-loader!./demos/container/tooltip-container'),
- markup: require('!!raw-loader!./demos/container/tooltip-container.html')
- },
- customclass: {
- title: 'Tooltip with custom class',
- type: NgbdTooltipCustomclass,
- code: require('!!raw-loader!./demos/customclass/tooltip-customclass'),
- markup: require('!!raw-loader!./demos/customclass/tooltip-customclass.html')
- },
- config: {
- title: 'Global configuration of tooltips',
- type: NgbdTooltipConfig,
- code: require('!!raw-loader!./demos/config/tooltip-config'),
- markup: require('!!raw-loader!./demos/config/tooltip-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdTooltipBasicModule,
- NgbdTooltipContainerModule,
- NgbdTooltipCustomClassModule,
- NgbdTooltipDelayModule,
- NgbdTooltipTplContentModule,
- NgbdTooltipTriggersModule,
- NgbdTooltipAutocloseModule,
- NgbdTooltipConfigModule,
- NgbdTooltipTplWithContextModule
- ]
-})
-export class NgbdTooltipModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('tooltip', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.html b/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.html
deleted file mode 100644
index e5f8c26..0000000
--- a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.html
+++ /dev/null
@@ -1,11 +0,0 @@
-A typeahead example that gets values from a static string[]
-
- debounceTime
operator
- kicks in only if 2+ characters typed
- limits to 10 results
-
-
-Search for a state:
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.module.ts b/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.module.ts
deleted file mode 100644
index e54782f..0000000
--- a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadBasic } from './typeahead-basic';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTypeaheadBasic],
- exports: [NgbdTypeaheadBasic],
- bootstrap: [NgbdTypeaheadBasic]
-})
-export class NgbdTypeaheadBasicModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.ts b/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.ts
deleted file mode 100644
index 63975a9..0000000
--- a/backup/demo/src/app/components/typeahead/demos/basic/typeahead-basic.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import {Component} from '@angular/core';
-import {Observable} from 'rxjs';
-import {debounceTime, distinctUntilChanged, map} from 'rxjs/operators';
-
-const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado',
- 'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia',
- 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine',
- 'Marshall Islands', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana',
- 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
- 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Palau', 'Pennsylvania', 'Puerto Rico', 'Rhode Island',
- 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia',
- 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'];
-
-@Component({
- selector: 'ngbd-typeahead-basic',
- templateUrl: './typeahead-basic.html',
- styles: [`.form-control { width: 300px; }`]
-})
-export class NgbdTypeaheadBasic {
- public model: any;
-
- search = (text$: Observable) =>
- text$.pipe(
- debounceTime(200),
- distinctUntilChanged(),
- map(term => term.length < 2 ? []
- : states.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10))
- )
-
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.html b/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.html
deleted file mode 100644
index f3ce33f..0000000
--- a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.html
+++ /dev/null
@@ -1,5 +0,0 @@
-This typeahead shows a hint when the input matches because the default values have been customized.
-
-Search for a state:
-
-
diff --git a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.module.ts b/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.module.ts
deleted file mode 100644
index afee426..0000000
--- a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadConfig } from './typeahead-config';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTypeaheadConfig],
- exports: [NgbdTypeaheadConfig],
- bootstrap: [NgbdTypeaheadConfig]
-})
-export class NgbdTypeaheadConfigModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.ts b/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.ts
deleted file mode 100644
index 5165b6c..0000000
--- a/backup/demo/src/app/components/typeahead/demos/config/typeahead-config.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-import {Component} from '@angular/core';
-import {Observable} from 'rxjs';
-import {NgbTypeaheadConfig} from '@ng-bootstrap/ng-bootstrap';
-import {debounceTime, distinctUntilChanged, map} from 'rxjs/operators';
-
-const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado',
- 'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia',
- 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine',
- 'Marshall Islands', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana',
- 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
- 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Palau', 'Pennsylvania', 'Puerto Rico', 'Rhode Island',
- 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia',
- 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'];
-
-@Component({
- selector: 'ngbd-typeahead-config',
- templateUrl: './typeahead-config.html',
- styles: [`.form-control { width: 300px; }`],
- providers: [NgbTypeaheadConfig] // add NgbTypeaheadConfig to the component providers
-})
-export class NgbdTypeaheadConfig {
- public model: any;
-
- constructor(config: NgbTypeaheadConfig) {
- // customize default values of typeaheads used by this component tree
- config.showHint = true;
- }
-
- search = (text$: Observable) =>
- text$.pipe(
- debounceTime(200),
- distinctUntilChanged(),
- map(term => term.length < 2 ? []
- : states.filter(v => v.toLowerCase().startsWith(term.toLocaleLowerCase())).splice(0, 10))
- )
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.html b/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.html
deleted file mode 100644
index ba3b7b0..0000000
--- a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.html
+++ /dev/null
@@ -1,23 +0,0 @@
-It is possible to get the focus events with the current input value to emit results on focus with a great flexibility.
-
-In this simple example, a search is done no matter the content of the input:
-
-
- on empty input all options will be taken
- otherwise options will be filtered against the search term
- it will limit the display to 10 results in all cases
-
-
-Search for a state:
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.module.ts b/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.module.ts
deleted file mode 100644
index 147d260..0000000
--- a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadFocus } from './typeahead-focus';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTypeaheadFocus],
- exports: [NgbdTypeaheadFocus],
- bootstrap: [NgbdTypeaheadFocus]
-})
-export class NgbdTypeaheadFocusModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.ts b/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.ts
deleted file mode 100644
index 2b2979b..0000000
--- a/backup/demo/src/app/components/typeahead/demos/focus/typeahead-focus.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import {Component, ViewChild} from '@angular/core';
-import {NgbTypeahead} from '@ng-bootstrap/ng-bootstrap';
-import {Observable, Subject, merge} from 'rxjs';
-import {debounceTime, distinctUntilChanged, filter, map} from 'rxjs/operators';
-
-const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado',
- 'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia',
- 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine',
- 'Marshall Islands', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana',
- 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
- 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Palau', 'Pennsylvania', 'Puerto Rico', 'Rhode Island',
- 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia',
- 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'];
-
-@Component({
- selector: 'ngbd-typeahead-focus',
- templateUrl: './typeahead-focus.html',
- styles: [`.form-control { width: 300px; }`]
-})
-export class NgbdTypeaheadFocus {
- model: any;
-
- @ViewChild('instance', {static: true}) instance: NgbTypeahead;
- focus$ = new Subject();
- click$ = new Subject();
-
- search = (text$: Observable) => {
- const debouncedText$ = text$.pipe(debounceTime(200), distinctUntilChanged());
- const clicksWithClosedPopup$ = this.click$.pipe(filter(() => !this.instance.isPopupOpen()));
- const inputFocus$ = this.focus$;
-
- return merge(debouncedText$, inputFocus$, clicksWithClosedPopup$).pipe(
- map(term => (term === '' ? states
- : states.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1)).slice(0, 10))
- );
- }
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.html b/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.html
deleted file mode 100644
index 0c3f60d..0000000
--- a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.html
+++ /dev/null
@@ -1,6 +0,0 @@
-A typeahead example that uses a formatter function for string results
-
-Search for a state:
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.module.ts b/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.module.ts
deleted file mode 100644
index 320d6c8..0000000
--- a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadFormat } from './typeahead-format';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTypeaheadFormat],
- exports: [NgbdTypeaheadFormat],
- bootstrap: [NgbdTypeaheadFormat]
-})
-export class NgbdTypeaheadFormatModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.ts b/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.ts
deleted file mode 100644
index 5b68660..0000000
--- a/backup/demo/src/app/components/typeahead/demos/format/typeahead-format.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import {Component} from '@angular/core';
-import {Observable} from 'rxjs';
-import {debounceTime, distinctUntilChanged, map} from 'rxjs/operators';
-
-const states = ['Alabama', 'Alaska', 'American Samoa', 'Arizona', 'Arkansas', 'California', 'Colorado',
- 'Connecticut', 'Delaware', 'District Of Columbia', 'Federated States Of Micronesia', 'Florida', 'Georgia',
- 'Guam', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine',
- 'Marshall Islands', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana',
- 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota',
- 'Northern Mariana Islands', 'Ohio', 'Oklahoma', 'Oregon', 'Palau', 'Pennsylvania', 'Puerto Rico', 'Rhode Island',
- 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virgin Islands', 'Virginia',
- 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'];
-
-@Component({
- selector: 'ngbd-typeahead-format',
- templateUrl: './typeahead-format.html',
- styles: [`.form-control { width: 300px; }`]
-})
-export class NgbdTypeaheadFormat {
- public model: any;
-
- formatter = (result: string) => result.toUpperCase();
-
- search = (text$: Observable) =>
- text$.pipe(
- debounceTime(200),
- distinctUntilChanged(),
- map(term => term === '' ? []
- : states.filter(v => v.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10))
- )
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.html b/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.html
deleted file mode 100644
index c2ff11c..0000000
--- a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.html
+++ /dev/null
@@ -1,19 +0,0 @@
-A typeahead example that gets values from the WikipediaService
-
- remote data retrieval
- debounceTime
operator
- tap
operator
- distinctUntilChanged
operator
- switchMap
operator
- catch
operator to display an error message in case of connectivity issue
-
-
-
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.module.ts b/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.module.ts
deleted file mode 100644
index c8aa753..0000000
--- a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.module.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { HttpClientModule } from '@angular/common/http';
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadHttp } from './typeahead-http';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, HttpClientModule, NgbModule],
- declarations: [NgbdTypeaheadHttp],
- exports: [NgbdTypeaheadHttp],
- bootstrap: [NgbdTypeaheadHttp]
-})
-export class NgbdTypeaheadHttpModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.ts b/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.ts
deleted file mode 100644
index 3c27b78..0000000
--- a/backup/demo/src/app/components/typeahead/demos/http/typeahead-http.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import {Component, Injectable} from '@angular/core';
-import {HttpClient, HttpParams} from '@angular/common/http';
-import {Observable, of} from 'rxjs';
-import {catchError, debounceTime, distinctUntilChanged, map, tap, switchMap} from 'rxjs/operators';
-
-const WIKI_URL = 'https://en.wikipedia.org/w/api.php';
-const PARAMS = new HttpParams({
- fromObject: {
- action: 'opensearch',
- format: 'json',
- origin: '*'
- }
-});
-
-@Injectable()
-export class WikipediaService {
- constructor(private http: HttpClient) {}
-
- search(term: string) {
- if (term === '') {
- return of([]);
- }
-
- return this.http
- .get(WIKI_URL, {params: PARAMS.set('search', term)}).pipe(
- map(response => response[1])
- );
- }
-}
-
-@Component({
- selector: 'ngbd-typeahead-http',
- templateUrl: './typeahead-http.html',
- providers: [WikipediaService],
- styles: [`.form-control { width: 300px; display: inline; }`]
-})
-export class NgbdTypeaheadHttp {
- model: any;
- searching = false;
- searchFailed = false;
-
- constructor(private _service: WikipediaService) {}
-
- search = (text$: Observable) =>
- text$.pipe(
- debounceTime(300),
- distinctUntilChanged(),
- tap(() => this.searching = true),
- switchMap(term =>
- this._service.search(term).pipe(
- tap(() => this.searchFailed = false),
- catchError(() => {
- this.searchFailed = true;
- return of([]);
- }))
- ),
- tap(() => this.searching = false)
- )
-}
diff --git a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.html b/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.html
deleted file mode 100644
index 988925c..0000000
--- a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.html
+++ /dev/null
@@ -1,14 +0,0 @@
-A typeahead example that uses a custom template for results display, an object as the model,
- and the highlight directive to highlight the term inside the custom template.
-
-
-
-
-
-
-
-Search for a state:
-
-
-Model: {{ model | json }}
diff --git a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.module.ts b/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.module.ts
deleted file mode 100644
index 6f38efb..0000000
--- a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { FormsModule } from '@angular/forms';
-import { BrowserModule } from '@angular/platform-browser';
-import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
-
-import { NgbdTypeaheadTemplate } from './typeahead-template';
-
-@NgModule({
- imports: [BrowserModule, FormsModule, NgbModule],
- declarations: [NgbdTypeaheadTemplate],
- exports: [NgbdTypeaheadTemplate],
- bootstrap: [NgbdTypeaheadTemplate]
-})
-export class NgbdTypeaheadTemplateModule {}
diff --git a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.ts b/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.ts
deleted file mode 100644
index f69f719..0000000
--- a/backup/demo/src/app/components/typeahead/demos/template/typeahead-template.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import {Component} from '@angular/core';
-import {Observable} from 'rxjs';
-import {debounceTime, map} from 'rxjs/operators';
-
-const statesWithFlags: {name: string, flag: string}[] = [
- {'name': 'Alabama', 'flag': '5/5c/Flag_of_Alabama.svg/45px-Flag_of_Alabama.svg.png'},
- {'name': 'Alaska', 'flag': 'e/e6/Flag_of_Alaska.svg/43px-Flag_of_Alaska.svg.png'},
- {'name': 'Arizona', 'flag': '9/9d/Flag_of_Arizona.svg/45px-Flag_of_Arizona.svg.png'},
- {'name': 'Arkansas', 'flag': '9/9d/Flag_of_Arkansas.svg/45px-Flag_of_Arkansas.svg.png'},
- {'name': 'California', 'flag': '0/01/Flag_of_California.svg/45px-Flag_of_California.svg.png'},
- {'name': 'Colorado', 'flag': '4/46/Flag_of_Colorado.svg/45px-Flag_of_Colorado.svg.png'},
- {'name': 'Connecticut', 'flag': '9/96/Flag_of_Connecticut.svg/39px-Flag_of_Connecticut.svg.png'},
- {'name': 'Delaware', 'flag': 'c/c6/Flag_of_Delaware.svg/45px-Flag_of_Delaware.svg.png'},
- {'name': 'Florida', 'flag': 'f/f7/Flag_of_Florida.svg/45px-Flag_of_Florida.svg.png'},
- {
- 'name': 'Georgia',
- 'flag': '5/54/Flag_of_Georgia_%28U.S._state%29.svg/46px-Flag_of_Georgia_%28U.S._state%29.svg.png'
- },
- {'name': 'Hawaii', 'flag': 'e/ef/Flag_of_Hawaii.svg/46px-Flag_of_Hawaii.svg.png'},
- {'name': 'Idaho', 'flag': 'a/a4/Flag_of_Idaho.svg/38px-Flag_of_Idaho.svg.png'},
- {'name': 'Illinois', 'flag': '0/01/Flag_of_Illinois.svg/46px-Flag_of_Illinois.svg.png'},
- {'name': 'Indiana', 'flag': 'a/ac/Flag_of_Indiana.svg/45px-Flag_of_Indiana.svg.png'},
- {'name': 'Iowa', 'flag': 'a/aa/Flag_of_Iowa.svg/44px-Flag_of_Iowa.svg.png'},
- {'name': 'Kansas', 'flag': 'd/da/Flag_of_Kansas.svg/46px-Flag_of_Kansas.svg.png'},
- {'name': 'Kentucky', 'flag': '8/8d/Flag_of_Kentucky.svg/46px-Flag_of_Kentucky.svg.png'},
- {'name': 'Louisiana', 'flag': 'e/e0/Flag_of_Louisiana.svg/46px-Flag_of_Louisiana.svg.png'},
- {'name': 'Maine', 'flag': '3/35/Flag_of_Maine.svg/45px-Flag_of_Maine.svg.png'},
- {'name': 'Maryland', 'flag': 'a/a0/Flag_of_Maryland.svg/45px-Flag_of_Maryland.svg.png'},
- {'name': 'Massachusetts', 'flag': 'f/f2/Flag_of_Massachusetts.svg/46px-Flag_of_Massachusetts.svg.png'},
- {'name': 'Michigan', 'flag': 'b/b5/Flag_of_Michigan.svg/45px-Flag_of_Michigan.svg.png'},
- {'name': 'Minnesota', 'flag': 'b/b9/Flag_of_Minnesota.svg/46px-Flag_of_Minnesota.svg.png'},
- {'name': 'Mississippi', 'flag': '4/42/Flag_of_Mississippi.svg/45px-Flag_of_Mississippi.svg.png'},
- {'name': 'Missouri', 'flag': '5/5a/Flag_of_Missouri.svg/46px-Flag_of_Missouri.svg.png'},
- {'name': 'Montana', 'flag': 'c/cb/Flag_of_Montana.svg/45px-Flag_of_Montana.svg.png'},
- {'name': 'Nebraska', 'flag': '4/4d/Flag_of_Nebraska.svg/46px-Flag_of_Nebraska.svg.png'},
- {'name': 'Nevada', 'flag': 'f/f1/Flag_of_Nevada.svg/45px-Flag_of_Nevada.svg.png'},
- {'name': 'New Hampshire', 'flag': '2/28/Flag_of_New_Hampshire.svg/45px-Flag_of_New_Hampshire.svg.png'},
- {'name': 'New Jersey', 'flag': '9/92/Flag_of_New_Jersey.svg/45px-Flag_of_New_Jersey.svg.png'},
- {'name': 'New Mexico', 'flag': 'c/c3/Flag_of_New_Mexico.svg/45px-Flag_of_New_Mexico.svg.png'},
- {'name': 'New York', 'flag': '1/1a/Flag_of_New_York.svg/46px-Flag_of_New_York.svg.png'},
- {'name': 'North Carolina', 'flag': 'b/bb/Flag_of_North_Carolina.svg/45px-Flag_of_North_Carolina.svg.png'},
- {'name': 'North Dakota', 'flag': 'e/ee/Flag_of_North_Dakota.svg/38px-Flag_of_North_Dakota.svg.png'},
- {'name': 'Ohio', 'flag': '4/4c/Flag_of_Ohio.svg/46px-Flag_of_Ohio.svg.png'},
- {'name': 'Oklahoma', 'flag': '6/6e/Flag_of_Oklahoma.svg/45px-Flag_of_Oklahoma.svg.png'},
- {'name': 'Oregon', 'flag': 'b/b9/Flag_of_Oregon.svg/46px-Flag_of_Oregon.svg.png'},
- {'name': 'Pennsylvania', 'flag': 'f/f7/Flag_of_Pennsylvania.svg/45px-Flag_of_Pennsylvania.svg.png'},
- {'name': 'Rhode Island', 'flag': 'f/f3/Flag_of_Rhode_Island.svg/32px-Flag_of_Rhode_Island.svg.png'},
- {'name': 'South Carolina', 'flag': '6/69/Flag_of_South_Carolina.svg/45px-Flag_of_South_Carolina.svg.png'},
- {'name': 'South Dakota', 'flag': '1/1a/Flag_of_South_Dakota.svg/46px-Flag_of_South_Dakota.svg.png'},
- {'name': 'Tennessee', 'flag': '9/9e/Flag_of_Tennessee.svg/46px-Flag_of_Tennessee.svg.png'},
- {'name': 'Texas', 'flag': 'f/f7/Flag_of_Texas.svg/45px-Flag_of_Texas.svg.png'},
- {'name': 'Utah', 'flag': 'f/f6/Flag_of_Utah.svg/45px-Flag_of_Utah.svg.png'},
- {'name': 'Vermont', 'flag': '4/49/Flag_of_Vermont.svg/46px-Flag_of_Vermont.svg.png'},
- {'name': 'Virginia', 'flag': '4/47/Flag_of_Virginia.svg/44px-Flag_of_Virginia.svg.png'},
- {'name': 'Washington', 'flag': '5/54/Flag_of_Washington.svg/46px-Flag_of_Washington.svg.png'},
- {'name': 'West Virginia', 'flag': '2/22/Flag_of_West_Virginia.svg/46px-Flag_of_West_Virginia.svg.png'},
- {'name': 'Wisconsin', 'flag': '2/22/Flag_of_Wisconsin.svg/45px-Flag_of_Wisconsin.svg.png'},
- {'name': 'Wyoming', 'flag': 'b/bc/Flag_of_Wyoming.svg/43px-Flag_of_Wyoming.svg.png'}
-];
-
-@Component({
- selector: 'ngbd-typeahead-template',
- templateUrl: './typeahead-template.html',
- styles: [`.form-control { width: 300px; }`]
-})
-export class NgbdTypeaheadTemplate {
- public model: any;
-
- search = (text$: Observable) =>
- text$.pipe(
- debounceTime(200),
- map(term => term === '' ? []
- : statesWithFlags.filter(v => v.name.toLowerCase().indexOf(term.toLowerCase()) > -1).slice(0, 10))
- )
-
- formatter = (x: {name: string}) => x.name;
-
-}
diff --git a/backup/demo/src/app/components/typeahead/typeahead.module.ts b/backup/demo/src/app/components/typeahead/typeahead.module.ts
deleted file mode 100644
index 617c374..0000000
--- a/backup/demo/src/app/components/typeahead/typeahead.module.ts
+++ /dev/null
@@ -1,88 +0,0 @@
-import { NgModule } from '@angular/core';
-
-import { NgbdSharedModule } from '../../shared';
-import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component';
-import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared';
-import { NgbdApiPage } from '../shared/api-page/api.component';
-import { NgbdExamplesPage } from '../shared/examples-page/examples.component';
-import { NgbdTypeaheadBasic } from './demos/basic/typeahead-basic';
-import { NgbdTypeaheadBasicModule } from './demos/basic/typeahead-basic.module';
-import { NgbdTypeaheadConfig } from './demos/config/typeahead-config';
-import { NgbdTypeaheadConfigModule } from './demos/config/typeahead-config.module';
-import { NgbdTypeaheadFocus } from './demos/focus/typeahead-focus';
-import { NgbdTypeaheadFocusModule } from './demos/focus/typeahead-focus.module';
-import { NgbdTypeaheadFormat } from './demos/format/typeahead-format';
-import { NgbdTypeaheadFormatModule } from './demos/format/typeahead-format.module';
-import { NgbdTypeaheadHttp } from './demos/http/typeahead-http';
-import { NgbdTypeaheadHttpModule } from './demos/http/typeahead-http.module';
-import { NgbdTypeaheadTemplate } from './demos/template/typeahead-template';
-import { NgbdTypeaheadTemplateModule } from './demos/template/typeahead-template.module';
-
-const DEMOS = {
- basic: {
- title: 'Simple Typeahead',
- type: NgbdTypeaheadBasic,
- code: require('!!raw-loader!./demos/basic/typeahead-basic'),
- markup: require('!!raw-loader!./demos/basic/typeahead-basic.html')
- },
- focus: {
- title: 'Open on focus',
- type: NgbdTypeaheadFocus,
- code: require('!!raw-loader!./demos/focus/typeahead-focus'),
- markup: require('!!raw-loader!./demos/focus/typeahead-focus.html')
- },
- format: {
- title: 'Formatted results',
- type: NgbdTypeaheadFormat,
- code: require('!!raw-loader!./demos/format/typeahead-format'),
- markup: require('!!raw-loader!./demos/format/typeahead-format.html')
- },
- http: {
- title: 'Wikipedia search',
- type: NgbdTypeaheadHttp,
- code: require('!!raw-loader!./demos/http/typeahead-http'),
- markup: require('!!raw-loader!./demos/http/typeahead-http.html')
- },
- template: {
- title: 'Template for results',
- type: NgbdTypeaheadTemplate,
- code: require('!!raw-loader!./demos/template/typeahead-template'),
- markup: require('!!raw-loader!./demos/template/typeahead-template.html')
- },
- config: {
- title: 'Global configuration of typeaheads',
- type: NgbdTypeaheadConfig,
- code: require('!!raw-loader!./demos/config/typeahead-config'),
- markup: require('!!raw-loader!./demos/config/typeahead-config.html')
- }
-};
-
-export const ROUTES = [
- { path: '', pathMatch: 'full', redirectTo: 'examples' },
- {
- path: '',
- component: ComponentWrapper,
- children: [
- { path: 'examples', component: NgbdExamplesPage },
- { path: 'api', component: NgbdApiPage }
- ]
- }
-];
-
-@NgModule({
- imports: [
- NgbdSharedModule,
- NgbdComponentsSharedModule,
- NgbdTypeaheadFormatModule,
- NgbdTypeaheadHttpModule,
- NgbdTypeaheadBasicModule,
- NgbdTypeaheadFocusModule,
- NgbdTypeaheadTemplateModule,
- NgbdTypeaheadConfigModule
- ]
-})
-export class NgbdTypeaheadModule {
- constructor(demoList: NgbdDemoList) {
- demoList.register('typeahead', DEMOS);
- }
-}
diff --git a/backup/demo/src/app/default/default.component.html b/backup/demo/src/app/default/default.component.html
deleted file mode 100644
index a339d14..0000000
--- a/backup/demo/src/app/default/default.component.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
Sunbird UI Components
-
The angular way
-
- Angular widgets built from the ground up using only Sunbird UI Components CSS with APIs designed for the Angular ecosystem.
-
-
No dependencies on 3rd party JavaScript.
-
-
Currently at v{{version}}
-
-
-
-
diff --git a/backup/demo/src/app/default/default.component.ts b/backup/demo/src/app/default/default.component.ts
deleted file mode 100644
index 2a4328b..0000000
--- a/backup/demo/src/app/default/default.component.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import {Component} from '@angular/core';
-import {environment} from '../../environments/environment';
-
-@Component({
- selector: 'ngbd-default',
- templateUrl: './default.component.html'
-})
-export class DefaultComponent {
- public version: string = environment.version;
-}
diff --git a/backup/demo/src/app/default/index.ts b/backup/demo/src/app/default/index.ts
deleted file mode 100644
index 2283975..0000000
--- a/backup/demo/src/app/default/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './default.component';
diff --git a/backup/demo/src/app/pages/getting-started/getting-started.component.html b/backup/demo/src/app/pages/getting-started/getting-started.component.html
deleted file mode 100644
index a5c6f4d..0000000
--- a/backup/demo/src/app/pages/getting-started/getting-started.component.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- After installing the above dependencies, install Sunbird UI components
via:
-
-
-
- Once installed you need to import our main module.
-
-
-
- Alternatively you could only import modules with components you need, ex. pagination and alert.
- The resulting bundle will be smaller in this case.
-
-
-
-
diff --git a/backup/demo/src/app/pages/getting-started/getting-started.component.ts b/backup/demo/src/app/pages/getting-started/getting-started.component.ts
deleted file mode 100644
index 47779ac..0000000
--- a/backup/demo/src/app/pages/getting-started/getting-started.component.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import {Component} from '@angular/core';
-import {Snippet} from '../../shared/code/snippet';
-
-@Component({
- templateUrl: './getting-started.component.html'
-})
-export class GettingStartedPage {
- codeInstall = Snippet({
- lang: 'bash',
- code: `npm install --save sunbird-ui-components`,
- });
-
- codeRoot = Snippet({
- lang: 'typescript',
- code: `
- import {SbModule} from 'sunbird-ui-components';
-
- @NgModule({
- ...
- imports: [SbModule, ...],
- ...
- })
- export class YourAppModule {
- }
- `,
- });
-
- codeOther = Snippet({
- lang: 'typescript',
- code: `
- import {NgbPaginationModule,NgbAlertModule} from 'sunbird-ui-components';
-
- @NgModule({
- ...
- imports: [NgbPaginationModule, NgbAlertModule, ...],
- ...
- })
- export class YourAppModule {
- }
- `,
- });
-
- codeSystem = Snippet({
- lang: 'typescript',
- code: `
- map: {
- 'sunbird-ui-components': 'node_modules/sunbird-ui-components/bundles/sb.js',
- }
- `,
- });
-}
diff --git a/backup/demo/src/app/pages/positioning/positioning.component.html b/backup/demo/src/app/pages/positioning/positioning.component.html
deleted file mode 100644
index 5798308..0000000
--- a/backup/demo/src/app/pages/positioning/positioning.component.html
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
- Some of the components we have are designed to be opened inside of the popup:
-
-
-
- Datepicker
- Dropdown
- Popover
- Tooltip
- Typeahead
-
-
-
- When the popup is opened, it is positioned correctly next to the target
element and fits in the
- viewport. It is also possible to provide some options, ex. whether the popup should be opened to the
- top
or to the bottom
of the target
element.
-
-
-
- For instance here the tooltip is always forced to be opened to the right
, even if it won't fit in the
- viewport.
-
-
-
- Hover me
-
-
-
-
-
-
- Bootstrap uses popper.js
library for positioning. We decided not to have any dependencies on 3rd
- party libraries, so we implement a subset of the same functionality ourselves. If something is missing or you
- have a very specific use case - please open an issue on GitHub and we'll discuss.
-
-
-
- Since version 4.1
we position the popup using position: absolute; transform: translate(x,y);
-
to match Bootstrap.
-
- The position is calculated after popup opening when the zone is stable. At the moment we don't reposition the popup
- on scrolling. It might be supported in future releases, please vote for issues.
-
-
-
-
-
- Components in question have two common inputs that help with positioning: placement
and
- container
-
-
- Placement
-
-
- Placement specifies where the popup should be positioned in the order of preference.
-
-
-
- We go through the provided placements one-by-one an try to position the popup
- If it doesn't fit, we try the next one
- If no provided placements in fit the viewport, we use the first provided one
-
-
-
- If no placement
value is provided at all, each component has it's own default order of preference.
- Check the component API docs to find out the default order, ex.
- here is the tooltip's API .
-
-
-
-
-
-
-
- There also a special "auto"
property, that is equal to "top", "top-left", "top-right", "bottom",
- "bottom-left", "bottom-right", "left", "left-top", "left-bottom", "right", "right-top", "right-bottom"
-
-
-
-
-
-
- Container
-
-
- Container specifies where the popup will be physically attached to the DOM.
-
-
-
- By default it is attached as a sibling of the target
element and the only optional supported container
- is 'body'
.
-
-
-
-
-
-
-
- There are two things that make dropdown a bit special at the moment: it won't be positioned dynamically when inside
- the navbar and the popup (dropdown menu) is always attached to the DOM.
-
-
-
-
-
- When dropdown is used inside the Bootstrap's navbar
, it will not be positioned (to match
- Bootstrap behaviour and work fine on mobile). You can override it by using the display
input.
-
-
-
-
-
-
-
-
- As Dropdown
is not a component, but a set of directives, the dropdown menu popup is always attached
- to the DOM even when not visible. Depending on the container
input, the menu will always be
- attached either to the body or to the dropdown element.
-
-
-
-
-
diff --git a/backup/demo/src/app/pages/positioning/positioning.component.ts b/backup/demo/src/app/pages/positioning/positioning.component.ts
deleted file mode 100644
index 7a37264..0000000
--- a/backup/demo/src/app/pages/positioning/positioning.component.ts
+++ /dev/null
@@ -1,59 +0,0 @@
-import {Component} from '@angular/core';
-import {Snippet} from '../../shared/code/snippet';
-
-@Component({
- templateUrl: './positioning.component.html'
-})
-export class PositioningPage {
- rightExample = Snippet({
- lang: 'html',
- code: `Hover me `
- });
-
- placement = Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
-
-
-
-
-
-
- `
- });
-
- auto = Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
- `
- });
-
- container = Snippet({
- lang: 'html',
- code: `
-
-
-
-
-
- `
- });
-
- dropdown = Snippet({
- lang: 'html',
- code: `
-
-
- `
- });
-}
diff --git a/backup/demo/src/app/shared/analytics/analytics.ts b/backup/demo/src/app/shared/analytics/analytics.ts
deleted file mode 100644
index 56bd1ae..0000000
--- a/backup/demo/src/app/shared/analytics/analytics.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {Injectable} from '@angular/core';
-import {Router, NavigationEnd} from '@angular/router';
-import {Location} from '@angular/common';
-import {filter} from 'rxjs/operators';
-
-declare const ga: any;
-
-/**
- * Simple Google Analytics service. Note that all its methods don't do anything unless the app
- * is deployed on ng-bootstrap.github.io. This avoids sending events and page views during development.
- */
-@Injectable()
-export class Analytics {
- private _enabled: boolean;
-
- constructor(private _location: Location, private _router: Router) {
- this._enabled = window.location.href.indexOf('ng-bootstrap.github.io') >= 0;
- }
-
- /**
- * Intended to be called only once. Subscribes to router events and sends a page view
- * after each ended navigation event.
- */
- trackPageViews() {
- if (this._enabled) {
- this._router.events.pipe(
- filter(event => event instanceof NavigationEnd)
- ).subscribe(() => {
- ga('send', {hitType: 'pageview', page: this._location.path()});
- });
- }
- }
-
- /**
- * Sends an event.
- */
- trackEvent(action: string, category: string) {
- if (this._enabled) {
- ga('send', {hitType: 'event', eventCategory: category, eventAction: action});
- }
- }
-}
diff --git a/backup/demo/src/app/shared/code/code-highlight.service.ts b/backup/demo/src/app/shared/code/code-highlight.service.ts
deleted file mode 100644
index 3e1539d..0000000
--- a/backup/demo/src/app/shared/code/code-highlight.service.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {Injectable} from '@angular/core';
-
-import * as prism from 'prismjs';
-import 'prismjs/components/prism-typescript';
-import 'prismjs/components/prism-bash';
-
-// Prism tries to highlight the whole document on DOMContentLoad.
-// Unfortunately with webpack the only way of disabling it
-// is by simply forcing it to highlight no elements -> []
-prism.hooks.add('before-highlightall', (env) => {
- env['elements'] = [];
-});
-
-@Injectable()
-export class CodeHighlightService {
-
- highlight(code: string, lang: string) {
- return prism.highlight(code.trim(), prism.languages[lang], lang);
- }
-}
diff --git a/backup/demo/src/app/shared/code/code.component.ts b/backup/demo/src/app/shared/code/code.component.ts
deleted file mode 100644
index cac00af..0000000
--- a/backup/demo/src/app/shared/code/code.component.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import {AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, ViewChild} from '@angular/core';
-
-import {ISnippet} from './snippet';
-import {CodeHighlightService} from './code-highlight.service';
-
-@Component({
- selector: 'ngbd-code',
- changeDetection: ChangeDetectionStrategy.OnPush,
- template: `
-
- `
-})
-export class NgbdCodeComponent implements AfterViewInit {
-
- @ViewChild('code', {static: true}) codeEl: ElementRef;
-
- @Input() snippet: ISnippet;
-
- constructor(private _service: CodeHighlightService) { }
-
- ngAfterViewInit() {
- this.codeEl.nativeElement.innerHTML = this._service.highlight(this.snippet.code, this.snippet.lang);
- }
-}
diff --git a/backup/demo/src/app/shared/code/snippet.ts b/backup/demo/src/app/shared/code/snippet.ts
deleted file mode 100644
index 855b322..0000000
--- a/backup/demo/src/app/shared/code/snippet.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-export interface ISnippet {
- lang: 'html' | 'typescript' | 'css' | 'bash';
- code: string;
-}
-
-function removeEmptyLineAtIndex(lines: string[], index: number) {
- if (lines[index].trim().length === 0) {
- lines.splice(index, 1);
- }
-}
-
-function findIndentLevel(lines): number {
- return Math.min(...lines
- .map(line => {
- const result = /( *)[^ ]+/g.exec(line);
- return result == null ? null : result[1].length;
- })
- .filter(value => value != null)
- );
-}
-
-function fixIndent(lines: string[]): string[] {
- removeEmptyLineAtIndex(lines, 0);
- removeEmptyLineAtIndex(lines, lines.length - 1);
- const indentLevel = findIndentLevel(lines);
-
- return lines.map(line => line.substring(indentLevel));
-}
-
-
-export function Snippet({lang, code}: ISnippet): ISnippet {
- return {
- lang,
- code: fixIndent(code.split(/(?:\r\n)|\n|\r/gi)).join('\n'),
- };
-}
diff --git a/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.html b/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.html
deleted file mode 100644
index 76a9376..0000000
--- a/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
diff --git a/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.ts b/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.ts
deleted file mode 100644
index f5bc338..0000000
--- a/backup/demo/src/app/shared/component-wrapper/component-wrapper.component.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import { Component, NgZone } from '@angular/core';
-import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
-import { filter } from 'rxjs/operators';
-
-import { NgbdApiPage } from '../../components/shared/api-page/api.component';
-import { NgbdExamplesPage } from '../../components/shared/examples-page/examples.component';
-
-
-@Component({
- selector: 'component-wrapper',
- templateUrl: 'component-wrapper.component.html'
-})
-
-export class ComponentWrapper {
- activeTab = 'examples';
-
- component: string;
-
- isLargeScreenOrLess: boolean;
- isSmallScreenOrLess: boolean;
-
- sidebarCollapsed = true;
-
- tableOfContent: any[] = [];
-
- constructor(public route: ActivatedRoute, private _router: Router, ngZone: NgZone) {
- // This component is used in route definition 'components'
- // So next child route will always be ':componentType' & next one will always be ':pageType' (or tab)
- this._router.events.pipe(
- filter(event => event instanceof NavigationEnd)
- ).subscribe(() => {
- const parentRoute = this.route.snapshot.parent;
- const tabRoute = this.route.snapshot.firstChild;
-
- this.component = parentRoute.url[1].path;
- this.activeTab = tabRoute.url[0].path;
-
- });
-
- // information extracted from https://getbootstrap.com/docs/4.1/layout/overview/
- // TODO: we should implements our own mediamatcher, according to bootstrap layout.
- const smallScreenQL = matchMedia('(max-width: 767.98px)');
- // tslint:disable-next-line:deprecation
- smallScreenQL.addListener((event) => ngZone.run(() => this.isSmallScreenOrLess = event.matches));
- this.isSmallScreenOrLess = smallScreenQL.matches;
-
- const largeScreenQL = matchMedia('(max-width: 1199.98px)');
- this.isLargeScreenOrLess = largeScreenQL.matches;
- // tslint:disable-next-line:deprecation
- largeScreenQL.addListener((event) => ngZone.run(() => this.isLargeScreenOrLess = event.matches));
- }
-
- updateNavigation(component) {
- const getLinks = (typeCollection) => {
- return typeCollection.map(item => ({
- fragment: item,
- title: item
- }));
- };
- this.tableOfContent = [];
- if (component instanceof NgbdExamplesPage) {
- this.tableOfContent = component.demos.map(demo => {
- return {
- fragment: demo.id,
- title: demo.title
- };
- });
- } else if (component instanceof NgbdApiPage) {
- let toc = [
- ...getLinks(component.components)
- ];
-
- if (component.classes.length > 0) {
- const klasses = getLinks(component.classes);
- toc = toc.concat(toc.length > 0 ? [{}, ...klasses] : klasses);
- }
-
- if (component.configs.length > 0) {
- const configs = getLinks(component.configs);
- toc = toc.concat(toc.length > 0 ? [{}, ...configs] : configs);
- }
-
- this.tableOfContent = toc;
-
- } else /* Overview */ {
- // TODO: maybe we should also have an abstract class to test instanceof
- this.tableOfContent = Object.values(component.sections).map(section => section);
- }
- }
-}
diff --git a/backup/demo/src/app/shared/fragment/fragment.directive.ts b/backup/demo/src/app/shared/fragment/fragment.directive.ts
deleted file mode 100644
index 3036759..0000000
--- a/backup/demo/src/app/shared/fragment/fragment.directive.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { Directive, Input } from '@angular/core';
-
-@Directive({
- selector: 'a[ngbdFragment]',
- host: {
- '[class.title-fragment]': 'true',
- '[attr.id]': 'fragment'
- }
-})
-export class NgbdFragment {
- @Input() fragment: string;
-}
diff --git a/backup/demo/src/app/shared/icons/icons.component.html b/backup/demo/src/app/shared/icons/icons.component.html
deleted file mode 100644
index 7a40789..0000000
--- a/backup/demo/src/app/shared/icons/icons.component.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/shared/icons/icons.component.ts b/backup/demo/src/app/shared/icons/icons.component.ts
deleted file mode 100644
index 5862442..0000000
--- a/backup/demo/src/app/shared/icons/icons.component.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component, Input} from '@angular/core';
-
-@Component({
- selector: 'svg[ngbdIcon]',
- templateUrl: './icons.component.html',
- host: {
- 'xmlns': 'http://www.w3.org/2000/svg',
- 'viewBox': '0 0 24 24',
- '[attr.width]': 'width',
- '[attr.height]': 'height',
- }
-})
-export class NgbdIcons {
- @Input() ngbdIcon: string;
- @Input() width = '24';
- @Input() height = '24';
-}
diff --git a/backup/demo/src/app/shared/index.ts b/backup/demo/src/app/shared/index.ts
deleted file mode 100644
index 6ea661c..0000000
--- a/backup/demo/src/app/shared/index.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import {CommonModule} from '@angular/common';
-import {HttpClientModule} from '@angular/common/http';
-import {NgModule} from '@angular/core';
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-import {RouterModule} from '@angular/router';
-import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-
-import {Analytics} from './analytics/analytics';
-import {CodeHighlightService} from './code/code-highlight.service';
-import {NgbdCodeComponent} from './code/code.component';
-import {ComponentWrapper} from './component-wrapper/component-wrapper.component';
-import {NgbdFragment} from './fragment/fragment.directive';
-import {NgbdIcons} from './icons/icons.component';
-import {NgbdPageHeaderComponent} from './page-wrapper/page-header.component';
-import {PageWrapper} from './page-wrapper/page-wrapper.component';
-import {SideNavComponent} from './side-nav/side-nav.component';
-
-export {componentsList} from './side-nav/side-nav.component';
-
-@NgModule({
- imports: [CommonModule, RouterModule, NgbModule],
- exports: [
- CommonModule, RouterModule, ComponentWrapper, PageWrapper, NgbdPageHeaderComponent, NgbdFragment, SideNavComponent,
- NgbdCodeComponent, NgbModule, FormsModule, ReactiveFormsModule, HttpClientModule, NgbdIcons
- ],
- declarations: [
- ComponentWrapper, PageWrapper, NgbdPageHeaderComponent, NgbdFragment, SideNavComponent, NgbdCodeComponent, NgbdIcons
- ],
- providers: [Analytics, CodeHighlightService]
-})
-export class NgbdSharedModule {
-}
diff --git a/backup/demo/src/app/shared/page-wrapper/page-header.component.ts b/backup/demo/src/app/shared/page-wrapper/page-header.component.ts
deleted file mode 100644
index a6aa441..0000000
--- a/backup/demo/src/app/shared/page-wrapper/page-header.component.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
-import {NgbdOverviewSection} from '../../components/shared/overview';
-
-@Component({
- selector: 'ngbd-page-header',
- changeDetection: ChangeDetectionStrategy.OnPush,
- host: {
- 'class': 'd-block'
- },
- template: `
-
-
-
-
- {{ title }}
-
- `,
-})
-export class NgbdPageHeaderComponent implements NgbdOverviewSection {
- @Input() title: string;
- @Input() fragment: string;
-}
diff --git a/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.html b/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.html
deleted file mode 100644
index 8066c49..0000000
--- a/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
-
-
- {{ pageTitle }}
-
-
-
-
-
- Table of content
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.ts b/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.ts
deleted file mode 100644
index ca3a9b0..0000000
--- a/backup/demo/src/app/shared/page-wrapper/page-wrapper.component.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {Component, ContentChildren, Input, NgZone, QueryList} from '@angular/core';
-import {NgbdPageHeaderComponent} from './page-header.component';
-
-@Component({
- selector: 'ngbd-page-wrapper',
- templateUrl: './page-wrapper.component.html'
-})
-export class PageWrapper {
- @Input() pageTitle: string;
-
- @ContentChildren(NgbdPageHeaderComponent) private _tableOfContents: QueryList;
-
- sidebarCollapsed = true;
- isLargeScreenOrLess: boolean;
-
- constructor(ngZone: NgZone) {
- const largeScreenQL = matchMedia('(max-width: 1199.98px)');
- this.isLargeScreenOrLess = largeScreenQL.matches;
- // tslint:disable-next-line:deprecation
- largeScreenQL.addListener((event) => ngZone.run(() => this.isLargeScreenOrLess = event.matches));
- }
-
- get tableOfContents() {
- return this._tableOfContents ? this._tableOfContents.toArray() : [];
- }
-}
diff --git a/backup/demo/src/app/shared/side-nav/side-nav.component.html b/backup/demo/src/app/shared/side-nav/side-nav.component.html
deleted file mode 100644
index d7e407a..0000000
--- a/backup/demo/src/app/shared/side-nav/side-nav.component.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/backup/demo/src/app/shared/side-nav/side-nav.component.ts b/backup/demo/src/app/shared/side-nav/side-nav.component.ts
deleted file mode 100644
index 3dcf5a3..0000000
--- a/backup/demo/src/app/shared/side-nav/side-nav.component.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import {Component} from '@angular/core';
-import {Router} from '@angular/router';
-
-export const componentsList = [
- 'Card', 'Accordion', 'Alert', 'Buttons', 'Modal'
-];
-
-@Component({
- selector: 'ngbd-side-nav',
- templateUrl: './side-nav.component.html',
-})
-export class SideNavComponent {
- components = componentsList;
-
- constructor(private router: Router) {}
-
- isActive(currentRoute: any[], exact = true): boolean {
- return this.router.isActive(this.router.createUrlTree(currentRoute), exact);
- }
-}
diff --git a/backup/demo/src/browserslist b/backup/demo/src/browserslist
deleted file mode 100644
index c8143d3..0000000
--- a/backup/demo/src/browserslist
+++ /dev/null
@@ -1,7 +0,0 @@
-# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
-# For additional information regarding the format and rule options, please see:
-# https://github.com/browserslist/browserslist#queries
-# For IE 9-11 support, please uncomment the last line of the file and adjust as needed
-last 2 versions
-Firefox ESR
-IE 10-11
diff --git a/backup/demo/src/docs.json b/backup/demo/src/docs.json
deleted file mode 100644
index 88cf1b8..0000000
--- a/backup/demo/src/docs.json
+++ /dev/null
@@ -1 +0,0 @@
-{"NgbPanel":{"fileName":"src/accordion/accordion.ts","className":"NgbPanel","selector":"ngb-panel","exportAs":"ngbPanel","description":"","inputs":[{"name":"disabled","defaultValue":"false","type":"boolean","description":"A flag determining whether the panel is disabled or not.\nWhen disabled, the panel cannot be toggled."},{"name":"id","type":"string","description":"An optional id for the panel. The id should be unique.\nIf not provided, it will be auto-generated."},{"name":"open","defaultValue":"false","type":"boolean","description":"Defines whether the panel should be open initially."},{"name":"title","type":"string","description":"The title for the panel."}],"outputs":[]},"NgbAccordion":{"fileName":"src/accordion/accordion.ts","className":"NgbAccordion","selector":"ngb-accordion","description":"","inputs":[{"name":"closeOthers","type":"boolean","description":"A flag determining whether the other panels should be closed\nwhen a panel is opened."}],"outputs":[]},"NgbAlert":{"fileName":"src/alert/alert.ts","className":"NgbAlert","selector":"ngb-alert","description":"Alerts can be used to provide feedback messages.","inputs":[{"name":"dismissible","defaultValue":"true","type":"boolean","description":"A flag indicating if a given alert can be dismissed (closed) by a user. If this flag is set, a close button (in a\nform of a cross) will be displayed."},{"name":"type","defaultValue":"warning","type":"string","description":"Alert type (CSS class). Bootstrap 4 recognizes the following types: \"success\", \"info\", \"warning\" and \"danger\"."}],"outputs":[{"name":"close","description":"An event emitted when the close button is clicked. This event has no payload. Only relevant for dismissible alerts."}]},"NgbRadioGroup":{"fileName":"src/buttons/radio.ts","className":"NgbRadioGroup","selector":"[ngbRadioGroup][ngModel]","description":"Easily create Bootstrap-style radio buttons. A value of a selected button is bound to a variable\nspecified via ngModel.","inputs":[],"outputs":[]},"NgbRadioLabel":{"fileName":"src/buttons/radio.ts","className":"NgbRadioLabel","selector":"label.btn","description":"","inputs":[{"name":"checked","type":"boolean","description":""}],"outputs":[]},"NgbRadio":{"fileName":"src/buttons/radio.ts","className":"NgbRadio","selector":"input[type=radio]","description":"Marks an input of type \"radio\" as part of the NgbRadioGroup.","inputs":[{"name":"value","type":"any","description":"You can specify model value of a given radio by binding to the value property."}],"outputs":[]},"NgbSlide":{"fileName":"src/carousel/carousel.ts","className":"NgbSlide","selector":"template[ngbSlide]","description":"","inputs":[{"name":"id","type":"string","description":""}],"outputs":[]},"NgbCarousel":{"fileName":"src/carousel/carousel.ts","className":"NgbCarousel","selector":"ngb-carousel","exportAs":"ngbCarousel","description":"","inputs":[{"name":"activeId","type":"string","description":""},{"name":"interval","defaultValue":"5000","type":"number","description":""},{"name":"keyboard","defaultValue":"true","type":"boolean","description":""},{"name":"wrap","defaultValue":"true","type":"boolean","description":""}],"outputs":[]},"NgbCollapse":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/collapse/collapse.ts","className":"NgbCollapse","selector":"[ngbCollapse]","exportAs":"ngbCollapse","description":"The NgbCollapse directive provides a simple way to hide and show an element with animations.","inputs":[{"name":"ngbCollapse","defaultValue":"false","type":"boolean","description":"A flag indicating collapsed (true) or open (false) state."}],"outputs":[]},"NgbDropdown":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/dropdown/dropdown.ts","className":"NgbDropdown","selector":"[ngbDropdown]","exportAs":"ngbDropdown","description":"Transforms a node into a dropdown.","inputs":[{"name":"autoClose","defaultValue":"true","type":"boolean","description":"Indicates that dropdown should be closed when selecting one of dropdown items (click) or pressing ESC."},{"name":"open","defaultValue":"false","type":"boolean","description":"Defines whether or not the dropdown-menu is open initially."}],"outputs":[{"name":"openChange","description":"An event fired when the dropdown is opened or closed.\nEvent's payload equals whether dropdown is open."}]},"NgbDropdownToggle":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/dropdown/dropdown.ts","className":"NgbDropdownToggle","selector":"[ngbDropdownToggle]","description":"Allows the dropdown to be toggled via click. This directive is optional.","inputs":[],"outputs":[]},"NgbModalBackdrop":{"fileName":"src/modal/modal_backdrop.ts","className":"NgbModalBackdrop","selector":"ngb-modal-backdrop","description":"","inputs":[],"outputs":[]},"NgbModalWindow":{"fileName":"src/modal/modal_window.ts","className":"NgbModalWindow","selector":"ngb-modal-window","description":"","inputs":[{"name":"backdrop","defaultValue":"true","type":"boolean","description":""},{"name":"keyboard","defaultValue":"true","type":"boolean","description":""},{"name":"size","type":"string","description":""}],"outputs":[{"name":"close","description":""},{"name":"dismiss","description":""}]},"NgbPager":{"fileName":"src/pager/pager.ts","className":"NgbPager","selector":"ngb-pager","description":"","inputs":[{"name":"alignLinks","defaultValue":"false","type":"boolean","description":"A flag for determining whether links need to be aligned."},{"name":"noOfPages","defaultValue":"0","type":"number","description":"Number of pages present."},{"name":"page","defaultValue":"0","type":"number","description":"Current page."}],"outputs":[{"name":"pageChange","description":"An event fired when the page is changed.\nEvent's payload equals the current page."}]},"NgbPagination":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/pagination/pagination.ts","className":"NgbPagination","selector":"ngb-pagination","description":"","inputs":[{"name":"boundaryLinks","type":"boolean","description":"Whether to show the \"First\" and \"Last\" page links"},{"name":"collectionSize","type":"number | string","description":"Number of items in collection."},{"name":"page","type":"number | string","description":"Current page."},{"name":"pageSize","type":"number | string","description":"Number of items per page."}],"outputs":[{"name":"pageChange","description":"An event fired when the page is changed.\nEvent's payload equals the current page."}]},"NgbPopoverWindow":{"fileName":"src/popover/popover.ts","className":"NgbPopoverWindow","selector":"ngb-popover-window","description":"","inputs":[{"name":"placement","defaultValue":"top","type":"string","description":""},{"name":"title","type":"string","description":""}],"outputs":[]},"NgbProgressbar":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/progressbar/progressbar.ts","className":"NgbProgressbar","selector":"ngb-progressbar","description":"Directive that can be used to provide feedback on the progress of a workflow or an action.","inputs":[{"name":"animated","type":"boolean | string","description":"A flag indicating if a progress bar should be animated when the value changes. Takes effect only for browsers\nsupporting CSS3 animations."},{"name":"max","defaultValue":"100","type":"number","description":"Maximal value to be displayed in the progressbar."},{"name":"striped","type":"boolean | string","description":"A flag indicating if a progress bar should be displayed as striped."},{"name":"type","type":"string","description":"Type of progress bar, can be one of \"success\", \"info\", \"warning\" or \"danger\"."},{"name":"value","type":"number","description":"Current value to be displayed in the progressbar. Should be smaller or equal to \"max\" value."}],"outputs":[]},"NgbRating":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/rating/rating.ts","className":"NgbRating","selector":"ngb-rating","exportAs":"ngbRating","description":"","inputs":[{"name":"max","defaultValue":"10","type":"number","description":""},{"name":"rate","type":"number","description":""},{"name":"readonly","type":"boolean","description":""}],"outputs":[{"name":"hover","description":""},{"name":"leave","description":""},{"name":"rateChange","description":""}]},"NgbTabTitle":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/tabset/tabset.ts","className":"NgbTabTitle","selector":"template[ngbTabTitle]","description":"","inputs":[],"outputs":[]},"NgbTabContent":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/tabset/tabset.ts","className":"NgbTabContent","selector":"template[ngbTabContent]","description":"","inputs":[],"outputs":[]},"NgbTab":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/tabset/tabset.ts","className":"NgbTab","selector":"ngb-tab","description":"A directive representing an individual tab.","inputs":[{"name":"disabled","defaultValue":"false","type":"boolean","description":"Allows toggling disabled state of a given state. Disabled tabs can't be selected."},{"name":"id","type":"string","description":"Unique tab identifier. Must be unique for the entire document for proper accessibility support."},{"name":"title","type":"string","description":"Simple (string only) title. Use the \"NgbTabTitle\" directive for more complex use-cases."}],"outputs":[]},"NgbTabset":{"fileName":"/Users/wesleycho/repositories/ng-bootstrap/src/tabset/tabset.ts","className":"NgbTabset","selector":"ngb-tabset","exportAs":"ngbTabset","description":"A component that makes it easy to create tabbed interface.","inputs":[{"name":"activeId","type":"string","description":"An identifier of a tab that should be selected (active)."},{"name":"type","defaultValue":"tabs","type":"string","description":"Type of navigation to be used for tabs. Can be one of 'tabs' or 'pills'."}],"outputs":[]},"NgbTooltipWindow":{"fileName":"src/tooltip/tooltip.ts","className":"NgbTooltipWindow","selector":"ngb-tooltip-window","description":"","inputs":[{"name":"placement","defaultValue":"top","type":"string","description":""}],"outputs":[]}}
diff --git a/backup/demo/src/environments/environment.prod.ts b/backup/demo/src/environments/environment.prod.ts
deleted file mode 100644
index 6ec7b3a..0000000
--- a/backup/demo/src/environments/environment.prod.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { versions } from './versions';
-
-export const environment = {
- production: true,
- version: versions.ngBootstrap,
- bootstrap: versions.bootstrap
-};
diff --git a/backup/demo/src/environments/environment.ts b/backup/demo/src/environments/environment.ts
deleted file mode 100644
index 8e9d78f..0000000
--- a/backup/demo/src/environments/environment.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-// The file contents for the current environment will overwrite these during build.
-// The build system defaults to the dev environment which uses `environment.ts`, but if you do
-// `ng build --env=prod` then `environment.prod.ts` will be used instead.
-// The list of which env maps to which file can be found in `.angular-cli.json`.
-
-import { versions } from './versions';
-
-export const environment = {
- production: false,
- version: versions.ngBootstrap,
- bootstrap: versions.bootstrap
-};
-
-/*
- * In development mode, to ignore zone related error stack frames such as
- * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
- * import the following file, but please comment it out in production mode
- * because it will have performance impact when throw error
- */
-// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
diff --git a/backup/demo/src/environments/versions.ts b/backup/demo/src/environments/versions.ts
deleted file mode 100644
index 1e0f1b5..0000000
--- a/backup/demo/src/environments/versions.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-// extracts only the minor version from package.json
-// ex. "bootstrap": "4.0.1" -> "4.0"
-let bootstrap: string = require('../../../package.json').devDependencies['bootstrap'];
-bootstrap = bootstrap.substr(0, bootstrap.lastIndexOf('.'));
-
-const ngBootstrap = require('../../../src/package.json').version;
-
-export const versions: {[key: string]: string} = { bootstrap, ngBootstrap };
diff --git a/backup/demo/src/main.ts b/backup/demo/src/main.ts
deleted file mode 100644
index cd68a95..0000000
--- a/backup/demo/src/main.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {enableProdMode} from '@angular/core';
-import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
-
-import {SbdModule} from './app/app.module';
-import {environment} from './environments/environment';
-
-// depending on the env mode, enable prod mode or add debugging modules
-if (environment.production) {
- enableProdMode();
-}
-
-platformBrowserDynamic().bootstrapModule(SbdModule);
diff --git a/backup/demo/src/polyfills.ts b/backup/demo/src/polyfills.ts
deleted file mode 100644
index 0d7f02f..0000000
--- a/backup/demo/src/polyfills.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * This file includes polyfills needed by Angular and is loaded before the app.
- * You can add your own extra polyfills to this file.
- *
- * This file is divided into 2 sections:
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
- * file.
- *
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
- * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
- * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
- *
- * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
- */
-
-/***************************************************************************************************
- * BROWSER POLYFILLS
- */
-import 'core-js/fn/object/values';
-
-/**
- * Required to support Web Animations `@angular/platform-browser/animations`.
- * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
- **/
-// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
-
-
-/***************************************************************************************************
- * Zone JS is required by default for Angular itself.
- */
-import 'zone.js/dist/zone'; // Included with Angular CLI.
-
-
-
-/***************************************************************************************************
- * APPLICATION IMPORTS
- */
diff --git a/backup/demo/src/public/img/favicon.ico b/backup/demo/src/public/img/favicon.ico
deleted file mode 100644
index c8eb88b..0000000
Binary files a/backup/demo/src/public/img/favicon.ico and /dev/null differ
diff --git a/backup/demo/src/public/img/github.svg b/backup/demo/src/public/img/github.svg
deleted file mode 100644
index aa05db9..0000000
--- a/backup/demo/src/public/img/github.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/backup/demo/src/public/img/link-symbol.svg b/backup/demo/src/public/img/link-symbol.svg
deleted file mode 100644
index 1f4fb6d..0000000
--- a/backup/demo/src/public/img/link-symbol.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/backup/demo/src/public/img/logo-stack.png b/backup/demo/src/public/img/logo-stack.png
deleted file mode 100644
index 1a02c71..0000000
Binary files a/backup/demo/src/public/img/logo-stack.png and /dev/null differ
diff --git a/backup/demo/src/public/img/logo-stack.svg b/backup/demo/src/public/img/logo-stack.svg
deleted file mode 100644
index d651733..0000000
--- a/backup/demo/src/public/img/logo-stack.svg
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/public/img/logo.svg b/backup/demo/src/public/img/logo.svg
deleted file mode 100644
index 4aa906e..0000000
--- a/backup/demo/src/public/img/logo.svg
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/backup/demo/src/public/img/ngb-logo.png b/backup/demo/src/public/img/ngb-logo.png
deleted file mode 100644
index 49997c9..0000000
Binary files a/backup/demo/src/public/img/ngb-logo.png and /dev/null differ
diff --git a/backup/demo/src/public/img/ngb-logo.svg b/backup/demo/src/public/img/ngb-logo.svg
deleted file mode 100644
index 27478e0..0000000
--- a/backup/demo/src/public/img/ngb-logo.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/public/img/stackblitz-icon.svg b/backup/demo/src/public/img/stackblitz-icon.svg
deleted file mode 100644
index 8c32ca2..0000000
--- a/backup/demo/src/public/img/stackblitz-icon.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/backup/demo/src/public/img/sunbird-logo.png b/backup/demo/src/public/img/sunbird-logo.png
deleted file mode 100644
index f29a234..0000000
Binary files a/backup/demo/src/public/img/sunbird-logo.png and /dev/null differ
diff --git a/backup/demo/src/public/index.html b/backup/demo/src/public/index.html
deleted file mode 100644
index 6ce5b2f..0000000
--- a/backup/demo/src/public/index.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
- Sunbird UI Components
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/backup/demo/src/style/app.scss b/backup/demo/src/style/app.scss
deleted file mode 100644
index ea736e7..0000000
--- a/backup/demo/src/style/app.scss
+++ /dev/null
@@ -1,405 +0,0 @@
-// styles in src/style directory are applied to the whole page
-
-header.navbar {
- background: #0d9474;
- background: -moz-linear-gradient(45deg, #0d9474 0%, #2a6fa8 100%);
- background: -o-linear-gradient(45deg, #0d9474 0%, #2a6fa8 100%);
- background: -webkit-linear-gradient(45deg, #0d9474 0%, #2a6fa8 100%);
- background: linear-gradient(45deg, #0d9474 0%, #2a6fa8 100%);
-}
-
-.masthead-followup {
- img {
- width: 64px;
- height: 64px;
- }
-}
-
-.footer {
- padding: 3rem 0;
- font-size: 0.85rem;
- text-align: left;
-
- p {
- margin-bottom: 0;
- }
-
- a {
- font-weight: 500;
- color: #000;
- text-decoration: underline;
- }
-}
-
-.social-buttons {
- svg {
- margin-left: 1rem;
- fill: #fff;
- }
-}
-
-.sidebar-collapsed {
- margin-left: -15px;
- margin-right: -15px;
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- cursor: pointer;
-}
-
-.sidebar {
- position: sticky;
- top: 1rem;
-}
-
-header.title {
- margin-left: -15px;
- margin-right: -15px;
- position: relative;
-
- .content-tabset {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
-
- .nav-link {
- border-style: solid;
- border-width: 3px 1px 1px;
- border-radius: 3px 3px 0 0;
- }
-
- .nav-link:not(.active):hover {
- border-color: transparent;
- }
-
- .active {
- border-top-color: #28a745;
- }
-
- .navigation-dropdown {
- cursor: pointer;
-
- .nav-link {
- padding-right: 0.3rem;
- line-height: 1em;
- border-color: transparent;
- background: none;
- color: #007bff;
- &:hover {
- color: #0056b3;
- }
- }
-
- .dropdown-toggle:after {
- display: none;
- }
-
- .dropdown-menu {
- border-color: #d9d9d9;
- }
-
- svg {
- width: 22px;
- height: 22px;
- }
-
- &.show {
- .nav-link {
- color: #0056b3;
- }
- }
- }
- }
-}
-
-.toc {
- margin-left: -15px;
- margin-right: -15px;
- font-size: 1.1rem;
-
- .toc-item {
- .toc-link {
- display: block;
- padding: 0.25rem 1.5rem;
- color: rgba(0, 0, 0, 0.65);
- }
-
- .nav > li > a {
- font-size: 0.85em;
-
- &:hover, &:focus {
- text-decoration: none;
- color:#0275d8;
- }
- }
-
- .nav > li.active > a {
- font-weight: 500;
- color: rgba(0, 0, 0, 0.85);
- }
-
- &.active > .toc-link {
- font-weight: 500;
- color: rgba(0, 0, 0, 0.85);
- }
- }
-}
-
-.contextual-nav .nav {
- position: sticky;
- top: 0;
-
- a {
- color: inherit;
- font-size: 90%;
- padding: .25rem 1rem;
- }
-
- a:hover {
- color: #0275d8;
- }
-}
-
-.deprecated {
- h3 {
- text-decoration: line-through;
- }
-
- h5 {
- display: inline-block;
- }
-
- td.label-cell code,
- p.signature,
- code.selector,
- code.export-as {
- text-decoration: line-through;
- }
-
- .description,
- .meta,
- .lead {
- opacity: 0.5;
- }
-}
-
-
-div.api-doc-component, .overview {
- margin-bottom: 3rem;
-
- h2,
- h3 {
- .github-link {
- transition: opacity 0.5s;
- opacity: 0.3;
- margin-left: .5rem;
- }
-
- &:hover {
- .github-link {
- opacity: 1;
- }
- & > .title-fragment {
- opacity: 1;
- }
- }
- }
-
- section, ngbd-overview-section {
- margin-top: 3rem;
- h4 {
- margin-top: 2rem;
- margin-bottom: 1rem;
- }
-
- .meta {
- font-size: 0.8rem;
- margin-bottom: 1rem;
- > div {
- margin-bottom: 0.5rem;
- }
- }
- }
-}
-
-ngbd-page-header {
- margin-top: 3rem;
-
- h2 {
- &:hover {
- & > .title-fragment {
- opacity: 1;
- }
- }
- }
-}
-
-a.title-fragment {
- opacity: 0;
- transition: opacity 125ms ease;
- line-height: inherit;
- position: absolute;
- margin-left: -1.2em;
- padding-right: 0.5em;
-
- & > img {
- width: 1em;
- height: 1em;
- }
-}
-
-div.component-demo {
- margin-bottom: 3rem;
- h2 {
- display: flex;
- margin-bottom: 1rem;
-
- span {
- flex-grow: 1;
- }
-
- .stackblitz, .toggle-code {
- display: flex;
- align-items: center;
- align-self: center;
- }
-
- .toggle-code svg {
- vertical-align: middle;
- fill: #28a745;
- }
-
- .stackblitz .stackblitz-icon {
- height: 1.2rem;
- margin-left: -0.5rem;
- }
-
- &:hover {
- & > .title-fragment {
- opacity: 1;
- }
- }
- }
-
- .tabset-code {
- ngb-tabset {
- .nav {
- padding: 0.5rem 1.25rem 0;
- font-size: 80%;
-
- .nav-link.active {
- background-color: #f5f2f0;
- border-bottom: 1px solid #f5f2f0;
- }
-
- .nav-link:not(.active) {
- color: #999;
- &:hover {
- color: #666;
- }
- }
- }
-
- .nav.nav-pills {
- border-right: 1px solid #dee2e6;
- padding-left: .75rem;
- padding-right: 0;
-
- .nav-link.active {
- color: #666;
- background-color: #f5f5f5;
- border: 1px solid #dee2e6;
- border-right-color: #f5f5f5;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
- margin-right: -1px;
- }
-
- & + .tab-content {
- flex: 1;
- overflow: hidden;
- }
- }
-
- pre {
- margin: 0;
- max-height: 500px;
- overflow: auto;
- }
- }
- }
-}
-
-.examples-legend {
- font-size: 80%;
-}
-
-ngbd-api-docs,
-ngbd-api-docs-class,
-ngbd-api-docs-config {
- display: block;
-
- &:not(:first-child) {
- margin-top: 3rem;
- border-top: 1px solid #999;
- padding-top: 1rem;
- }
-}
-
-.overview {
- .alert {
- border-left-width: 5px;
- border-radius: 0;
- padding-left: 0.5rem;
- padding-right: 0.5rem;
- }
-}
-
-// override prism theme background color to inline it with bootstrap colors
-code[class*='language-'],
-pre[class*='language-'], ngb-alert {
- background-color: #f5f5f5; // same as bootstrap card header
- border-radius: 3px;
-}
-
-span.token.tag {
- font-size: 1em;
- padding: 0;
-}
-
-// Right-To-Left layout for the Islamic Calendars
-ngb-datepicker.rtl {
- direction: rtl;
-}
-
-ngb-datepicker.rtl ngb-datepicker-navigation-select select.custom-select {
- background-position: left 0.25rem center;
-}
-
-ngb-datepicker.rtl .ngb-dp-arrow.right .ngb-dp-navigation-chevron {
- transform: rotate(-135deg);
- margin: 0 0 0 0.25rem;
-}
-
-ngb-datepicker.rtl .ngb-dp-navigation-chevron {
- transform: rotate(45deg);
- margin: 0 0.25rem 0 0;
-}
-
-ngb-datepicker.hebrew {
-
- .ngb-dp-day {
- width: 2.75rem;
- height: 2.75rem;
- line-height: 1rem;
- }
-
- .ngb-dp-weekday {
- width: 2.75rem;
- }
-}
-
-ngb-carousel {
- .carousel-item img {
- width: 100%;
- }
-}
diff --git a/backup/demo/src/style/demos.css b/backup/demo/src/style/demos.css
deleted file mode 100644
index d8dc584..0000000
--- a/backup/demo/src/style/demos.css
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Datepicker popup icon */
-
-button.calendar, button.calendar:active {
- width: 2.75rem;
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAcCAYAAAAEN20fAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEUSURBVEiJ7ZQxToVAEIY/YCHGxN6XGOIpnpaEsBSeQC9ArZbm9TZ6ADyBNzAhQGGl8Riv4BLAWAgmkpBYkH1b8FWT2WK/zJ8ZJ4qiI6XUI3ANnGKWBnht2/ZBDRK3hgVGNsCd7/ui+JkEIrKtqurLpEWaphd933+IyI3LEIdpCYCiKD6HcuOa/nwOa0ScJEnk0BJg0UTUWJRl6RxCYEzEmomsIlPU3IPW+grIAbquy+q6fluy/28RIBeRMwDXdXMgXLj/B2uimRXpui4D9sBeRLKl+1N+L+t6RwbWrZliTTTr1oxYtzVWiTQAcRxvTX+eJMnlUDaO1vpZRO5NS0x48sIwfPc87xg4B04MCzQi8hIEwe4bl1DnFMCN2zsAAAAASUVORK5CYII=') !important;
- background-repeat: no-repeat;
- background-size: 23px;
- background-position: center;
-}
-
-/* Sortable table demo */
-
-th[sortable] {
- cursor: pointer;
- user-select: none;
- -webkit-user-select: none;
-}
-
-th[sortable].desc:before, th[sortable].asc:before {
- content: '';
- display: block;
- background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAmxJREFUeAHtmksrRVEUx72fH8CIGQNJkpGUUmakDEiZSJRIZsRQmCkTJRmZmJgQE0kpX0D5DJKJgff7v+ru2u3O3vvc67TOvsdatdrnnP1Y///v7HvvubdbUiIhBISAEBACQkAICAEhIAQ4CXSh2DnyDfmCPEG2Iv9F9MPlM/LHyAecdyMzHYNwR3fdNK/OH9HXl1UCozD24TCvILxizEDWIEzA0FcM8woCgRrJCoS5PIwrANQSMAJX1LEI9bqpQo4JYNFFKRSvIgsxHDVnqZgIkPnNBM0rIGtYk9YOOsqgbgepRCfdbmFtqhFkVEDVPjJp0+Z6e6hRHhqBKgg6ZDCvYBygVmUoEGoh5JTRvIJwhJo1aUOoh4CLPMyvxxi7EWOMgnCGsXXI1GIXlZUYX7ucU+kbR8NW8lh3O7cue0Pk32MKndfUxQFAwxdirk3fHappAnc0oqDPzDfGTBrCfHP04dM4oTV8cxr0SVzH9FF07xD3ib6xCDE+M+aUcVygtWzzbtGX2rPBrEUYfecfQkaFzYi6HjVnGBdtL7epqAlc1+jRdAap74RrnPc4BCijttY2tRcdN0g17w7HqZrXhdJTYAuS3hd8z+vKgK3V1zWPae0mZDMykadBn1hTQBLnZNwVrJpSe/NwEeDsEwCctEOsJTsgxLvCqUl2ACftEGvJDgjxrnBqkh3ASTvEWrIDQrwrnJpkB3DSDrGW7IAQ7wqnJtkBnLRztejXXVu4+mxz/nQ9jR1w5VB86ejLTFcnnDwhzV+F6T+CHZlx6THSjn76eyyBIOPHyDakhBAQAkJACAgBISAEhIAQYCLwC8JxpAmsEGt6AAAAAElFTkSuQmCC') no-repeat;
- background-size: 22px;
- width: 22px;
- height: 22px;
- float: left;
- margin-left: -22px;
-}
-
-th[sortable].desc:before {
- transform: rotate(180deg);
- -ms-transform: rotate(180deg);
-}
-
-/* Filtering table demo */
-ngbd-table-filtering span.ngb-highlight {
- background-color: yellow;
-}
-
-/* Complete table demo */
-ngbd-table-complete span.ngb-highlight {
- background-color: yellow;
-}
-
-ngb-carousel .picsum-img-wrapper {
- position: relative;
- height: 0;
- padding-top: 55%; /* Keep ratio for 900x500 images */
-}
-
-ngb-carousel .picsum-img-wrapper>img {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
-}
diff --git a/backup/demo/tsconfig.json b/backup/demo/tsconfig.json
deleted file mode 100644
index f9d4b88..0000000
--- a/backup/demo/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "../tsconfig.json",
- "compilerOptions": {
- "baseUrl": "./",
- "outDir": "temp",
- "lib": ["es2017", "dom"],
- "paths": {
- "sunbird-ui-component": ["../src/index"],
- "@ng-bootstrap/ng-bootstrap": ["../src/index"]
- }
- },
- "include": [
- "./src/**/*.ts"
- ]
-}
diff --git a/backup/demo/tslint.json b/backup/demo/tslint.json
deleted file mode 100644
index ec365f1..0000000
--- a/backup/demo/tslint.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "../tslint.json"
-}
diff --git a/backup/misc/api-doc.spec.ts b/backup/misc/api-doc.spec.ts
deleted file mode 100644
index ff5a69b..0000000
--- a/backup/misc/api-doc.spec.ts
+++ /dev/null
@@ -1,264 +0,0 @@
-import {parseOutApiDocs as apiDoc} from './api-doc';
-
-describe('APIDocVisitor', () => {
-
- it('should return [] if there are no docs to extract',
- () => { expect(apiDoc(['./misc/api-doc-test-cases/no-docs.ts'])).toEqual({}); });
-
- it('should extract basic info from directives and components', () => {
- const docs = apiDoc(['misc/api-doc-test-cases/directives-no-in-out.ts']);
-
- expect(Object.keys(docs).length).toBe(2);
-
- expect(docs.Foo.fileName).toBe('misc/api-doc-test-cases/directives-no-in-out.ts');
- expect(docs.Foo.className).toBe('Foo');
- expect(docs.Foo.selector).toBe('[foo]');
- expect(docs.Foo.description).toBe('Foo doc
');
- expect(docs.Foo.exportAs).toBe('foo');
-
- expect(docs.Bar.fileName).toBe('misc/api-doc-test-cases/directives-no-in-out.ts');
- expect(docs.Bar.className).toBe('Bar');
- expect(docs.Bar.selector).toBe('bar');
- expect(docs.Bar.exportAs).toBeUndefined();
- expect(docs.Bar.description).toBe('Bar doc
');
- });
-
- it('should extract basic type info from classes', () => {
- const docs = apiDoc(['misc/api-doc-test-cases/types.ts']);
-
- expect(Object.keys(docs).length).toBe(5);
-
- expect(docs.NgbDirective.type).toBe('Directive');
- expect(docs.NgbComponent.type).toBe('Component');
- expect(docs.NgbService.type).toBe('Service');
- expect(docs.NgbClass.type).toBe('Class');
- expect(docs.NgbInterface.type).toBe('Interface');
- });
-
- it('should extract inputs info', () => {
- const inputDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-inputs.ts']).Foo.inputs;
-
- expect(inputDocs.length).toBe(3);
-
- expect(inputDocs[0].name).toBe('bar');
- expect(inputDocs[0].defaultValue).toBeUndefined();
- expect(inputDocs[0].type).toBe('string');
- expect(inputDocs[0].description).toBe('Bar doc
');
-
- expect(inputDocs[1].name).toBe('baz');
- expect(inputDocs[1].defaultValue).toBeUndefined();
- expect(inputDocs[1].type).toBe('string | boolean');
- expect(inputDocs[1].description).toBe('');
-
- expect(inputDocs[2].name).toBe('foo');
- expect(inputDocs[2].defaultValue).toBe('5');
- expect(inputDocs[2].type).toBe('number');
- expect(inputDocs[2].description).toBe('Has default value
');
- });
-
- it('should extract input default value', () => {
- const inputDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-inputs-default-vals.ts']).Foo.inputs;
-
- expect(inputDocs.length).toBe(3);
-
- expect(inputDocs[0].defaultValue).toBe('false');
- expect(inputDocs[1].defaultValue).toBe('5');
- expect(inputDocs[2].defaultValue).toBe('bar');
- });
-
- it('should extract inferred types', () => {
- const inputDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-inputs-types-to-infer.ts']).Foo.inputs;
-
- expect(inputDocs.length).toBe(3);
-
- expect(inputDocs[0].defaultValue).toBe('false');
- expect(inputDocs[0].type).toBe('boolean');
- expect(inputDocs[1].defaultValue).toBe('5');
- expect(inputDocs[1].type).toBe('number');
- expect(inputDocs[2].defaultValue).toBe('bar');
- expect(inputDocs[2].type).toBe('string');
- });
-
- it('should extract inputs info from setters', () => {
- const inputDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-tricky-inputs.ts']).Foo.inputs;
-
- expect(inputDocs.length).toBe(3);
-
- expect(inputDocs[0].name).toBe('bar');
- expect(inputDocs[1].name).toBe('baz');
- expect(inputDocs[2].name).toBe('foo');
- });
-
- it('should extract outputs info', () => {
- const outDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-outputs.ts']).Foo.outputs;
-
- expect(outDocs.length).toBe(2);
-
- expect(outDocs[0].name).toBe('myEvent');
- expect(outDocs[0].description).toBe('Desc
');
-
- expect(outDocs[1].name).toBe('myMappedEvent');
- });
-
- it('should extract public methods info', () => {
- const methodDocs = apiDoc(['./misc/api-doc-test-cases/directives-with-methods.ts']).Foo.methods;
-
- expect(methodDocs.length).toBe(1);
- expect(methodDocs[0].name).toBe('fooMethod');
- expect(methodDocs[0].description).toBe('Use this one to produce foo!
');
- expect(methodDocs[0].args.length).toBe(3);
- expect(methodDocs[0].args[0].name).toBe('arg1');
- expect(methodDocs[0].args[0].type).toBe('string');
- expect(methodDocs[0].args[1].name).toBe('arg2');
- expect(methodDocs[0].args[1].type).toBe('any');
- expect(methodDocs[0].args[2].name).toBe('arg3');
- expect(methodDocs[0].args[2].type).toBe('number');
- });
-
- it('should not extract public methods info when annotated with @internal', () => {
- const methodDocs = apiDoc(['./misc/api-doc-test-cases/component-with-internal-methods.ts']).Foo.methods;
-
- expect(methodDocs.length).toBe(0);
- });
-
- it('should extract documentation from services', () => {
- const serviceDocs = apiDoc(['./misc/api-doc-test-cases/services-with-methods.ts']).ModalService;
-
- expect(serviceDocs.fileName).toBe('./misc/api-doc-test-cases/services-with-methods.ts');
- expect(serviceDocs.className).toBe('ModalService');
- expect(serviceDocs.description).toBe('A service to open modals
');
- expect(serviceDocs.methods.length).toBe(2);
-
- expect(serviceDocs.methods[0].name).toBe('open');
- expect(serviceDocs.methods[0].description).toBe('A method to open a modal
');
- expect(serviceDocs.methods[0].args.length).toBe(2);
- expect(serviceDocs.methods[0].returnType).toBe('Promise');
-
- expect(serviceDocs.methods[1].name).toBe('isOpen');
- expect(serviceDocs.methods[1].description).toBe('Checks if a modal is open
');
- expect(serviceDocs.methods[1].args.length).toBe(0);
- expect(serviceDocs.methods[1].returnType).toBe('boolean');
- });
-
- it('should extract documentation of properties from services', () => {
- const serviceDocs = apiDoc(['./misc/api-doc-test-cases/services-with-properties.ts']).ProgressbarConfig;
-
- expect(serviceDocs.properties.length).toBe(3);
-
- expect(serviceDocs.properties[0].name).toBe('foo');
- expect(serviceDocs.properties[0].description).toBe('Voluntarily left without a default value.
');
- expect(serviceDocs.properties[0].type).toBe('string');
- expect(serviceDocs.properties[0].defaultValue).toBeUndefined();
-
- expect(serviceDocs.properties[1].name).toBe('max');
- expect(serviceDocs.properties[1].description).toBe('Maximal value to be displayed in the progressbar.
');
- expect(serviceDocs.properties[1].type).toBe('number');
- expect(serviceDocs.properties[1].defaultValue).toBe('100');
-
- expect(serviceDocs.properties[2].name).toBe('noDescriptionButStillExtract');
- expect(serviceDocs.properties[2].description).toBe('');
- expect(serviceDocs.properties[2].type).toBe('string');
- expect(serviceDocs.properties[2].defaultValue).toBe('sth');
- });
-
- it('should extract documentation from interfaces', () => {
- const interfaceDocs = apiDoc(['./misc/api-doc-test-cases/interface-with-properties.ts']).NgbModalOptions;
-
- expect(interfaceDocs.className).toBe('NgbModalOptions');
- expect(interfaceDocs.description).toBe('Represent options available when opening new modal windows.
');
- expect(interfaceDocs.properties.length).toBe(3);
-
- expect(interfaceDocs.properties[0].name).toBe('backdrop');
- expect(interfaceDocs.properties[0].description)
- .toContain('Weather a backdrop element should be created for a given modal (true by default).');
- expect(interfaceDocs.properties[0].type).toBe('boolean | "static"');
- expect(interfaceDocs.properties[0].defaultValue).toBeUndefined();
-
- expect(interfaceDocs.properties[1].name).toBe('keyboard');
- expect(interfaceDocs.properties[1].description)
- .toBe('Weather to close the modal when escape key is pressed (true by default).
');
- expect(interfaceDocs.properties[1].type).toBe('boolean');
- expect(interfaceDocs.properties[1].defaultValue).toBeUndefined();
-
- expect(interfaceDocs.properties[2].name).toBe('size');
- expect(interfaceDocs.properties[2].description).toBe('Size of a new modal window.
');
- expect(interfaceDocs.properties[2].type).toBe('"sm" | "lg" | "xl"');
- expect(interfaceDocs.properties[2].defaultValue).toBeUndefined();
- });
-
- it('should extract method documentation from interfaces', () => {
- const interfaceDocs = apiDoc(['./misc/api-doc-test-cases/interface-with-methods.ts']).SomeInterface;
-
- expect(interfaceDocs.className).toBe('SomeInterface');
- expect(interfaceDocs.description).toBe('Some interface
');
- expect(interfaceDocs.methods.length).toBe(1);
-
- expect(interfaceDocs.methods[0].name).toBe('foo');
- expect(interfaceDocs.methods[0].description).toContain('does something');
- expect(interfaceDocs.methods[0].returnType).toBe('void');
- });
-
- it('should extract documentation from documented classes', () => {
- const classDocs = apiDoc(['./misc/api-doc-test-cases/class-with-doc.ts']).DocumentedFoo;
-
- expect(classDocs.className).toBe('DocumentedFoo');
- expect(classDocs.description).toBe('This is a documented foo
');
-
- expect(classDocs.properties.length).toBe(2);
-
- expect(classDocs.properties[0].name).toBe('bar');
- expect(classDocs.properties[0].description).toBe('the bar
');
- expect(classDocs.properties[0].type).toBe('string');
-
- expect(classDocs.properties[1].name).toBe('componentInstance');
- expect(classDocs.properties[1].description).toBe('A getter
');
- expect(classDocs.properties[1].type).toBe('any');
-
- expect(classDocs.methods.length).toBe(1);
-
- expect(classDocs.methods[0].name).toBe('someMethod');
- expect(classDocs.methods[0].description).toBe('some method
');
- expect(classDocs.methods[0].returnType).toBe('void');
- });
-
- it('should extract deprecation information', () => {
- const docs = apiDoc(['misc/api-doc-test-cases/release-deprecation.ts']);
-
- expect(docs.NgbDirective.deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbComponent.deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbService.deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbClass.deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbInterface.deprecated).toEqual({version: '2.0.0', description: 'description'});
-
- expect(docs.NgbDirective.inputs[0].deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbDirective.outputs[0].deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbDirective.properties[0].deprecated).toEqual({version: '2.0.0', description: 'description'});
- expect(docs.NgbDirective.methods[0].deprecated).toEqual({version: '2.0.0', description: 'description'});
- });
-
- it('should extract feature introduction information', () => {
- const docs = apiDoc(['misc/api-doc-test-cases/release-features.ts']);
-
- expect(docs.NgbDirective.since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbComponent.since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbService.since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbClass.since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbInterface.since).toEqual({version: '2.0.0', description: ''});
-
- expect(docs.NgbDirective.inputs[0].since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbDirective.outputs[0].since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbDirective.properties[0].since).toEqual({version: '2.0.0', description: ''});
- expect(docs.NgbDirective.methods[0].since).toEqual({version: '2.0.0', description: ''});
- });
-
- it('should extract class and interface type parameters', () => {
- const docs = apiDoc(['misc/api-doc-test-cases/type-parameters.ts']);
-
- expect(docs.NoParameterComponent.typeParameter).toBeUndefined();
- expect(docs.ParameterComponent.typeParameter).toEqual('C');
- expect(docs.NoParameterInterface.typeParameter).toBeUndefined();
- expect(docs.ParameterInterface.typeParameter).toEqual('I = NoParameterInterface');
- expect(docs.NoParameterService.typeParameter).toBeUndefined();
- expect(docs.ParameterService.typeParameter).toEqual('S = number');
- });
-});
diff --git a/backup/misc/api-doc.ts b/backup/misc/api-doc.ts
deleted file mode 100644
index a3f2233..0000000
--- a/backup/misc/api-doc.ts
+++ /dev/null
@@ -1,362 +0,0 @@
-// tslint:disable:no-bitwise
-import {
- createProgram,
- displayPartsToString,
- getCombinedModifierFlags,
- ModifierFlags,
- Program,
- SyntaxKind,
- TypeChecker
-} from 'typescript';
-
-import * as marked from 'marked';
-
-function displayPartsToHtml(displayParts: any): string {
- return marked(displayPartsToString(displayParts), {gfm: true}).trim();
-}
-
-function getNamesCompareFn(name = 'name') {
- return (a, b) => a[name].localeCompare(b[name]);
-}
-
-const ANGULAR_LIFECYCLE_METHODS = [
- 'ngOnInit', 'ngOnChanges', 'ngDoCheck', 'ngOnDestroy', 'ngAfterContentInit', 'ngAfterContentChecked',
- 'ngAfterViewInit', 'ngAfterViewChecked', 'writeValue', 'registerOnChange', 'registerOnTouched', 'setDisabledState'
-];
-
-function hasNoJSDoc(member, typeChecker) {
- if (!member.symbol) {
- return true;
- }
-
- const jsDoc = displayPartsToHtml(member.symbol.getDocumentationComment(typeChecker));
- return jsDoc.trim().length === 0;
-}
-
-function isInternalMember(member) {
- if (member.jsDoc && member.jsDoc.length > 0) {
- for (let i = 0; i < member.jsDoc.length; i++) {
- if (member.jsDoc[i].tags && member.jsDoc[i].tags.length > 0) {
- for (let j = 0; j < member.jsDoc[i].tags.length; j++) {
- if (member.jsDoc[i].tags[j].tagName.text === 'internal') {
- return true;
- }
- }
- }
- }
- }
-
- return false;
-}
-
-function isAngularLifecycleHook(methodName) {
- return ANGULAR_LIFECYCLE_METHODS.includes(methodName);
-}
-
-function isPrivate(member) {
- return (getCombinedModifierFlags(member) & ModifierFlags.Private) !== 0;
-}
-
-function isPrivateOrInternal(member, typeChecker) {
- return isPrivate(member) || hasNoJSDoc(member, typeChecker) || isInternalMember(member);
-}
-
-function getJsDocTags(symbol) {
- // clang-format off
- return !symbol ? {}
- : symbol.getJsDocTags()
- .filter(el => ['deprecated', 'since'].includes(el.name))
- .reduce(
- (obj, el) => {
- const[version, ...rest] = el.text.split(' ');
- obj[el.name] = {version, description: rest.join(' ').trim()};
- return obj;
- }, {}
- );
- // clang-format on
-}
-
-function getTypeParameter(program, declaration) {
- // getting type of 'Class '
- const type = program.getTypeChecker().getTypeAtLocation(declaration);
-
- // checking if '<...>' part is present
- if (type.typeParameters) {
- // getting 'T' parameter from declaration
- const parameter = type.typeParameters[0].symbol;
- let parameterString = parameter.getName();
-
- // checking if there is a default type value (ex. '= number')
- const defaultType = program.getTypeChecker().getTypeAtLocation(parameter.getDeclarations()[0].default);
-
- // default type can be 'unknown', 'error', base type (ex. 'number') or another symbol
- if (defaultType && !['error', 'unknown'].includes(defaultType.intrinsicName)) {
- parameterString +=
- defaultType.intrinsicName ? ` = ${defaultType.intrinsicName}` : ` = ${defaultType.symbol.getName()}`;
- }
- return parameterString;
- } else {
- return undefined;
- }
-}
-
-class APIDocVisitor {
- private readonly program: Program;
- private readonly typeChecker: TypeChecker;
-
- constructor(fileNames: string[]) {
- this.program = createProgram(fileNames, {lib: ['lib.es6.d.ts']});
- this.typeChecker = this.program.getTypeChecker();
- }
-
- visitSourceFile(fileName: string) {
- const sourceFile = this.program.getSourceFile(fileName);
-
- if (!sourceFile) {
- throw new Error(`File doesn't exist: ${fileName}.`);
- }
-
- return sourceFile.statements.reduce((directivesSoFar, statement) => {
- if (statement.kind === SyntaxKind.ClassDeclaration) {
- return directivesSoFar.concat(this.visitClassDeclaration(fileName, statement));
- } else if (statement.kind === SyntaxKind.InterfaceDeclaration) {
- return directivesSoFar.concat(this.visitInterfaceDeclaration(fileName, statement));
- }
-
- return directivesSoFar;
- }, []);
- }
-
- visitInterfaceDeclaration(fileName, interfaceDeclaration) {
- const symbol = this.typeChecker.getSymbolAtLocation(interfaceDeclaration.name);
- const description = displayPartsToHtml(symbol.getDocumentationComment(this.typeChecker));
- const {deprecated, since} = getJsDocTags(symbol);
- const className = interfaceDeclaration.name.text;
- const typeParameter = getTypeParameter(this.program, interfaceDeclaration.name);
- const members = this.visitMembers(interfaceDeclaration.members);
-
- return [{
- fileName,
- className,
- description,
- deprecated,
- since,
- typeParameter,
- type: 'Interface',
- methods: members.methods,
- properties: members.properties
- }];
- }
-
- visitClassDeclaration(fileName, classDeclaration) {
- const symbol = this.typeChecker.getSymbolAtLocation(classDeclaration.name);
- const description = displayPartsToHtml(symbol.getDocumentationComment(this.typeChecker));
- const {deprecated, since} = getJsDocTags(symbol);
- const className = classDeclaration.name.text;
- const typeParameter = getTypeParameter(this.program, classDeclaration.name);
- const decorators = classDeclaration.decorators;
- let directiveInfo;
- let members;
-
- // If there is no top documentation comment, consider it private, we skip it.
- if (!description) {
- return [];
- }
-
- if (decorators) {
- for (let i = 0; i < decorators.length; i++) {
- if (this.isDirectiveDecorator(decorators[i])) {
- directiveInfo = this.visitDirectiveDecorator(decorators[i]);
- members = this.visitMembers(classDeclaration.members);
-
- return [{
- fileName,
- className,
- description,
- deprecated,
- since,
- typeParameter,
- type: directiveInfo.type,
- selector: directiveInfo.selector,
- exportAs: directiveInfo.exportAs,
- inputs: members.inputs,
- outputs: members.outputs,
- properties: members.properties,
- methods: members.methods
- }];
- } else if (this.isServiceDecorator(decorators[i])) {
- members = this.visitMembers(classDeclaration.members);
-
- return [{
- fileName,
- className,
- description,
- deprecated,
- since,
- typeParameter,
- type: 'Service',
- methods: members.methods,
- properties: members.properties
- }];
- }
- }
- } else if (description) {
- members = this.visitMembers(classDeclaration.members);
-
- return [{
- fileName,
- className,
- description,
- deprecated,
- since,
- type: 'Class',
- methods: members.methods,
- properties: members.properties
- }];
- }
-
- // a class that is not a directive or a service, not documented for now
- return [];
- }
-
- visitDirectiveDecorator(decorator) {
- let selector;
- let exportAs;
- const properties = decorator.expression.arguments[0].properties;
- const type = decorator.expression.expression.text;
-
- for (let i = 0; i < properties.length; i++) {
- if (properties[i].name.text === 'selector') {
- // TODO: this will only work if selector is initialized as a string literal
- selector = properties[i].initializer.text;
- }
- if (properties[i].name.text === 'exportAs') {
- // TODO: this will only work if selector is initialized as a string literal
- exportAs = properties[i].initializer.text;
- }
- }
-
- return {selector, exportAs, type};
- }
-
- visitMembers(members) {
- const inputs = [];
- const outputs = [];
- const methods = [];
- const properties = [];
- let inputDecorator, outDecorator;
-
- for (let i = 0; i < members.length; i++) {
- inputDecorator = this.getDecoratorOfType(members[i], 'Input');
- outDecorator = this.getDecoratorOfType(members[i], 'Output');
- const {deprecated, since} = getJsDocTags(members[i].symbol);
- const releaseInfo = {deprecated, since};
-
- if (inputDecorator) {
- inputs.push(Object.assign(this.visitInput(members[i], inputDecorator), releaseInfo));
-
- } else if (outDecorator) {
- outputs.push(Object.assign(this.visitOutput(members[i], outDecorator), releaseInfo));
-
- } else if (
- (members[i].kind === SyntaxKind.MethodDeclaration || members[i].kind === SyntaxKind.MethodSignature) &&
- !isAngularLifecycleHook(members[i].name.text) && !isPrivateOrInternal(members[i], this.typeChecker)) {
- methods.push(Object.assign(this.visitMethodDeclaration(members[i]), releaseInfo));
- } else if (
- (members[i].kind === SyntaxKind.PropertyDeclaration || members[i].kind === SyntaxKind.PropertySignature ||
- members[i].kind === SyntaxKind.GetAccessor) &&
- !isPrivate(members[i]) && !isInternalMember(members[i])) {
- properties.push(Object.assign(this.visitProperty(members[i]), releaseInfo));
- }
- }
-
- inputs.sort(getNamesCompareFn());
- outputs.sort(getNamesCompareFn());
- properties.sort(getNamesCompareFn());
-
- return {inputs, outputs, methods, properties};
- }
-
- visitMethodDeclaration(method) {
- return {
- name: method.name.text,
- description: displayPartsToHtml(method.symbol.getDocumentationComment(this.typeChecker)),
- args: method.parameters ? method.parameters.map((prop) => this.visitArgument(prop)) : [],
- returnType: this.visitType(method.type)
- };
- }
-
- visitArgument(arg) { return {name: arg.name.text, type: this.visitType(arg)}; }
-
- visitInput(property, inDecorator) {
- const inArgs = inDecorator.expression.arguments;
- return {
- name: inArgs.length ? inArgs[0].text : property.name.text,
- defaultValue: property.initializer ? this.stringifyDefaultValue(property.initializer) : undefined,
- type: this.visitType(property),
- description: displayPartsToHtml(property.symbol.getDocumentationComment(this.typeChecker))
- };
- }
-
- stringifyDefaultValue(node) {
- if (node.text) {
- return node.text;
- } else if (node.kind === SyntaxKind.FalseKeyword) {
- return 'false';
- } else if (node.kind === SyntaxKind.TrueKeyword) {
- return 'true';
- }
- }
-
- visitOutput(property, outDecorator) {
- const outArgs = outDecorator.expression.arguments;
- return {
- name: outArgs.length ? outArgs[0].text : property.name.text,
- description: displayPartsToHtml(property.symbol.getDocumentationComment(this.typeChecker))
- };
- }
-
- visitProperty(property) {
- return {
- name: property.name.text,
- defaultValue: property.initializer ? this.stringifyDefaultValue(property.initializer) : undefined,
- type: this.visitType(property),
- description: displayPartsToHtml(property.symbol.getDocumentationComment(this.typeChecker))
- };
- }
-
- visitType(node) { return node ? this.typeChecker.typeToString(this.typeChecker.getTypeAtLocation(node)) : 'void'; }
-
- isDirectiveDecorator(decorator) {
- const decoratorIdentifierText = decorator.expression.expression.text;
- return decoratorIdentifierText === 'Directive' || decoratorIdentifierText === 'Component';
- }
-
- isServiceDecorator(decorator) { return decorator.expression.expression.text === 'Injectable'; }
-
- getDecoratorOfType(node, decoratorType) {
- const decorators = node.decorators || [];
-
- for (let i = 0; i < decorators.length; i++) {
- if (decorators[i].expression.expression.text === decoratorType) {
- return decorators[i];
- }
- }
-
- return null;
- }
-}
-
-export function parseOutApiDocs(programFiles: string[]): any {
- const apiDocVisitor = new APIDocVisitor(programFiles);
-
- return programFiles.reduce(
- (soFar, file) => {
- const directivesInFile = apiDocVisitor.visitSourceFile(file);
-
- directivesInFile.forEach((directive) => { soFar[directive.className] = directive; });
-
- return soFar;
- },
- {});
-}
diff --git a/backup/misc/copy-static-files.ts b/backup/misc/copy-static-files.ts
deleted file mode 100644
index dec7428..0000000
--- a/backup/misc/copy-static-files.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import {copyFileSync} from 'fs';
-
-/**
- * Copies missing required static assets after the ng-bootstap build
- */
-
-//['LICENSE', 'README.md'].forEach(file => copyFileSync(file, `dist/sunbird-ui-components/${file}`));
diff --git a/backup/misc/preinstall.js b/backup/misc/preinstall.js
deleted file mode 100644
index 4561aa2..0000000
--- a/backup/misc/preinstall.js
+++ /dev/null
@@ -1,13 +0,0 @@
-if (process.env.npm_execpath.indexOf('yarn') === -1) {
- throw new Error(`
-
- ###################################################
- # #
- # Please use Yarn > 1.3 to install dependencies #
- # #
- # 1. Install yarn (https://yarnpkg.com/) #
- # 2. Run 'yarn' instead of 'npm install' #
- # #
- ###################################################
- `);
-}
diff --git a/backup/misc/tsconfig.json b/backup/misc/tsconfig.json
deleted file mode 100644
index 69eb7d8..0000000
--- a/backup/misc/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "compilerOptions": {
- "target": "es2015",
- "module": "commonjs",
- "lib": ["es2017"]
- },
- "include": [
- "./*.ts"
- ]
-}
diff --git a/backup/package.json b/backup/package.json
deleted file mode 100644
index 4d763ed..0000000
--- a/backup/package.json
+++ /dev/null
@@ -1,119 +0,0 @@
-{
- "name": "sunbird-ui-components",
- "version": "1.0.0",
- "description": "Sunbird UI Components",
- "author": "https://github.com/Sunbird-Ed/sunbird-ui-components/graphs/contributors",
- "engines": {
- "node": ">=10.9",
- "yarn": ">=1.3.0 <2.0.0"
- },
- "scripts": {
- "preinstall": "",
- "build": "yarn sb:build && yarn demo:build",
- "test": "yarn check-format && yarn sb:lint && yarn sb:test",
- "tdd": "yarn sb:tdd",
- "e2e": "yarn e2e-app:lint && yarn sb:e2e",
- "demo": "yarn demo:docs && yarn demo:stackblitzes && yarn demo:serve",
- "ssr": "yarn ssr-app:lint && yarn ssr-app:build && yarn ssr-app:e2e",
- "changelog": "conventional-changelog --preset angular --infile CHANGELOG.md --same-file --release-count 1",
- "saucelabs:ie": "ng test sunbird-ui-components --configuration ie --karma-config src/karma-ie.sauce.conf.js --source-map false --progress false",
- "scripts:tdd": "ts-node-dev --respawn --project misc/tsconfig.json node_modules/jasmine/bin/jasmine misc/*.spec.ts",
- "scripts:test": "ts-node --project misc/tsconfig.json node_modules/jasmine/bin/jasmine misc/*.spec.ts",
- "sb:static": "ts-node --project misc/tsconfig.json misc/copy-static-files.ts",
- "sb:lint": "ng lint sunbird-ui-components",
- "sb:test": "ng test sunbird-ui-components --code-coverage --source-map true --progress false --watch false",
- "sb:tdd": "ng test sunbird-ui-components --source-map false",
- "sb:e2e": "ng e2e e2e-app",
- "sb:e2e-noserve": "ng e2e e2e-app -c noserve",
- "sb:build": "ng build sunbird-ui-components --prod && yarn sb:static",
- "demo:serve": "ng serve demo --host 0.0.0.0",
- "demo:docs": "ts-node --project misc/tsconfig.json misc/generate-docs.ts",
- "demo:stackblitzes": "ts-node --project misc/tsconfig.json misc/generate-stackblitzes.ts",
- "demo:lint": "ng lint demo",
- "demo:build": "yarn demo:lint && yarn demo:docs && yarn demo:stackblitzes && ng build demo --prod",
- "demo:deploy": "yarn demo:build && yarn demo:push",
- "demo:publish": "gh-pages --dist demo/dist --branch master --repo https://github.com/Sunbird-Ed/sunbird-ui-components.github.io.git",
- "ssr-app:lint": "ng lint ssr-app",
- "ssr-app:serve": "ng serve ssr-app --host 0.0.0.0",
- "ssr-app:serve-express": "node ssr-app/dist/server",
- "ssr-app:e2e": "concurrently --success first --kill-others --names \"express,protractor\" \"yarn ssr-app:serve-express\" \"ng e2e ssr-app\"",
- "ssr-app:build": "ng build ssr-app --prod && ng run ssr-app:server:production && yarn ssr-app:build-server",
- "ssr-app:build-server": "webpack --config ssr-app/webpack.server.config.js --colors",
- "ci": "yarn test && yarn e2e && yarn build --progress false && yarn ssr"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/Sunbird-Ed/sunbird-ui-components.git"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/Sunbird-Ed/sunbird-ui-components/issues"
- },
- "homepage": "https://github.com/Sunbird-Ed/sunbird-ui-components#readme",
- "dependencies": {},
- "devDependencies": {
- "@angular-devkit/build-angular": "~0.800.0",
- "@angular-devkit/build-ng-packagr": "~0.800.0",
- "@angular/animations": "8.0.0",
- "@angular/cli": "^8.0.0",
- "@angular/common": "8.0.0",
- "@angular/compiler": "8.0.0",
- "@angular/compiler-cli": "8.0.0",
- "@angular/core": "8.0.0",
- "@angular/forms": "8.0.0",
- "@angular/platform-browser": "8.0.0",
- "@angular/platform-browser-dynamic": "8.0.0",
- "@angular/platform-server": "8.0.0",
- "@angular/router": "8.0.0",
- "@nguniversal/express-engine": "8.0.0-rc.1",
- "@nguniversal/module-map-ngfactory-loader": "8.0.0-rc.1",
- "@types/express": "^4.16.1",
- "@types/fs-extra": "^7.0.0",
- "@types/glob": "^7.1.1",
- "@types/he": "^1.1.0",
- "@types/jasmine": "~3.3.8",
- "@types/jasminewd2": "~2.0.3",
- "@types/marked": "^0.6.1",
- "@types/node": "~10.9.0",
- "@types/prismjs": "1.16.0",
- "bootstrap": "4.3.1",
- "clang-format": "1.0.35",
- "concurrently": "^4.1.0",
- "conventional-changelog-cli": "^2.0.12",
- "core-js": "^2",
- "ejs": "2.6.1",
- "express": "^4.16.4",
- "fs-extra": "^8.0.0",
- "gh-pages": "^2.0.1",
- "glob": "^7.1.1",
- "gulp": "^3.9.1",
- "gulp-clang-format": "1.0.23",
- "jasmine": "~3.4.0",
- "jasmine-core": "~3.4.0",
- "jasmine-spec-reporter": "~4.2.1",
- "karma": "~4.1.0",
- "karma-chrome-launcher": "~2.2.0",
- "karma-coverage-istanbul-reporter": "~2.0.1",
- "karma-firefox-launcher": "^1.0.0",
- "karma-jasmine": "~2.0.1",
- "karma-sauce-launcher": "^2.0.2",
- "marked": "^0.6.1",
- "ng-packagr": "^5.2.0",
- "ngx-build-plus": "^8.0.0-rc.3.0.1",
- "nyc": "14.1.1",
- "prismjs": "1.16.0",
- "protractor": "~5.4.0",
- "rxjs": "6.4.0",
- "ts-loader": "^6.0.1",
- "ts-node": "^8.2.0",
- "ts-node-dev": "^1.0.0-pre.30",
- "tsickle": "^0.35.0",
- "tslib": "^1.9.0",
- "tslint": "^5.16.0",
- "tslint-jasmine-rules": "^1.3.2",
- "typescript": "~3.4.3",
- "webpack": "^4.29.5",
- "webpack-cli": "^3.2.3",
- "zone.js": "~0.9.1"
- }
-}
diff --git a/backup/src/accordion/accordion-config.spec.ts b/backup/src/accordion/accordion-config.spec.ts
deleted file mode 100644
index 3245062..0000000
--- a/backup/src/accordion/accordion-config.spec.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import {NgbAccordionConfig} from './accordion-config';
-
-describe('ngb-accordion-config', () => {
- it('should have sensible default values', () => {
- const config = new NgbAccordionConfig();
-
- expect(config.closeOthers).toBe(false);
- expect(config.type).toBeUndefined();
- });
-});
diff --git a/backup/src/accordion/accordion-config.ts b/backup/src/accordion/accordion-config.ts
deleted file mode 100644
index ae9c244..0000000
--- a/backup/src/accordion/accordion-config.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Injectable} from '@angular/core';
-
-/**
- * A configuration service for the [NgbAccordion](#/components/accordion/api#NgbAccordion) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all accordions used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class NgbAccordionConfig {
- closeOthers = false;
- type: string;
-}
diff --git a/backup/src/accordion/accordion.module.ts b/backup/src/accordion/accordion.module.ts
deleted file mode 100644
index cb51d34..0000000
--- a/backup/src/accordion/accordion.module.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-
-import {NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle} from './accordion';
-
-export {
- NgbAccordion,
- NgbPanel,
- NgbPanelTitle,
- NgbPanelContent,
- NgbPanelChangeEvent,
- NgbPanelHeader,
- NgbPanelHeaderContext,
- NgbPanelToggle
-} from './accordion';
-export {NgbAccordionConfig} from './accordion-config';
-
-const NGB_ACCORDION_DIRECTIVES =
- [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle];
-
-@NgModule({declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule]})
-export class NgbAccordionModule {
-}
diff --git a/backup/src/accordion/accordion.spec.ts b/backup/src/accordion/accordion.spec.ts
deleted file mode 100644
index 0d6dc5c..0000000
--- a/backup/src/accordion/accordion.spec.ts
+++ /dev/null
@@ -1,844 +0,0 @@
-import {TestBed, ComponentFixture, inject} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {NgbAccordionModule, NgbPanelChangeEvent, NgbAccordionConfig, NgbAccordion} from './accordion.module';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getPanels(element: HTMLElement): HTMLDivElement[] {
- return Array.from(element.querySelectorAll('.card > .card-header'));
-}
-
-function getPanelsContent(element: HTMLElement): HTMLDivElement[] {
- return Array.from(element.querySelectorAll('.card > .collapse'));
-}
-
-function getPanelsTitle(element: HTMLElement): HTMLButtonElement[] {
- return Array.from(element.querySelectorAll('.card > .card-header button'));
-}
-
-function getButton(element: HTMLElement, index: number): HTMLButtonElement {
- return element.querySelectorAll('button[type="button"]')[index];
-}
-
-function expectOpenPanels(nativeEl: HTMLElement, openPanelsDef: boolean[]) {
- const noOfOpenPanels = openPanelsDef.reduce((soFar, def) => def ? soFar + 1 : soFar, 0);
- const panels = getPanels(nativeEl);
- expect(panels.length).toBe(openPanelsDef.length);
-
- const panelsTitles = getPanelsTitle(nativeEl);
- const result = panelsTitles.map((titleEl: HTMLButtonElement) => {
- const isAriaExpanded = titleEl.getAttribute('aria-expanded') === 'true';
- const isCSSCollapsed = titleEl.classList.contains('collapsed');
- return isAriaExpanded === !isCSSCollapsed ? isAriaExpanded : fail('inconsistent state');
- });
-
- const panelContents = getPanelsContent(nativeEl);
- panelContents.forEach(
- (panelContent: HTMLDivElement) => { expect(panelContent.classList.contains('show')).toBeTruthy(); });
-
- expect(panelContents.length).toBe(noOfOpenPanels);
- expect(result).toEqual(openPanelsDef);
-}
-
-describe('ngb-accordion', () => {
- let html = `
-
-
- {{panel.title}}
- {{panel.content}}
-
-
- Toggle the panel {{ panel.id }}
- `;
-
- beforeEach(() => {
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbAccordionModule]});
- TestBed.overrideComponent(TestComponent, {set: {template: html}});
- });
-
- it('should initialize inputs with default values', () => {
- const defaultConfig = new NgbAccordionConfig();
- const accordionCmp = new NgbAccordion(defaultConfig);
- expect(accordionCmp.type).toBe(defaultConfig.type);
- expect(accordionCmp.closeOtherPanels).toBe(defaultConfig.closeOthers);
- });
-
- it('should have no open panels', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const accordionEl = fixture.nativeElement.children[0];
- const el = fixture.nativeElement;
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
- expect(accordionEl.getAttribute('role')).toBe('tablist');
- expect(accordionEl.getAttribute('aria-multiselectable')).toBe('true');
- });
-
- it('should have proper css classes', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const accordion = fixture.debugElement.query(By.directive(NgbAccordion));
- expect(accordion.nativeElement).toHaveCssClass('accordion');
- });
-
- it('should toggle panels based on "activeIds" values', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
- const el = fixture.nativeElement;
- // as array
- tc.activeIds = ['one', 'two'];
- fixture.detectChanges();
- expectOpenPanels(el, [true, true, false]);
-
- tc.activeIds = ['two', 'three'];
- fixture.detectChanges();
- expectOpenPanels(el, [false, true, true]);
-
- tc.activeIds = [];
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
-
- tc.activeIds = ['wrong id', 'one'];
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
-
- // as string
- tc.activeIds = 'one';
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
-
- tc.activeIds = 'two, three';
- fixture.detectChanges();
- expectOpenPanels(el, [false, true, true]);
-
- tc.activeIds = '';
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
-
- tc.activeIds = 'wrong id,one';
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
- });
-
-
- it('should toggle panels independently', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const el = fixture.nativeElement;
-
- getButton(el, 1).click();
- fixture.detectChanges();
- expectOpenPanels(el, [false, true, false]);
-
- getButton(el, 0).click();
- fixture.detectChanges();
- expectOpenPanels(el, [true, true, false]);
-
- getButton(el, 1).click();
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
-
- getButton(el, 2).click();
- fixture.detectChanges();
-
- expectOpenPanels(el, [true, false, true]);
-
- getButton(el, 0).click();
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, true]);
-
- getButton(el, 2).click();
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
- });
-
- it('should allow only one panel to be active with "closeOthers" flag', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const tc = fixture.componentInstance;
- const el = fixture.nativeElement;
-
- tc.closeOthers = true;
- fixture.detectChanges();
- expect(el.children[0].getAttribute('aria-multiselectable')).toBe('false');
-
- getButton(el, 0).click();
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
-
- getButton(el, 1).click();
- fixture.detectChanges();
- expectOpenPanels(el, [false, true, false]);
- });
-
- it('should update the activeIds after closeOthers is set to true', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
- const el = fixture.nativeElement;
-
- tc.activeIds = 'one,two,three';
- fixture.detectChanges();
- expectOpenPanels(el, [true, true, true]);
-
- tc.closeOthers = true;
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
-
- tc.closeOthers = false;
- fixture.detectChanges();
- expectOpenPanels(el, [true, false, false]);
- });
-
- it('should have the appropriate heading', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const compiled = fixture.nativeElement;
-
- const titles = getPanelsTitle(compiled);
- expect(titles.length).not.toBe(0);
-
- titles.forEach((title: HTMLElement, idx: number) => { expect(title.textContent.trim()).toBe(`Panel ${idx + 1}`); });
- });
-
- it('can use a title without template', () => {
- const testHtml = `
-
-
- {{panels[0].content}}
-
-
- `;
- const fixture = createTestComponent(testHtml);
-
- fixture.detectChanges();
-
- const title: HTMLElement = getPanelsTitle(fixture.nativeElement)[0];
- expect(title.textContent.trim()).toBe('Panel 1');
- });
-
- it('can mix title and template', () => {
- const testHtml = `
-
-
- {{panels[0].content}}
-
-
- {{panels[1].title}}
- {{panels[1].content}}
-
-
- `;
- const fixture = createTestComponent(testHtml);
-
- fixture.detectChanges();
-
- const titles = getPanelsTitle(fixture.nativeElement);
-
- titles.forEach((title: HTMLElement, idx: number) => { expect(title.textContent.trim()).toBe(`Panel ${idx + 1}`); });
- });
-
- it('can use header as a template', () => {
- const testHtml = `
-
-
-
- Title 1
-
- Content 1
-
-
-
- Title 2
-
- Content 2
-
-
- `;
- const fixture = createTestComponent(testHtml);
- const titles = getPanelsTitle(fixture.nativeElement);
- titles.forEach((title: HTMLElement, idx: number) => { expect(title.textContent.trim()).toBe(`Title ${idx + 1}`); });
- });
-
- it('can should pass context to a header template', () => {
- const testHtml = `
-
-
-
- {{ opened ? 'opened' : 'closed' }}
-
- Content 1
-
-
- `;
- const fixture = createTestComponent(testHtml);
- const titleButton = getPanelsTitle(fixture.nativeElement)[0];
-
- expectOpenPanels(fixture.nativeElement, [false]);
- expect(titleButton.textContent.trim()).toBe(`closed`);
-
- fixture.componentInstance.activeIds = 'one';
- fixture.detectChanges();
-
- expectOpenPanels(fixture.nativeElement, [true]);
- expect(titleButton.textContent.trim()).toBe(`opened`);
- });
-
- it('can should prefer header as a template to other ways of providing a title', () => {
- const testHtml = `
-
-
-
- Header Title 1
-
- Content 1
-
-
- Panel Title 2
-
- Header Title 2
-
- Content 2
-
-
- `;
- const fixture = createTestComponent(testHtml);
- const titles = getPanelsTitle(fixture.nativeElement);
- titles.forEach(
- (title: HTMLElement, idx: number) => { expect(title.textContent.trim()).toBe(`Header Title ${idx + 1}`); });
- });
-
- it('should not pick up titles from nested accordions', () => {
- const testHtml = `
-
-
-
-
-
- child title
- child content
-
-
-
-
-
- `;
- const fixture = createTestComponent(testHtml);
- // additional change detection is required to reproduce the problem in the test environment
- fixture.detectChanges();
-
- const titles = getPanelsTitle(fixture.nativeElement);
- const parentTitle = titles[0].textContent.trim();
- const childTitle = titles[1].textContent.trim();
-
- expect(parentTitle).toContain('parent title');
- expect(parentTitle).not.toContain('child title');
- expect(childTitle).toContain('child title');
- expect(childTitle).not.toContain('parent title');
- });
-
- it('should not crash for an empty accordion', () => {
- const fixture = createTestComponent(' ');
- expect(getPanels(fixture.nativeElement).length).toBe(0);
- });
-
- it('should not crash for panels without content', () => {
- const fixture =
- createTestComponent(' ');
- const panelsContent = getPanelsContent(fixture.nativeElement);
-
- expect(panelsContent.length).toBe(1);
- expect(panelsContent[0].textContent.trim()).toBe('');
- });
-
- it('should have the appropriate content', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const compiled = fixture.nativeElement;
- const originalContent = fixture.componentInstance.panels;
- fixture.componentInstance.activeIds = 'one,two,three';
-
- fixture.detectChanges();
-
- const contents = getPanelsContent(compiled);
- expect(contents.length).not.toBe(0);
-
- contents.forEach((content: HTMLElement, idx: number) => {
- expect(content.getAttribute('aria-labelledby')).toBe(`${content.id}-header`);
- expect(content.textContent.trim()).toBe(originalContent[idx].content);
- });
- });
-
- it('should have the appropriate CSS visibility classes', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const compiled = fixture.nativeElement;
- fixture.componentInstance.activeIds = 'one,two,three';
-
- fixture.detectChanges();
-
- const contents = getPanelsContent(compiled);
- expect(contents.length).not.toBe(0);
-
- contents.forEach((content: HTMLElement) => {
- expect(content).toHaveCssClass('collapse');
- expect(content).toHaveCssClass('show');
- });
- });
-
- it('should only open one at a time', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
- tc.closeOthers = true;
- fixture.detectChanges();
-
- const headingLinks = getPanelsTitle(fixture.nativeElement);
-
- headingLinks[0].click();
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [true, false, false]);
-
- headingLinks[2].click();
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [false, false, true]);
-
- headingLinks[2].click();
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [false, false, false]);
- });
-
- it('should have only one open panel even if binding says otherwise', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
-
- tc.activeIds = ['one', 'two'];
- tc.closeOthers = true;
- fixture.detectChanges();
-
- expectOpenPanels(fixture.nativeElement, [true, false, false]);
- });
-
- it('should not open disabled panels from click', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
- tc.panels[0].disabled = true;
- fixture.detectChanges();
-
- const headingLinks = getPanelsTitle(fixture.nativeElement);
-
- headingLinks[0].click();
- fixture.detectChanges();
-
- expectOpenPanels(fixture.nativeElement, [false, false, false]);
- });
-
- it('should not update activeIds when trying to toggle a disabled panel', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
- const el = fixture.nativeElement;
-
- tc.panels[0].disabled = true;
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
-
- const headingLinks = getPanelsTitle(fixture.nativeElement);
-
- headingLinks[0].click();
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
-
- tc.panels[0].disabled = false;
- fixture.detectChanges();
- expectOpenPanels(el, [false, false, false]);
- });
-
- it('should open/collapse disabled panels', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
-
- tc.activeIds = ['one'];
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [true, false, false]);
-
- tc.panels[0].disabled = true;
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [false, false, false]);
-
- tc.panels[0].disabled = false;
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [true, false, false]);
- });
-
- it('should have correct disabled state', () => {
- const fixture = TestBed.createComponent(TestComponent);
- const tc = fixture.componentInstance;
-
- tc.activeIds = ['one'];
- fixture.detectChanges();
- const headingLinks = getPanelsTitle(fixture.nativeElement);
- expectOpenPanels(fixture.nativeElement, [true, false, false]);
- expect(headingLinks[0].disabled).toBeFalsy();
-
- tc.panels[0].disabled = true;
- fixture.detectChanges();
- expectOpenPanels(fixture.nativeElement, [false, false, false]);
- expect(headingLinks[0].disabled).toBeTruthy();
- });
-
- it('should remove collapsed panels content from DOM', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
- expect(getPanelsContent(fixture.nativeElement).length).toBe(0);
-
- getButton(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(getPanelsContent(fixture.nativeElement).length).toBe(1);
- });
-
- it('should not remove collapsed panels content from DOM with `destroyOnHide` flag', () => {
- const testHtml = `
-
-
- {{panel.title}}
- {{panel.content}}
-
-
- Toggle the panel {{ panel.id }}
- `;
- const fixture = createTestComponent(testHtml);
-
- fixture.detectChanges();
-
- getButton(fixture.nativeElement, 1).click();
- fixture.detectChanges();
- let panelContents = getPanelsContent(fixture.nativeElement);
- expect(panelContents[1]).toHaveCssClass('show');
- expect(panelContents.length).toBe(3);
- });
-
- it('should emit panel change event when toggling panels', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- fixture.componentInstance.changeCallback = () => {};
-
- spyOn(fixture.componentInstance, 'changeCallback');
-
- // Select the first tab -> change event
- getButton(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(fixture.componentInstance.changeCallback)
- .toHaveBeenCalledWith(jasmine.objectContaining({panelId: 'one', nextState: true}));
-
- // Select the first tab again -> change event
- getButton(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(fixture.componentInstance.changeCallback)
- .toHaveBeenCalledWith(jasmine.objectContaining({panelId: 'one', nextState: false}));
- });
-
- it('should cancel panel toggle when preventDefault() is called', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- let changeEvent = null;
- fixture.componentInstance.changeCallback = event => {
- changeEvent = event;
- event.preventDefault();
- };
-
- // Select the first tab -> toggle will be canceled
- getButton(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(changeEvent).toEqual(jasmine.objectContaining({panelId: 'one', nextState: true}));
- expectOpenPanels(fixture.nativeElement, [false, false, false]);
- });
-
-
- it('should have specified type of accordion ', () => {
- const testHtml = `
-
-
- {{panel.title}}
- {{panel.content}}
-
-
- Toggle the panel {{ panel.id }}
- `;
- const fixture = createTestComponent(testHtml);
-
- fixture.componentInstance.classType = 'warning';
- fixture.detectChanges();
-
- let el = fixture.nativeElement.querySelectorAll('.card-header');
- expect(el[0]).toHaveCssClass('bg-warning');
- expect(el[1]).toHaveCssClass('bg-warning');
- expect(el[2]).toHaveCssClass('bg-warning');
- });
-
- it('should override the type in accordion with type in panel', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
- fixture.componentInstance.classType = 'warning';
-
- const tc = fixture.componentInstance;
- tc.panels[0].type = 'success';
- tc.panels[1].type = 'danger';
- fixture.detectChanges();
-
- let el = fixture.nativeElement.querySelectorAll('.card-header');
- expect(el[0]).toHaveCssClass('bg-success');
- expect(el[1]).toHaveCssClass('bg-danger');
- expect(el[2]).toHaveCssClass('bg-warning');
- });
-
- it('should have the proper roles', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.componentInstance.activeIds = 'one,two,three';
- fixture.detectChanges();
-
- const headers = getPanels(fixture.nativeElement);
- headers.forEach((header: HTMLElement) => expect(header.getAttribute('role')).toBe('tab'));
-
- const contents = getPanelsContent(fixture.nativeElement);
- contents.forEach((content: HTMLElement) => expect(content.getAttribute('role')).toBe('tabpanel'));
- });
-
- describe('Custom config', () => {
- let config: NgbAccordionConfig;
-
- beforeEach(() => { TestBed.configureTestingModule({imports: [NgbAccordionModule]}); });
-
- beforeEach(inject([NgbAccordionConfig], (c: NgbAccordionConfig) => {
- config = c;
- config.closeOthers = true;
- config.type = 'success';
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(NgbAccordion);
- fixture.detectChanges();
-
- let accordion = fixture.componentInstance;
- expect(accordion.closeOtherPanels).toBe(config.closeOthers);
- expect(accordion.type).toBe(config.type);
- });
- });
-
- describe('Custom config as provider', () => {
- let config = new NgbAccordionConfig();
- config.closeOthers = true;
- config.type = 'success';
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [NgbAccordionModule], providers: [{provide: NgbAccordionConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = TestBed.createComponent(NgbAccordion);
- fixture.detectChanges();
-
- let accordion = fixture.componentInstance;
- expect(accordion.closeOtherPanels).toBe(config.closeOthers);
- expect(accordion.type).toBe(config.type);
- });
- });
-
- describe('imperative API', () => {
-
- function createTestImperativeAccordion(testHtml: string) {
- const fixture = createTestComponent(testHtml);
- const accordion = fixture.debugElement.query(By.directive(NgbAccordion)).componentInstance;
- const nativeElement = fixture.nativeElement;
- return {fixture, accordion, nativeElement};
- }
-
- it('should check if a panel with a given id is expanded', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [true, false]);
- expect(accordion.isExpanded('first')).toBe(true);
- expect(accordion.isExpanded('second')).toBe(false);
- });
-
- it('should expanded and collapse individual panels', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false, false]);
-
- accordion.expand('first');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
-
- accordion.expand('second');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, true]);
-
- accordion.collapse('second');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
- });
-
- it('should not expand / collapse if already expanded / collapsed', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [true, false]);
-
- spyOn(fixture.componentInstance, 'changeCallback');
-
- accordion.expand('first');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
-
- accordion.collapse('second');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
-
- expect(fixture.componentInstance.changeCallback).not.toHaveBeenCalled();
- });
-
- it('should not expand disabled panels', () => {
- const testHtml = `
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false]);
-
- spyOn(fixture.componentInstance, 'changeCallback');
-
- accordion.expand('first');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [false]);
- expect(fixture.componentInstance.changeCallback).not.toHaveBeenCalled();
- });
-
- it('should not expand / collapse when preventDefault called on the panelChange event', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [true, false]);
-
- accordion.collapse('first');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
-
- accordion.expand('second');
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
- });
-
- it('should expandAll when closeOthers is false', () => {
-
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false, false]);
-
- accordion.expandAll();
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, true]);
- });
-
- it('should expand first panel when closeOthers is true and none of panels is expanded', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false, false]);
-
- accordion.expandAll();
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [true, false]);
- });
-
- it('should do nothing if closeOthers is true and one panel is expanded', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false, true]);
-
- accordion.expandAll();
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [false, true]);
- });
-
- it('should collapse all panels', () => {
- const testHtml = `
-
-
-
- `;
-
- const {accordion, nativeElement, fixture} = createTestImperativeAccordion(testHtml);
-
- expectOpenPanels(nativeElement, [false, true]);
-
- accordion.collapseAll();
- fixture.detectChanges();
- expectOpenPanels(nativeElement, [false, false]);
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- activeIds: string | string[] = [];
- classType;
- closeOthers = false;
- panels = [
- {id: 'one', disabled: false, title: 'Panel 1', content: 'foo', type: ''},
- {id: 'two', disabled: false, title: 'Panel 2', content: 'bar', type: ''},
- {id: 'three', disabled: false, title: 'Panel 3', content: 'baz', type: ''}
- ];
- changeCallback = (event: NgbPanelChangeEvent) => {};
- preventDefaultCallback = (event: NgbPanelChangeEvent) => { event.preventDefault(); };
-}
diff --git a/backup/src/accordion/accordion.ts b/backup/src/accordion/accordion.ts
deleted file mode 100644
index a1528c8..0000000
--- a/backup/src/accordion/accordion.ts
+++ /dev/null
@@ -1,344 +0,0 @@
-import {
- AfterContentChecked,
- Component,
- ContentChildren,
- Directive,
- EventEmitter,
- Host,
- Input,
- Optional,
- Output,
- QueryList,
- TemplateRef
-} from '@angular/core';
-
-import {isString} from '../util/util';
-
-import {NgbAccordionConfig} from './accordion-config';
-
-let nextId = 0;
-
-/**
- * The context for the [NgbPanelHeader](#/components/accordion/api#NgbPanelHeader) template
- *
- * @since 4.1.0
- */
-export interface NgbPanelHeaderContext {
- /**
- * `True` if current panel is opened
- */
- opened: boolean;
-}
-
-/**
- * A directive that wraps an accordion panel header with any HTML markup and a toggling button
- * marked with [`NgbPanelToggle`](#/components/accordion/api#NgbPanelToggle).
- * See the [header customization demo](#/components/accordion/examples#header) for more details.
- *
- * You can also use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to customize only the panel title.
- *
- * @since 4.1.0
- */
-@Directive({selector: 'ng-template[ngbPanelHeader]'})
-export class NgbPanelHeader {
- constructor(public templateRef: TemplateRef) {}
-}
-
-/**
- * A directive that wraps only the panel title with HTML markup inside.
- *
- * You can also use [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader) to customize the full panel header.
- */
-@Directive({selector: 'ng-template[ngbPanelTitle]'})
-export class NgbPanelTitle {
- constructor(public templateRef: TemplateRef) {}
-}
-
-/**
- * A directive that wraps the accordion panel content.
- */
-@Directive({selector: 'ng-template[ngbPanelContent]'})
-export class NgbPanelContent {
- constructor(public templateRef: TemplateRef) {}
-}
-
-/**
- * A directive that wraps an individual accordion panel with title and collapsible content.
- */
-@Directive({selector: 'ngb-panel'})
-export class NgbPanel implements AfterContentChecked {
- /**
- * If `true`, the panel is disabled an can't be toggled.
- */
- @Input() disabled = false;
-
- /**
- * An optional id for the panel that must be unique on the page.
- *
- * If not provided, it will be auto-generated in the `ngb-panel-xxx` format.
- */
- @Input() id = `ngb-panel-${nextId++}`;
-
- isOpen = false;
-
- /**
- * The panel title.
- *
- * You can alternatively use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to set panel title.
- */
- @Input() title: string;
-
- /**
- * Type of the current panel.
- *
- * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,
- * `'secondary'`, `'light'` and `'dark'`.
- */
- @Input() type: string;
-
- titleTpl: NgbPanelTitle | null;
- headerTpl: NgbPanelHeader | null;
- contentTpl: NgbPanelContent | null;
-
- @ContentChildren(NgbPanelTitle, {descendants: false}) titleTpls: QueryList;
- @ContentChildren(NgbPanelHeader, {descendants: false}) headerTpls: QueryList;
- @ContentChildren(NgbPanelContent, {descendants: false}) contentTpls: QueryList;
-
- ngAfterContentChecked() {
- // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
- // only @ContentChildren allows us to specify the {descendants: false} option.
- // Without {descendants: false} we are hitting bugs described in:
- // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
- this.titleTpl = this.titleTpls.first;
- this.headerTpl = this.headerTpls.first;
- this.contentTpl = this.contentTpls.first;
- }
-}
-
-/**
- * An event emitted right before toggling an accordion panel.
- */
-export interface NgbPanelChangeEvent {
- /**
- * The id of the accordion panel that is being toggled.
- */
- panelId: string;
-
- /**
- * The next state of the panel.
- *
- * `true` if it will be opened, `false` if closed.
- */
- nextState: boolean;
-
- /**
- * Calling this function will prevent panel toggling.
- */
- preventDefault: () => void;
-}
-
-/**
- * Accordion is a collection of collapsible panels (bootstrap cards).
- *
- * It can ensure only one panel is opened at a time and allows to customize panel
- * headers.
- */
-@Component({
- selector: 'ngb-accordion',
- exportAs: 'ngbAccordion',
- host: {'class': 'accordion', 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels'},
- template: `
-
-
- {{panel.title}}
-
-
-
-
-
- `
-})
-export class NgbAccordion implements AfterContentChecked {
- @ContentChildren(NgbPanel) panels: QueryList;
-
- /**
- * An array or comma separated strings of panel ids that should be opened **initially**.
- *
- * For subsequent changes use methods like `expand()`, `collapse()`, etc. and
- * the `(panelChange)` event.
- */
- @Input() activeIds: string | string[] = [];
-
- /**
- * If `true`, only one panel could be opened at a time.
- *
- * Opening a new panel will close others.
- */
- @Input('closeOthers') closeOtherPanels: boolean;
-
- /**
- * If `true`, panel content will be detached from DOM and not simply hidden when the panel is collapsed.
- */
- @Input() destroyOnHide = true;
-
- /**
- * Type of panels.
- *
- * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,
- * `'secondary'`, `'light'` and `'dark'`.
- */
- @Input() type: string;
-
- /**
- * Event emitted right before the panel toggle happens.
- *
- * See [NgbPanelChangeEvent](#/components/accordion/api#NgbPanelChangeEvent) for payload details.
- */
- @Output() panelChange = new EventEmitter();
-
- constructor(config: NgbAccordionConfig) {
- this.type = config.type;
- this.closeOtherPanels = config.closeOthers;
- }
-
- /**
- * Checks if a panel with a given id is expanded.
- */
- isExpanded(panelId: string): boolean { return this.activeIds.indexOf(panelId) > -1; }
-
- /**
- * Expands a panel with a given id.
- *
- * Has no effect if the panel is already expanded or disabled.
- */
- expand(panelId: string): void { this._changeOpenState(this._findPanelById(panelId), true); }
-
- /**
- * Expands all panels, if `[closeOthers]` is `false`.
- *
- * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
- */
- expandAll(): void {
- if (this.closeOtherPanels) {
- if (this.activeIds.length === 0 && this.panels.length) {
- this._changeOpenState(this.panels.first, true);
- }
- } else {
- this.panels.forEach(panel => this._changeOpenState(panel, true));
- }
- }
-
- /**
- * Collapses a panel with the given id.
- *
- * Has no effect if the panel is already collapsed or disabled.
- */
- collapse(panelId: string) { this._changeOpenState(this._findPanelById(panelId), false); }
-
- /**
- * Collapses all opened panels.
- */
- collapseAll() {
- this.panels.forEach((panel) => { this._changeOpenState(panel, false); });
- }
-
- /**
- * Toggles a panel with the given id.
- *
- * Has no effect if the panel is disabled.
- */
- toggle(panelId: string) {
- const panel = this._findPanelById(panelId);
- if (panel) {
- this._changeOpenState(panel, !panel.isOpen);
- }
- }
-
- ngAfterContentChecked() {
- // active id updates
- if (isString(this.activeIds)) {
- this.activeIds = this.activeIds.split(/\s*,\s*/);
- }
-
- // update panels open states
- this.panels.forEach(panel => panel.isOpen = !panel.disabled && this.activeIds.indexOf(panel.id) > -1);
-
- // closeOthers updates
- if (this.activeIds.length > 1 && this.closeOtherPanels) {
- this._closeOthers(this.activeIds[0]);
- this._updateActiveIds();
- }
- }
-
- private _changeOpenState(panel: NgbPanel, nextState: boolean) {
- if (panel && !panel.disabled && panel.isOpen !== nextState) {
- let defaultPrevented = false;
-
- this.panelChange.emit(
- {panelId: panel.id, nextState: nextState, preventDefault: () => { defaultPrevented = true; }});
-
- if (!defaultPrevented) {
- panel.isOpen = nextState;
-
- if (nextState && this.closeOtherPanels) {
- this._closeOthers(panel.id);
- }
- this._updateActiveIds();
- }
- }
- }
-
- private _closeOthers(panelId: string) {
- this.panels.forEach(panel => {
- if (panel.id !== panelId) {
- panel.isOpen = false;
- }
- });
- }
-
- private _findPanelById(panelId: string): NgbPanel | null { return this.panels.find(p => p.id === panelId); }
-
- private _updateActiveIds() {
- this.activeIds = this.panels.filter(panel => panel.isOpen && !panel.disabled).map(panel => panel.id);
- }
-}
-
-/**
- * A directive to put on a button that toggles panel opening and closing.
- *
- * To be used inside the [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader)
- *
- * @since 4.1.0
- */
-@Directive({
- selector: 'button[ngbPanelToggle]',
- host: {
- 'type': 'button',
- '[disabled]': 'panel.disabled',
- '[class.collapsed]': '!panel.isOpen',
- '[attr.aria-expanded]': 'panel.isOpen',
- '[attr.aria-controls]': 'panel.id',
- '(click)': 'accordion.toggle(panel.id)'
- }
-})
-export class NgbPanelToggle {
- @Input()
- set ngbPanelToggle(panel: NgbPanel) {
- if (panel) {
- this.panel = panel;
- }
- }
-
- constructor(public accordion: NgbAccordion, @Optional() @Host() public panel: NgbPanel) {}
-}
diff --git a/backup/src/alert/alert-config.spec.ts b/backup/src/alert/alert-config.spec.ts
deleted file mode 100644
index e0ecd09..0000000
--- a/backup/src/alert/alert-config.spec.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import {NgbAlertConfig} from './alert-config';
-
-describe('ngb-alert-config', () => {
- it('should have sensible default values', () => {
- const config = new NgbAlertConfig();
-
- expect(config.dismissible).toBe(true);
- expect(config.type).toBe('warning');
- });
-});
diff --git a/backup/src/alert/alert-config.ts b/backup/src/alert/alert-config.ts
deleted file mode 100644
index e5c0930..0000000
--- a/backup/src/alert/alert-config.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Injectable} from '@angular/core';
-
-/**
- * A configuration service for the [NgbAlert](#/components/alert/api#NgbAlert) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all alerts used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class NgbAlertConfig {
- dismissible = true;
- type = 'warning';
-}
diff --git a/backup/src/alert/alert.module.ts b/backup/src/alert/alert.module.ts
deleted file mode 100644
index c13d8cf..0000000
--- a/backup/src/alert/alert.module.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-
-import {NgbAlert} from './alert';
-
-export {NgbAlert} from './alert';
-export {NgbAlertConfig} from './alert-config';
-
-@NgModule({declarations: [NgbAlert], exports: [NgbAlert], imports: [CommonModule], entryComponents: [NgbAlert]})
-export class NgbAlertModule {
-}
diff --git a/backup/src/alert/alert.scss b/backup/src/alert/alert.scss
deleted file mode 100644
index 95de00b..0000000
--- a/backup/src/alert/alert.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-ngb-alert {
- display: block;
-}
diff --git a/backup/src/alert/alert.spec.ts b/backup/src/alert/alert.spec.ts
deleted file mode 100644
index 7bf106f..0000000
--- a/backup/src/alert/alert.spec.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-import {TestBed, ComponentFixture, inject} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {NgbAlertModule} from './alert.module';
-import {NgbAlert} from './alert';
-import {NgbAlertConfig} from './alert-config';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getAlertElement(element: HTMLElement): HTMLDivElement {
- return element.querySelector('.alert');
-}
-
-function getCloseButton(element: HTMLElement): HTMLButtonElement {
- return element.querySelector('button');
-}
-
-function getCloseButtonIcon(element: HTMLElement): HTMLSpanElement {
- return element.querySelector('button > span');
-}
-
-describe('ngb-alert', () => {
-
- beforeEach(() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbAlertModule]}); });
-
- it('should initialize inputs with default values', () => {
- const defaultConfig = new NgbAlertConfig();
- const alertCmp = TestBed.createComponent(NgbAlert).componentInstance;
- expect(alertCmp.dismissible).toBe(defaultConfig.dismissible);
- expect(alertCmp.type).toBe(defaultConfig.type);
- });
-
- it('should apply those default values to the template', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.getAttribute('role')).toEqual('alert');
- expect(alertEl).toHaveCssClass('alert-warning');
- expect(alertEl).toHaveCssClass('alert-dismissible');
- });
-
- it('should allow specifying alert type', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.getAttribute('role')).toEqual('alert');
- expect(alertEl).toHaveCssClass('alert-success');
- });
-
- it('should allow changing alert type', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).toHaveCssClass('alert-success');
- expect(alertEl).not.toHaveCssClass('alert-warning');
-
- fixture.componentInstance.type = 'warning';
- fixture.detectChanges();
- expect(alertEl).not.toHaveCssClass('alert-success');
- expect(alertEl).toHaveCssClass('alert-warning');
- });
-
- it('should allow adding custom CSS classes', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).toHaveCssClass('alert');
- expect(alertEl).toHaveCssClass('alert-success');
- expect(alertEl).toHaveCssClass('myClass');
- });
-
- it('should render close button when dismissible', () => {
- const fixture = createTestComponent('Watch out! ');
- const alertEl = getAlertElement(fixture.nativeElement);
- const buttonEl = getCloseButton(alertEl);
- const buttonIconEl = getCloseButtonIcon(alertEl);
-
- expect(alertEl).toHaveCssClass('alert-dismissible');
- expect(buttonEl).toBeTruthy();
- expect(buttonEl.getAttribute('class')).toContain('close');
- expect(buttonEl.getAttribute('aria-label')).toBe('Close');
- expect(buttonIconEl.getAttribute('aria-hidden')).toBe('true');
- expect(buttonIconEl.textContent).toBe('×');
- });
-
- it('should not render the close button if it is not dismissible', () => {
- const fixture = createTestComponent(`Don't close! `);
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).not.toHaveCssClass('alert-dismissible');
- expect(getCloseButton(alertEl)).toBeFalsy();
- });
-
- it('should fire an event after closing a dismissible alert', () => {
- const fixture =
- createTestComponent('Watch out! ');
- const alertEl = getAlertElement(fixture.nativeElement);
- const buttonEl = getCloseButton(alertEl);
-
- expect(fixture.componentInstance.closed).toBe(false);
- buttonEl.click();
- expect(fixture.componentInstance.closed).toBe(true);
- });
-
- it('should project the content given into the component', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.textContent).toContain('Cool!');
- });
-
- it('should project content before the closing button for a11y/screen readers', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- const childElements = Array.from(alertEl.children).map(node => node.tagName.toLowerCase());
- expect(childElements).toEqual(['span', 'button']);
- });
-
- describe('Custom config', () => {
- let config: NgbAlertConfig;
-
- beforeEach(() => { TestBed.configureTestingModule({imports: [NgbAlertModule]}); });
-
- beforeEach(inject([NgbAlertConfig], (c: NgbAlertConfig) => {
- config = c;
- config.dismissible = false;
- config.type = 'success';
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(NgbAlert);
- fixture.detectChanges();
-
- const alert = fixture.componentInstance;
- expect(alert.dismissible).toBe(config.dismissible);
- expect(alert.type).toBe(config.type);
- });
- });
-
- describe('Custom config as provider', () => {
- let config = new NgbAlertConfig();
- config.dismissible = false;
- config.type = 'success';
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [NgbAlertModule], providers: [{provide: NgbAlertConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = TestBed.createComponent(NgbAlert);
- fixture.detectChanges();
-
- const alert = fixture.componentInstance;
- expect(alert.dismissible).toBe(config.dismissible);
- expect(alert.type).toBe(config.type);
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: '', entryComponents: [NgbAlert]})
-class TestComponent {
- name = 'World';
- closed = false;
- type = 'success';
-}
diff --git a/backup/src/alert/alert.ts b/backup/src/alert/alert.ts
deleted file mode 100644
index 4df4cc3..0000000
--- a/backup/src/alert/alert.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-import {
- Component,
- Input,
- Output,
- EventEmitter,
- ChangeDetectionStrategy,
- Renderer2,
- ElementRef,
- OnChanges,
- OnInit,
- SimpleChanges,
- ViewEncapsulation
-} from '@angular/core';
-
-import {NgbAlertConfig} from './alert-config';
-
-/**
- * Alert is a component to provide contextual feedback messages for user.
- *
- * It supports several alert types and can be dismissed.
- */
-@Component({
- selector: 'ngb-alert',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: {'role': 'alert', 'class': 'alert', '[class.alert-dismissible]': 'dismissible'},
- template: `
-
-
- ×
-
- `,
- styleUrls: ['./alert.scss']
-})
-export class NgbAlert implements OnInit,
- OnChanges {
- /**
- * If `true`, alert can be dismissed by the user.
- *
- * The close button (×) will be displayed and you can be notified
- * of the event with the `(close)` output.
- */
- @Input() dismissible: boolean;
- /**
- * Type of the alert.
- *
- * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,
- * `'secondary'`, `'light'` and `'dark'`.
- */
- @Input() type: string;
- /**
- * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.
- */
- @Output() close = new EventEmitter();
-
- constructor(config: NgbAlertConfig, private _renderer: Renderer2, private _element: ElementRef) {
- this.dismissible = config.dismissible;
- this.type = config.type;
- }
-
- closeHandler() { this.close.emit(null); }
-
- ngOnChanges(changes: SimpleChanges) {
- const typeChange = changes['type'];
- if (typeChange && !typeChange.firstChange) {
- this._renderer.removeClass(this._element.nativeElement, `alert-${typeChange.previousValue}`);
- this._renderer.addClass(this._element.nativeElement, `alert-${typeChange.currentValue}`);
- }
- }
-
- ngOnInit() { this._renderer.addClass(this._element.nativeElement, `alert-${this.type}`); }
-}
diff --git a/backup/src/browserslist b/backup/src/browserslist
deleted file mode 100644
index ba8fa84..0000000
--- a/backup/src/browserslist
+++ /dev/null
@@ -1,13 +0,0 @@
-# Source: https://github.com/twbs/bootstrap/blob/v4.1.3/.browserslistrc
-
->= 1%
-last 1 major version
-not dead
-Chrome >= 45
-Firefox >= 38
-Edge >= 12
-Explorer >= 10
-iOS >= 9
-Safari >= 9
-Android >= 4.4
-Opera >= 30
diff --git a/backup/src/buttons/buttons.module.ts b/backup/src/buttons/buttons.module.ts
deleted file mode 100644
index 05e6f4b..0000000
--- a/backup/src/buttons/buttons.module.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {NgModule} from '@angular/core';
-import {NgbButtonLabel} from './label';
-import {NgbCheckBox} from './checkbox';
-import {NgbRadio, NgbRadioGroup} from './radio';
-
-export {NgbButtonLabel} from './label';
-export {NgbCheckBox} from './checkbox';
-export {NgbRadio, NgbRadioGroup} from './radio';
-
-
-const NGB_BUTTON_DIRECTIVES = [NgbButtonLabel, NgbCheckBox, NgbRadioGroup, NgbRadio];
-
-@NgModule({declarations: NGB_BUTTON_DIRECTIVES, exports: NGB_BUTTON_DIRECTIVES})
-export class NgbButtonsModule {
-}
diff --git a/backup/src/buttons/checkbox.spec.ts b/backup/src/buttons/checkbox.spec.ts
deleted file mode 100644
index 7fc4995..0000000
--- a/backup/src/buttons/checkbox.spec.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-import {createGenericTestComponent} from '../test/common';
-
-import {ChangeDetectionStrategy, Component} from '@angular/core';
-import {FormsModule, ReactiveFormsModule} from '@angular/forms';
-
-import {NgbButtonsModule} from './buttons.module';
-import {NgbCheckBox} from './checkbox';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-const createOnPushTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponentOnPush) as ComponentFixture;
-
-function getLabel(nativeEl: HTMLElement): HTMLElement {
- return nativeEl.querySelector('label');
-}
-
-function getInput(nativeEl: HTMLElement): HTMLInputElement {
- return nativeEl.querySelector('input');
-}
-
-describe('NgbCheckBox', () => {
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [TestComponent, TestComponentOnPush],
- imports: [NgbButtonsModule, FormsModule, ReactiveFormsModule]
- });
- });
-
- describe('bindings', () => {
-
- it('should mark input as checked / unchecked based on model change (default values)', fakeAsync(() => {
- const fixture =
- createTestComponent(` `);
-
- fixture.componentInstance.model = true;
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).checked).toBeTruthy();
- expect(getLabel(fixture.debugElement.nativeElement)).toHaveCssClass('active');
-
- fixture.componentInstance.model = false;
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).checked).toBeFalsy();
- expect(getLabel(fixture.debugElement.nativeElement)).not.toHaveCssClass('active');
- }));
-
-
- it('should mark input as checked / unchecked based on model change (custom values)', fakeAsync(() => {
- const fixture = createTestComponent(`
-
-
-
- `);
-
- fixture.componentInstance.model = 'foo';
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).checked).toBeTruthy();
- expect(getLabel(fixture.debugElement.nativeElement)).toHaveCssClass('active');
-
- fixture.componentInstance.model = 'sth else';
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).checked).toBeFalsy();
- expect(getLabel(fixture.debugElement.nativeElement)).not.toHaveCssClass('active');
- }));
-
- it('should mark input as disabled / enabled based on binding change', fakeAsync(() => {
- const fixture = createTestComponent(`
-
-
-
- `);
-
- fixture.componentInstance.disabled = true;
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).disabled).toBeTruthy();
- expect(getLabel(fixture.debugElement.nativeElement)).toHaveCssClass('disabled');
-
- fixture.componentInstance.disabled = false;
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).disabled).toBeFalsy();
- expect(getLabel(fixture.debugElement.nativeElement)).not.toHaveCssClass('disabled');
- }));
- });
-
- describe('user interactions', () => {
-
- it('should bind model value on change (default values)', fakeAsync(() => {
- const fixture = createTestComponent(`
-
-
-
- `);
-
- const inputDebugEl = fixture.debugElement.query(By.directive(NgbCheckBox));
-
- inputDebugEl.triggerEventHandler('change', {target: {checked: true}});
- tick();
- expect(fixture.componentInstance.model).toBe(true);
-
- inputDebugEl.triggerEventHandler('change', {target: {checked: false}});
- tick();
- expect(fixture.componentInstance.model).toBe(false);
- }));
-
- it('should bind model value on change (custom values)', fakeAsync(() => {
- const fixture = createTestComponent(`
-
-
-
- `);
-
- const inputDebugEl = fixture.debugElement.query(By.directive(NgbCheckBox));
-
- inputDebugEl.triggerEventHandler('change', {target: {checked: true}});
- tick();
- expect(fixture.componentInstance.model).toBe('foo');
-
- inputDebugEl.triggerEventHandler('change', {target: {checked: false}});
- tick();
- expect(fixture.componentInstance.model).toBe('bar');
- }));
-
- it('should mark label as focused based on input focus', () => {
- const fixture = createTestComponent(`
-
-
-
- `);
-
- const inputDebugEl = fixture.debugElement.query(By.directive(NgbCheckBox));
-
- inputDebugEl.triggerEventHandler('focus', {});
- fixture.detectChanges();
- expect(getLabel(fixture.debugElement.nativeElement)).toHaveCssClass('focus');
-
- inputDebugEl.triggerEventHandler('blur', {});
- fixture.detectChanges();
- expect(getLabel(fixture.debugElement.nativeElement)).not.toHaveCssClass('focus');
- });
-
- });
-
- describe('on push', () => {
- it('should set initial model value', fakeAsync(() => {
- const fixture = createOnPushTestComponent(`
-
-
-
- `);
-
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.debugElement.nativeElement).checked).toBeTruthy();
- expect(getLabel(fixture.debugElement.nativeElement)).toHaveCssClass('active');
- }));
- });
-
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- disabled;
- model;
-}
-
-@Component({selector: 'test-cmp-on-push', template: '', changeDetection: ChangeDetectionStrategy.OnPush})
-class TestComponentOnPush {
-}
diff --git a/backup/src/buttons/checkbox.ts b/backup/src/buttons/checkbox.ts
deleted file mode 100644
index 227ef98..0000000
--- a/backup/src/buttons/checkbox.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import {ChangeDetectorRef, Directive, forwardRef, Input} from '@angular/core';
-import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
-
-import {NgbButtonLabel} from './label';
-
-const NGB_CHECKBOX_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgbCheckBox),
- multi: true
-};
-
-
-/**
- * Allows to easily create Bootstrap-style checkbox buttons.
- *
- * Integrates with forms, so the value of a checked button is bound to the underlying form control
- * either in a reactive or template-driven way.
- */
-@Directive({
- selector: '[ngbButton][type=checkbox]',
- host: {
- 'autocomplete': 'off',
- '[checked]': 'checked',
- '[disabled]': 'disabled',
- '(change)': 'onInputChange($event)',
- '(focus)': 'focused = true',
- '(blur)': 'focused = false'
- },
- providers: [NGB_CHECKBOX_VALUE_ACCESSOR]
-})
-export class NgbCheckBox implements ControlValueAccessor {
- checked;
-
- /**
- * If `true`, the checkbox button will be disabled
- */
- @Input() disabled = false;
-
- /**
- * The form control value when the checkbox is checked.
- */
- @Input() valueChecked = true;
-
- /**
- * The form control value when the checkbox is unchecked.
- */
- @Input() valueUnChecked = false;
-
- onChange = (_: any) => {};
- onTouched = () => {};
-
- set focused(isFocused: boolean) {
- this._label.focused = isFocused;
- if (!isFocused) {
- this.onTouched();
- }
- }
-
- constructor(private _label: NgbButtonLabel, private _cd: ChangeDetectorRef) {}
-
- onInputChange($event) {
- const modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;
- this.onChange(modelToPropagate);
- this.onTouched();
- this.writeValue(modelToPropagate);
- }
-
- registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }
-
- registerOnTouched(fn: () => any): void { this.onTouched = fn; }
-
- setDisabledState(isDisabled: boolean): void {
- this.disabled = isDisabled;
- this._label.disabled = isDisabled;
- }
-
- writeValue(value) {
- this.checked = value === this.valueChecked;
- this._label.active = this.checked;
-
- // label won't be updated, if it is inside the OnPush component when [ngModel] changes
- this._cd.markForCheck();
- }
-}
diff --git a/backup/src/buttons/label.ts b/backup/src/buttons/label.ts
deleted file mode 100644
index 85921c8..0000000
--- a/backup/src/buttons/label.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Directive} from '@angular/core';
-
-@Directive({
- selector: '[ngbButtonLabel]',
- host:
- {'[class.btn]': 'true', '[class.active]': 'active', '[class.disabled]': 'disabled', '[class.focus]': 'focused'}
-})
-export class NgbButtonLabel {
- active: boolean;
- disabled: boolean;
- focused: boolean;
-}
diff --git a/backup/src/buttons/radio.spec.ts b/backup/src/buttons/radio.spec.ts
deleted file mode 100644
index f5af4d7..0000000
--- a/backup/src/buttons/radio.spec.ts
+++ /dev/null
@@ -1,617 +0,0 @@
-import {ChangeDetectionStrategy, Component} from '@angular/core';
-import {async, ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
-import {FormControl, FormGroup, FormsModule, NgModel, ReactiveFormsModule, Validators} from '@angular/forms';
-import {By} from '@angular/platform-browser';
-
-import {createGenericTestComponent} from '../test/common';
-import {NgbButtonsModule} from './buttons.module';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function expectRadios(element: HTMLElement, states: number[]) {
- const labels = element.querySelectorAll('label');
- expect(labels.length).toEqual(states.length);
-
- for (let i = 0; i < states.length; i++) {
- let state = states[i];
-
- if (state === 1) {
- expect(labels[i]).toHaveCssClass('active');
- } else if (state === 0) {
- expect(labels[i]).not.toHaveCssClass('active');
- }
- }
-}
-
-function expectNameOnAllInputs(element: HTMLElement, name: string) {
- const inputs = element.querySelectorAll('input');
- for (let i = 0; i < inputs.length; i++) {
- expect(inputs[i].getAttribute('name')).toBe(name);
- }
-}
-
-function getGroupElement(nativeEl: HTMLElement): HTMLDivElement {
- return nativeEl.querySelector('div[ngbRadioGroup]');
-}
-
-function getInput(nativeEl: HTMLElement, idx: number): HTMLInputElement {
- return nativeEl.querySelectorAll('input')[idx];
-}
-
-function getLabel(nativeEl: HTMLElement, idx: number): HTMLElement {
- return nativeEl.querySelectorAll('label')[idx];
-}
-
-describe('ngbRadioGroup', () => {
- const defaultHtml = `
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
`;
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [TestComponent, TestComponentOnPush],
- imports: [NgbButtonsModule, FormsModule, ReactiveFormsModule]
- });
- TestBed.overrideComponent(TestComponent, {set: {template: defaultHtml}});
- TestBed.overrideComponent(TestComponentOnPush, {set: {template: defaultHtml}});
- });
-
- it('toggles radio inputs based on model changes', async(() => {
- const fixture = TestBed.createComponent(TestComponent);
-
- let values = fixture.componentInstance.values;
-
- // checking initial values
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
- expect(getInput(fixture.nativeElement, 0).value).toEqual(values[0]);
- expect(getInput(fixture.nativeElement, 1).value).toEqual(values[1]);
-
- // checking null
- fixture.componentInstance.model = null;
- fixture.detectChanges();
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
-
- // checking first radio
- fixture.componentInstance.model = values[0];
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [1, 0]);
-
- // checking second radio
- fixture.componentInstance.model = values[1];
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1]);
-
- // checking non-matching value
- fixture.componentInstance.model = values[3];
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
- });
- }));
-
- it('updates model based on radio input clicks', async(() => {
- const fixture = TestBed.createComponent(TestComponent);
-
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
-
- fixture.whenStable()
- .then(() => {
- // clicking first radio
- getInput(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [1, 0]);
- expect(fixture.componentInstance.model).toBe('one');
- return fixture.whenStable();
- })
- .then(() => {
- // clicking second radio
- getInput(fixture.nativeElement, 1).click();
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1]);
- expect(fixture.componentInstance.model).toBe('two');
- });
- }));
-
- it('can be used with objects as values', async(() => {
- const fixture = TestBed.createComponent(TestComponent);
-
- let [one, two] = [{one: 'one'}, {two: 'two'}];
-
- fixture.componentInstance.values[0] = one;
- fixture.componentInstance.values[1] = two;
-
- // checking initial values
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
- expect(getInput(fixture.nativeElement, 0).value).toEqual({}.toString());
- expect(getInput(fixture.nativeElement, 1).value).toEqual({}.toString());
-
- // checking model -> radio input
- fixture.componentInstance.model = one;
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [1, 0]);
-
- // checking radio click -> model
- getInput(fixture.nativeElement, 1).click();
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1]);
- expect(fixture.componentInstance.model).toBe(two);
- });
- }));
-
- it('updates radio input values dynamically', async(() => {
- const fixture = TestBed.createComponent(TestComponent);
-
- let values = fixture.componentInstance.values;
-
- // checking first radio
- fixture.componentInstance.model = values[0];
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [1, 0]);
- expect(fixture.componentInstance.model).toEqual(values[0]);
-
- // updating first radio value -> expecting none selected
- let initialValue = values[0];
- values[0] = 'ten';
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
- expect(getInput(fixture.nativeElement, 0).value).toEqual('ten');
- expect(fixture.componentInstance.model).toEqual(initialValue);
-
- // updating values back -> expecting initial state
- values[0] = initialValue;
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [1, 0]);
- expect(getInput(fixture.nativeElement, 0).value).toEqual(values[0]);
- expect(fixture.componentInstance.model).toEqual(values[0]);
- });
- }));
-
- it('can be used with ngFor', async(() => {
-
- const forHtml = `
-
- {{ v }}
-
-
`;
-
- const fixture = createTestComponent(forHtml);
- let values = fixture.componentInstance.values;
-
- expectRadios(fixture.nativeElement, [0, 0, 0]);
-
- fixture.componentInstance.model = values[1];
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1, 0]);
- });
- }));
-
- it('cleans up the model when radio inputs are added / removed', async(() => {
-
- const ifHtml = `
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
`;
- const fixture = createTestComponent(ifHtml);
-
- let values = fixture.componentInstance.values;
-
- // hiding/showing non-selected radio -> expecting initial model value
- expectRadios(fixture.nativeElement, [0, 0]);
-
- fixture.componentInstance.shown = false;
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0]);
- expect(fixture.componentInstance.model).toBeUndefined();
-
- fixture.componentInstance.shown = true;
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 0]);
- expect(fixture.componentInstance.model).toBeUndefined();
-
- // hiding/showing selected radio -> expecting model to unchange, but none selected
- fixture.componentInstance.model = values[1];
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1]);
-
- fixture.componentInstance.shown = false;
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0]);
- expect(fixture.componentInstance.model).toEqual(values[1]);
-
- fixture.componentInstance.shown = true;
- fixture.detectChanges();
- expectRadios(fixture.nativeElement, [0, 1]);
- expect(fixture.componentInstance.model).toEqual(values[1]);
- });
- }));
-
- it('should work with template-driven form validation', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- expect(getGroupElement(fixture.nativeElement)).toHaveCssClass('ng-invalid');
- expect(getGroupElement(fixture.nativeElement)).not.toHaveCssClass('ng-valid');
-
- getInput(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(getGroupElement(fixture.nativeElement)).toHaveCssClass('ng-valid');
- expect(getGroupElement(fixture.nativeElement)).not.toHaveCssClass('ng-invalid');
- });
- }));
-
- it('should work with model-driven form validation', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- expect(getGroupElement(fixture.nativeElement)).toHaveCssClass('ng-invalid');
- expect(getGroupElement(fixture.nativeElement)).not.toHaveCssClass('ng-valid');
-
- getInput(fixture.nativeElement, 0).click();
- fixture.detectChanges();
- expect(getGroupElement(fixture.nativeElement)).toHaveCssClass('ng-valid');
- expect(getGroupElement(fixture.nativeElement)).not.toHaveCssClass('ng-invalid');
- });
-
- it('should disable label and input when it is disabled using reactive forms', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
-
- fixture.componentInstance.disabledControl.enable();
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).not.toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeFalsy();
- });
-
- it('should disable label and input when added dynamically in reactive forms', () => {
- const forHtml = `
-
- `;
-
- const fixture = createTestComponent(forHtml);
- fixture.componentInstance.shown = false;
- fixture.componentInstance.disabledForm.disable();
- fixture.detectChanges();
-
- fixture.componentInstance.shown = true;
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
- });
-
- it('should disable label and input when it is disabled using template-driven forms', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
-
- fixture.componentInstance.disabled = false;
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).not.toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeFalsy();
- });
- }));
-
- it('should disable individual label and input using template-driven forms', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.whenStable()
- .then(() => {
- fixture.componentInstance.disabled = true;
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
-
- fixture.componentInstance.disabled = false;
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).not.toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeFalsy();
- });
- }));
-
- it('disable all radio buttons when group is disabled regardless of button disabled state', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.whenStable()
- .then(() => {
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
-
- fixture.componentInstance.disabled = false;
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
- });
- }));
-
- it('button stays disabled when group is enabled', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.whenStable()
- .then(() => {
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
-
- fixture.componentInstance.groupDisabled = false;
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- expect(getLabel(fixture.nativeElement, 0)).toHaveCssClass('disabled');
- expect(getInput(fixture.nativeElement, 0).hasAttribute('disabled')).toBeTruthy();
- });
- }));
-
-
- it('should add / remove "focus" class on labels', () => {
- const fixture = createTestComponent(`
-
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
- `);
- fixture.detectChanges();
-
- const inputDebugEls = fixture.debugElement.queryAll(By.css('Input'));
-
- inputDebugEls[0].triggerEventHandler('focus', {});
- fixture.detectChanges();
- expect(inputDebugEls[0].nativeElement.parentNode).toHaveCssClass('focus');
- expect(inputDebugEls[1].nativeElement.parentNode).not.toHaveCssClass('focus');
-
- inputDebugEls[0].triggerEventHandler('blur', {});
- inputDebugEls[1].triggerEventHandler('focus', {});
- fixture.detectChanges();
- expect(inputDebugEls[0].nativeElement.parentNode).not.toHaveCssClass('focus');
- expect(inputDebugEls[1].nativeElement.parentNode).toHaveCssClass('focus');
- });
-
- it('should mark form control as touched when label loses focus', () => {
- const fixture = createTestComponent(`
-
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
- `);
- fixture.detectChanges();
-
- const inputDebugEls = fixture.debugElement.queryAll(By.css('Input'));
- const ngModel = fixture.debugElement.query(By.directive(NgModel)).injector.get(NgModel);
-
- inputDebugEls[0].triggerEventHandler('focus', {});
- fixture.detectChanges();
- expect(ngModel.touched).toBe(false);
-
- inputDebugEls[0].triggerEventHandler('blur', {});
- fixture.detectChanges();
- expect(ngModel.touched).toBe(true);
- });
-
- it('should generate input names automatically if no name specified anywhere', () => {
- const fixture = createTestComponent(`
-
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
- `);
- fixture.detectChanges();
-
- const inputs = fixture.nativeElement.querySelectorAll('input');
- const distinctNames = new Set();
- for (let i = 0; i < inputs.length; i++) {
- distinctNames.add(inputs[i].getAttribute('name'));
- }
- expect(distinctNames.size).toBe(1);
- expect(distinctNames.values().next().value).toMatch(/ngb-radio-\d+/);
- });
-
- it('should set input names from group name if inputs don\'t have a name', () => {
- const fixture = createTestComponent(`
-
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
- `);
- fixture.detectChanges();
-
- const inputs = fixture.nativeElement.querySelectorAll('input');
- expectNameOnAllInputs(fixture.nativeElement, 'foo');
- });
-
- it('should honor the input names if specified', () => {
- const fixture = createTestComponent(`
-
-
- {{ values[0] }}
-
-
- {{ values[1] }}
-
-
- `);
- fixture.detectChanges();
-
- const inputs = fixture.nativeElement.querySelectorAll('input');
- expectNameOnAllInputs(fixture.nativeElement, 'bar');
- });
-
- describe('accessibility', () => {
- it('should have "group" role', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- expect(getGroupElement(fixture.nativeElement).getAttribute('role')).toBe('radiogroup');
- });
- });
-
- describe('on push', () => {
- it('should set initial model value', fakeAsync(() => {
- const fixture = TestBed.createComponent(TestComponentOnPush);
- const {values} = fixture.componentInstance;
-
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
- expect(getInput(fixture.nativeElement, 0).value).toEqual(values[0]);
- expect(getInput(fixture.nativeElement, 1).value).toEqual(values[1]);
- expectRadios(fixture.nativeElement, [1, 0]);
- }));
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- form = new FormGroup({control: new FormControl('', Validators.required)});
- disabledControl = new FormControl({value: '', disabled: true});
- disabledForm = new FormGroup({control: this.disabledControl});
-
- model;
- values: any = ['one', 'two', 'three'];
- shown = true;
- disabled = true;
- groupDisabled = true;
- checked: any;
-}
-
-@Component({selector: 'test-cmp-on-push', template: '', changeDetection: ChangeDetectionStrategy.OnPush})
-class TestComponentOnPush {
- model = 'one';
- values = ['one', 'two', 'three'];
-}
diff --git a/backup/src/buttons/radio.ts b/backup/src/buttons/radio.ts
deleted file mode 100644
index efdd9a7..0000000
--- a/backup/src/buttons/radio.ts
+++ /dev/null
@@ -1,159 +0,0 @@
-import {ChangeDetectorRef, Directive, ElementRef, forwardRef, Input, OnDestroy, Renderer2} from '@angular/core';
-import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
-
-import {NgbButtonLabel} from './label';
-
-const NGB_RADIO_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgbRadioGroup),
- multi: true
-};
-
-let nextId = 0;
-
-/**
- * Allows to easily create Bootstrap-style radio buttons.
- *
- * Integrates with forms, so the value of a checked button is bound to the underlying form control
- * either in a reactive or template-driven way.
- */
-@Directive({selector: '[ngbRadioGroup]', host: {'role': 'radiogroup'}, providers: [NGB_RADIO_VALUE_ACCESSOR]})
-export class NgbRadioGroup implements ControlValueAccessor {
- private _radios: Set = new Set();
- private _value = null;
- private _disabled: boolean;
-
- get disabled() { return this._disabled; }
- set disabled(isDisabled: boolean) { this.setDisabledState(isDisabled); }
-
- /**
- * Name of the radio group applied to radio input elements.
- *
- * Will be applied to all radio input elements inside the group,
- * unless [`NgbRadio`](#/components/buttons/api#NgbRadio)'s specify names themselves.
- *
- * If not provided, will be generated in the `ngb-radio-xx` format.
- */
- @Input() name = `ngb-radio-${nextId++}`;
-
- onChange = (_: any) => {};
- onTouched = () => {};
-
- onRadioChange(radio: NgbRadio) {
- this.writeValue(radio.value);
- this.onChange(radio.value);
- }
-
- onRadioValueUpdate() { this._updateRadiosValue(); }
-
- register(radio: NgbRadio) { this._radios.add(radio); }
-
- registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }
-
- registerOnTouched(fn: () => any): void { this.onTouched = fn; }
-
- setDisabledState(isDisabled: boolean): void {
- this._disabled = isDisabled;
- this._updateRadiosDisabled();
- }
-
- unregister(radio: NgbRadio) { this._radios.delete(radio); }
-
- writeValue(value) {
- this._value = value;
- this._updateRadiosValue();
- }
-
- private _updateRadiosValue() { this._radios.forEach((radio) => radio.updateValue(this._value)); }
- private _updateRadiosDisabled() { this._radios.forEach((radio) => radio.updateDisabled()); }
-}
-
-
-/**
- * A directive that marks an input of type "radio" as a part of the
- * [`NgbRadioGroup`](#/components/buttons/api#NgbRadioGroup).
- */
-@Directive({
- selector: '[ngbButton][type=radio]',
- host: {
- '[checked]': 'checked',
- '[disabled]': 'disabled',
- '[name]': 'nameAttr',
- '(change)': 'onChange()',
- '(focus)': 'focused = true',
- '(blur)': 'focused = false'
- }
-})
-export class NgbRadio implements OnDestroy {
- private _checked: boolean;
- private _disabled: boolean;
- private _value: any = null;
-
- /**
- * The value for the 'name' property of the input element.
- *
- * All inputs of the radio group should have the same name. If not specified,
- * the name of the enclosing group is used.
- */
- @Input() name: string;
-
- /**
- * The form control value when current radio button is checked.
- */
- @Input('value')
- set value(value: any) {
- this._value = value;
- const stringValue = value ? value.toString() : '';
- this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);
- this._group.onRadioValueUpdate();
- }
-
- /**
- * If `true`, current radio button will be disabled.
- */
- @Input('disabled')
- set disabled(isDisabled: boolean) {
- this._disabled = isDisabled !== false;
- this.updateDisabled();
- }
-
- set focused(isFocused: boolean) {
- if (this._label) {
- this._label.focused = isFocused;
- }
- if (!isFocused) {
- this._group.onTouched();
- }
- }
-
- get checked() { return this._checked; }
-
- get disabled() { return this._group.disabled || this._disabled; }
-
- get value() { return this._value; }
-
- get nameAttr() { return this.name || this._group.name; }
-
- constructor(
- private _group: NgbRadioGroup, private _label: NgbButtonLabel, private _renderer: Renderer2,
- private _element: ElementRef, private _cd: ChangeDetectorRef) {
- this._group.register(this);
- this.updateDisabled();
- }
-
- ngOnDestroy() { this._group.unregister(this); }
-
- onChange() { this._group.onRadioChange(this); }
-
- updateValue(value) {
- // label won't be updated, if it is inside the OnPush component when [ngModel] changes
- if (this.value !== value) {
- this._cd.markForCheck();
- }
-
- this._checked = this.value === value;
- this._label.active = this._checked;
- }
-
- updateDisabled() { this._label.disabled = this.disabled; }
-}
diff --git a/backup/src/card/card-config.spec.ts b/backup/src/card/card-config.spec.ts
deleted file mode 100644
index 0ae1fab..0000000
--- a/backup/src/card/card-config.spec.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import {SbCardConfig} from './card-config';
-
-describe('sb-card-config', () => {
- it('should have sensible default values', () => {
- const config = new SbCardConfig();
-
- expect(config.dismissible).toBe(true);
- expect(config.type).toBe('warning');
- });
-});
diff --git a/backup/src/card/card-config.ts b/backup/src/card/card-config.ts
deleted file mode 100644
index 6497d0b..0000000
--- a/backup/src/card/card-config.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Injectable} from '@angular/core';
-
-/**
- * A configuration service for the [SbCard](#/components/alert/api#SbCard) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all alerts used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class SbCardConfig {
- dismissible = true;
- type = 'warning';
-}
diff --git a/backup/src/card/card.module.ts b/backup/src/card/card.module.ts
deleted file mode 100644
index 82c6b35..0000000
--- a/backup/src/card/card.module.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-
-import {SbCard} from './card';
-
-export {SbCard} from './card';
-export {SbCardConfig} from './card-config';
-
-@NgModule({declarations: [SbCard], exports: [SbCard], imports: [CommonModule], entryComponents: [SbCard]})
- export class SbCardModule {
-}
diff --git a/backup/src/card/card.scss b/backup/src/card/card.scss
deleted file mode 100644
index b43ad69..0000000
--- a/backup/src/card/card.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-sb-card {
- display: inline-block;
-}
-
-:root{--font-stack-en: 'Noto Sans','Noto Sans Devanagari','Noto Sans Tamil','Noto Sans Bengali','Noto Sans Malayalam','Noto Sans Gurmukhi','Noto Sans Gujarati','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Oriya','Noto Nastaliq Urdu',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;--font-stack-hi: 'Noto Sans Devanagari','Noto Sans','Noto Sans Tamil','Noto Sans Bengali','Noto Sans Malayalam','Noto Sans Gurmukhi','Noto Sans Gujarati','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Oriya','Noto Nastaliq Urdu',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;--font-stack-ur: 'Noto Sans','Noto Nastaliq Urdu','Noto Sans Devanagari','Noto Sans Tamil','Noto Sans Bengali','Noto Sans Malayalam','Noto Sans Gurmukhi','Noto Sans Gujarati','Noto Sans Telugu','Noto Sans Kannada','Noto Sans Oriya',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;--blue: #024f9d;--black: #000000;--green: #008840;--orange: #e55a28;--red: #ff4558;--white: #ffffff;--indigo: #6610f2;--purple: #6f42c1;--pink: #e83e8c;--yellow: #ffc107;--teal: #20c997;--cyan: #17a2b8;--gray-hs: 0,0%;--gray: hsl(var(--gray-hs),20%);--gray-0: hsl(var(--gray-hs),95%);--gray-100: hsl(var(--gray-hs),80%);--gray-200: hsl(var(--gray-hs),60%);--gray-300: hsl(var(--gray-hs),59%);--gray-400: hsl(var(--gray-hs),40%);--gray-800: var(--gray);--primary-color: var(--blue);--secondary-color: var(--green);--tertiary-color: var(--orange);--primary-0: #F3F7FA;--primary-100: #EDF4F9;--primary-200: #80A7CE;--primary-250:#D3E7F4;--primary-300: #7AB4EE;--primary-400: var(--primary-color);--primary-600: #005391;--primary-800: #002E50;--secondary-0: #E1FFDF;--secondary-100: #00C786;--secondary-200: #07bc81;--secondary-400: var(--secondary-color);--tertiary-0: #FEEDD7;--tertiary-100: #FFA11D;--tertiary-400: var(--tertiary-color);--red-0: #FBCCD1;--red-100: #FF6979;--red-400: var(--red)}
-
-.sb-card{width:292px;background-color:var(--white);border:0.5px solid #dedede;border-radius:4px;cursor:pointer;overflow:hidden;margin-top:3px;transition:box-shadow .3s ease-out, transform .3s ease-out, opacity .2s ease-out;transition-delay:.1s}.sb-card:hover{transform:translate(0, -3px);box-shadow:0 2px 7px 0 rgba(0,0,0,0.16)}.sb-card .sb-card-body{height:204px;padding:16px 16px 8px 16px;overflow:hidden}.sb-card .sb-card-metas{display:flex;align-items:flex-end}.sb-card .sb-card-image{width:70px;height:92px;border:0.5px solid var(--gray-100);background-color:var(--gray-0);border-radius:2px;box-sizing:border-box;overflow:hidden}.sb-card .sb-card-image img{width:70px;height:92px;object-fit:cover}.sb-card .sb-card-meta{height:92px;width:172px;display:flex;flex-wrap:wrap;flex-direction:column;overflow:hidden}.sb-card .sb-card-label{color:var(--primary-color);font-size:10.9994px;border:1px solid var(--primary-color);border-radius:2px;padding:4px 8px;height:24px}.sb-card .sb-card-badge{height:30px;width:30px;object-fit:contain}.sb-card .sb-card-meta-item{font-size:11.9994px;color:var(--gray-400);width:172px;line-height:17px}.sb-card .sb-card-title{color:var(--primary-color);font-size:14px;line-height:17.5px;font-weight:700;height:35px;margin:16px 0 8px 0;overflow:hidden}.sb-card .sb-card-org{font-size:14px;color:var(--gray-400)}.sb-card .sb-card-progressbar{height:4px}.sb-card .sb-card-progressbar .ui.progress .bar{border-radius:0 4px 4px 4px}.sb-card .sb-card-hover{position:absolute;top:0;max-width:292px;width:100%;height:100%;background-color:rgba(2,79,157,0.85);display:none}.sb-card .sb-card-hover .sb-card-hover-content{display:flex;align-items:center;height:100%;justify-content:center}.sb-card .sb-card-hover.sb-card-hover-gray{background:rgba(153,153,153,0.95)}.sb-card .sb-card-hover.sb-card-hover-gray .sb-exclamation-icon,.sb-card .sb-card-hover.sb-card-hover-gray p{color:white}.sb-card:hover{box-shadow:0 2px 7px 0 rgba(0,0,0,0.16)}.sb-card:hover .sb-card-hover{display:block}app-card[lang="ta"] .sb-card .sb-card-label{font-size:9px}app-card[lang="ta"] .sb-card .sb-card-meta-item{font-size:10px}app-card[lang="ta"] .sb-card .sb-card-title{font-size:11.9994px}app-card[lang="ta"] .sb-card .sb-card-org{font-size:11.9994px}app-card[lang="ur"] .sb-card .sb-card-label{font-size:9px}app-card[lang="ur"] .sb-card .sb-card-meta-item{font-size:10px}app-card[lang="ur"] .sb-card .sb-card-title{font-size:11.9994px}app-card[lang="ur"] .sb-card .sb-card-org{font-size:11.9994px}.sb-wspace-card{height:128px;max-width:292px;border:.5px solid var(--gray-0);border-left:4px solid var(--white);border-radius:4px;background:var(--white);padding:16px 24px;margin:0px 24px 24px 0}.sb-wspace-card .sb-wspace-title{margin-bottom:8px;font-size:16.002px;font-weight:700}.sb-wspace-card .sb-wspace-description{font-size:11.9994px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical}.sb-wspace-card:hover,.sb-wspace-card.active{border-left:4px solid var(--secondary-200);cursor:pointer;box-shadow:2px 5px 7px 0 rgba(0,0,0,0.2)}.sb-wspace-card:hover .sb-wspace-title,.sb-wspace-card.active .sb-wspace-title{color:var(--blue)}.sb-card-qr .sb-btn{border-radius:0;width:100%}.sb-card-qr:hover .sb-btn{background:var(--secondary-400)}.ui.card.sb-batch-card{border:1px solid var(--primary-200);box-shadow:none}.ui.card.sb-batch-card .item{padding:10px 0}.ui.card.sb-batch-card .item .content>.header{padding-bottom:5px}.ui.card.sb-batch-card>.sb-batch-card-content{padding:0 1rem;border-top:1px solid rgba(34,36,38,0.1)}.sb-batch-card .sb-batch-card-title{font-weight:600;font-size:1.18em}.sb-batch-card .item i.icon{font-size:16.002px}.sb-batch-card .sb-no-batch-found{background-color:var(--tertiary-0);border:1px solid var(--tertiary-100);padding:8px 16px;border-radius:4px;font-size:11.9994px}
diff --git a/backup/src/card/card.spec.ts b/backup/src/card/card.spec.ts
deleted file mode 100644
index 0b3e2dc..0000000
--- a/backup/src/card/card.spec.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-import {TestBed, ComponentFixture, inject} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {SbCardModule} from './card.module';
-import {SbCard} from './card';
-import {SbCardConfig} from './card-config';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getAlertElement(element: HTMLElement): HTMLDivElement {
- return element.querySelector('.alert');
-}
-
-function getCloseButton(element: HTMLElement): HTMLButtonElement {
- return element.querySelector('button');
-}
-
-function getCloseButtonIcon(element: HTMLElement): HTMLSpanElement {
- return element.querySelector('button > span');
-}
-
-describe('sb-card', () => {
-
- beforeEach(() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [SbCardModule]}); });
-
- it('should initialize inputs with default values', () => {
- const defaultConfig = new SbCardConfig();
- const alertCmp = TestBed.createComponent(SbCard).componentInstance;
- expect(alertCmp.dismissible).toBe(defaultConfig.dismissible);
- expect(alertCmp.type).toBe(defaultConfig.type);
- });
-
- it('should apply those default values to the template', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.getAttribute('role')).toEqual('alert');
- expect(alertEl).toHaveCssClass('alert-warning');
- expect(alertEl).toHaveCssClass('alert-dismissible');
- });
-
- it('should allow specifying alert type', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.getAttribute('role')).toEqual('alert');
- expect(alertEl).toHaveCssClass('alert-success');
- });
-
- it('should allow changing alert type', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).toHaveCssClass('alert-success');
- expect(alertEl).not.toHaveCssClass('alert-warning');
-
- fixture.componentInstance.type = 'warning';
- fixture.detectChanges();
- expect(alertEl).not.toHaveCssClass('alert-success');
- expect(alertEl).toHaveCssClass('alert-warning');
- });
-
- it('should allow adding custom CSS classes', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).toHaveCssClass('alert');
- expect(alertEl).toHaveCssClass('alert-success');
- expect(alertEl).toHaveCssClass('myClass');
- });
-
- it('should render close button when dismissible', () => {
- const fixture = createTestComponent('Watch out! ');
- const alertEl = getAlertElement(fixture.nativeElement);
- const buttonEl = getCloseButton(alertEl);
- const buttonIconEl = getCloseButtonIcon(alertEl);
-
- expect(alertEl).toHaveCssClass('alert-dismissible');
- expect(buttonEl).toBeTruthy();
- expect(buttonEl.getAttribute('class')).toContain('close');
- expect(buttonEl.getAttribute('aria-label')).toBe('Close');
- expect(buttonIconEl.getAttribute('aria-hidden')).toBe('true');
- expect(buttonIconEl.textContent).toBe('×');
- });
-
- it('should not render the close button if it is not dismissible', () => {
- const fixture = createTestComponent(`Don't close! `);
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl).not.toHaveCssClass('alert-dismissible');
- expect(getCloseButton(alertEl)).toBeFalsy();
- });
-
- it('should fire an event after closing a dismissible alert', () => {
- const fixture =
- createTestComponent('Watch out! ');
- const alertEl = getAlertElement(fixture.nativeElement);
- const buttonEl = getCloseButton(alertEl);
-
- expect(fixture.componentInstance.closed).toBe(false);
- buttonEl.click();
- expect(fixture.componentInstance.closed).toBe(true);
- });
-
- it('should project the content given into the component', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- expect(alertEl.textContent).toContain('Cool!');
- });
-
- it('should project content before the closing button for a11y/screen readers', () => {
- const fixture = createTestComponent('Cool! ');
- const alertEl = getAlertElement(fixture.nativeElement);
-
- const childElements = Array.from(alertEl.children).map(node => node.tagName.toLowerCase());
- expect(childElements).toEqual(['span', 'button']);
- });
-
- describe('Custom config', () => {
- let config: SbCardConfig;
-
- beforeEach(() => { TestBed.configureTestingModule({imports: [SbCardModule]}); });
-
- beforeEach(inject([SbCardConfig], (c: SbCardConfig) => {
- config = c;
- config.dismissible = false;
- config.type = 'success';
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(SbCard);
- fixture.detectChanges();
-
- const alert = fixture.componentInstance;
- expect(alert.dismissible).toBe(config.dismissible);
- expect(alert.type).toBe(config.type);
- });
- });
-
- describe('Custom config as provider', () => {
- let config = new SbCardConfig();
- config.dismissible = false;
- config.type = 'success';
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [SbCardModule], providers: [{provide: SbCardConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = TestBed.createComponent(SbCard);
- fixture.detectChanges();
-
- const alert = fixture.componentInstance;
- expect(alert.dismissible).toBe(config.dismissible);
- expect(alert.type).toBe(config.type);
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: '', entryComponents: [SbCard]})
-class TestComponent {
- name = 'World';
- closed = false;
- type = 'success';
-}
diff --git a/backup/src/card/card.ts b/backup/src/card/card.ts
deleted file mode 100644
index d9cd5d1..0000000
--- a/backup/src/card/card.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import {
- Component,
- Directive,
- Output,
- EventEmitter,
- ContentChild,
- ChangeDetectionStrategy,
- Renderer2,
- ElementRef,
- OnChanges,
- OnInit,
- SimpleChanges,
- ViewEncapsulation,
- TemplateRef,
- Input,
- AfterContentChecked
-} from '@angular/core';
-
-import {SbCardConfig} from './card-config';
-
-@Directive({selector: 'ng-template[sbCardTitle]'})
-export class SbCardTitle {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardTopic1]'})
-export class SbCardTopic1 {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardTopic2]'})
-export class SbCardTopic2 {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardOrg]'})
-export class SbCardOrg {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardLabel]'})
-export class SbCardLabel {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardSubject]'})
-export class SbCardSubject {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardMedium'})
-export class SbCardMedium {
- constructor(public templateRef: TemplateRef) {}
-}
-@Directive({selector: 'ng-template[sbCardClass'})
-export class SbCardClass {
- constructor(public templateRef: TemplateRef) {}
-}
-
-
-@Component({
- selector: 'sb-card',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- host: {'role': 'alert', 'class': 'alert', '[class.alert-dismissible]': 'dismissible'},
- template: `
- `,
- styleUrls: ['./card.scss']
-})
-
-export class SbCard implements OnInit, AfterContentChecked {
- @ContentChild(SbCardTitle, {read: TemplateRef, static: false}) sbCardTitle: TemplateRef| null = null ;
- ngAfterContentChecked() {
- }
-
- constructor(config: SbCardConfig, private _renderer: Renderer2, private _element: ElementRef) {
- }
-
- ngOnInit() { }
-}
diff --git a/backup/src/carousel/carousel-config.spec.ts b/backup/src/carousel/carousel-config.spec.ts
deleted file mode 100644
index a13334a..0000000
--- a/backup/src/carousel/carousel-config.spec.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {NgbCarouselConfig} from './carousel-config';
-
-describe('ngb-carousel-config', () => {
- it('should have sensible default values', () => {
- const config = new NgbCarouselConfig();
-
- expect(config.interval).toBe(5000);
- expect(config.keyboard).toBe(true);
- expect(config.wrap).toBe(true);
- expect(config.pauseOnHover).toBe(true);
- expect(config.showNavigationIndicators).toBe(true);
- expect(config.showNavigationArrows).toBe(true);
- });
-});
diff --git a/backup/src/carousel/carousel-config.ts b/backup/src/carousel/carousel-config.ts
deleted file mode 100644
index c21a453..0000000
--- a/backup/src/carousel/carousel-config.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Injectable} from '@angular/core';
-
-/**
- * A configuration service for the [NgbCarousel](#/components/carousel/api#NgbCarousel) component.
- *
- * You can inject this service, typically in your root component, and customize its properties
- * to provide default values for all carousels used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class NgbCarouselConfig {
- interval = 5000;
- wrap = true;
- keyboard = true;
- pauseOnHover = true;
- showNavigationArrows = true;
- showNavigationIndicators = true;
-}
diff --git a/backup/src/carousel/carousel.module.ts b/backup/src/carousel/carousel.module.ts
deleted file mode 100644
index 51905c9..0000000
--- a/backup/src/carousel/carousel.module.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-
-import {NGB_CAROUSEL_DIRECTIVES} from './carousel';
-
-export {NgbCarousel, NgbSlide, NgbSlideEvent, NgbSlideEventDirection, NgbSlideEventSource} from './carousel';
-export {NgbCarouselConfig} from './carousel-config';
-
-@NgModule({declarations: NGB_CAROUSEL_DIRECTIVES, exports: NGB_CAROUSEL_DIRECTIVES, imports: [CommonModule]})
-export class NgbCarouselModule {
-}
diff --git a/backup/src/carousel/carousel.spec.ts b/backup/src/carousel/carousel.spec.ts
deleted file mode 100644
index e3ad7d6..0000000
--- a/backup/src/carousel/carousel.spec.ts
+++ /dev/null
@@ -1,909 +0,0 @@
-import {fakeAsync, discardPeriodicTasks, tick, TestBed, ComponentFixture, inject} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-
-import {By} from '@angular/platform-browser';
-import {ChangeDetectionStrategy, Component} from '@angular/core';
-
-import {NgbCarouselModule} from './carousel.module';
-import {NgbCarousel, NgbSlideEvent, NgbSlideEventDirection, NgbSlideEventSource} from './carousel';
-import {NgbCarouselConfig} from './carousel-config';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function expectActiveSlides(nativeEl: HTMLDivElement, active: boolean[]) {
- const slideElms = nativeEl.querySelectorAll('.carousel-item');
- const indicatorElms = nativeEl.querySelectorAll('ol.carousel-indicators > li');
-
- expect(slideElms.length).toBe(active.length);
- expect(indicatorElms.length).toBe(active.length);
-
- for (let i = 0; i < active.length; i++) {
- if (active[i]) {
- expect(slideElms[i]).toHaveCssClass('active');
- expect(indicatorElms[i]).toHaveCssClass('active');
- } else {
- expect(slideElms[i]).not.toHaveCssClass('active');
- expect(indicatorElms[i]).not.toHaveCssClass('active');
- }
- }
-}
-
-describe('ngb-carousel', () => {
- beforeEach(() => {
- TestBed.configureTestingModule({declarations: [TestComponent, TestComponentOnPush], imports: [NgbCarouselModule]});
- });
-
- it('should initialize inputs with default values', () => {
- const defaultConfig = new NgbCarouselConfig();
- const carousel = new NgbCarousel(new NgbCarouselConfig(), null, null, null);
-
- expect(carousel.interval).toBe(defaultConfig.interval);
- expect(carousel.wrap).toBe(defaultConfig.wrap);
- expect(carousel.keyboard).toBe(defaultConfig.keyboard);
- expect(carousel.pauseOnHover).toBe(defaultConfig.pauseOnHover);
- expect(carousel.showNavigationIndicators).toBe(defaultConfig.showNavigationIndicators);
- expect(carousel.showNavigationArrows).toBe(defaultConfig.showNavigationArrows);
- });
-
- it('should render slides and navigation indicators', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
- const fixture = createTestComponent(html);
-
- const slideElms = fixture.nativeElement.querySelectorAll('.carousel-item');
- expect(slideElms.length).toBe(2);
- expect(slideElms[0].textContent).toMatch(/foo/);
- expect(slideElms[1].textContent).toMatch(/bar/);
-
- expect(fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li').length).toBe(2);
- expect(fixture.nativeElement.querySelectorAll('[role="button"]').length).toBe(2);
-
- discardPeriodicTasks();
- }));
-
-
- it('should mark the first slide as active by default', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should work without any slides', fakeAsync(() => {
- const fixture = createTestComponent(` `);
-
- tick(1001);
- fixture.detectChanges();
-
- const carousel = fixture.nativeElement.querySelector('ngb-carousel');
- const slides = fixture.nativeElement.querySelectorAll('.carousel-item');
-
- expect(carousel).toBeTruthy();
- expect(slides.length).toBe(0);
-
- discardPeriodicTasks();
- }));
-
-
- it('should mark the requested slide as active', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- fixture.componentInstance.activeSlideId = 1;
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should auto-correct when slide index is undefined', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should change slide on prev/next API calls', fakeAsync(() => {
- const html = `
-
- foo
- bar
- baz
-
- Next
- Prev
- Select 3
- `;
-
- const fixture = createTestComponent(html);
- const next = fixture.nativeElement.querySelector('#next');
- const prev = fixture.nativeElement.querySelector('#prev');
- const select = fixture.nativeElement.querySelector('#select');
-
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- next.click();
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- prev.click();
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- select.click();
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, false, true]);
- }));
-
- it('should pause/resume slide change on API calls', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- Next
- Prev
- `;
-
- const fixture = createTestComponent(html);
- const pause = fixture.nativeElement.querySelector('#pause');
- const cycle = fixture.nativeElement.querySelector('#cycle');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(1000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- pause.click();
- tick(1000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- cycle.click();
- tick(1000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should not resume without call to cycle()', fakeAsync(() => {
- const html = `
-
- foo
- bar
- third
-
- Next
- Pause
- Cycle
- `;
-
- const fixture = createTestComponent(html);
- const spyCallBack = spyOn(fixture.componentInstance, 'carouselSlideCallBack');
- const carouselDebugEl = fixture.debugElement.query(By.directive(NgbCarousel));
- const indicatorElms = fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li');
- const prevControlElm = fixture.nativeElement.querySelector('.carousel-control-prev');
- const nextControlElm = fixture.nativeElement.querySelector('.carousel-control-next');
- const next = fixture.nativeElement.querySelector('#next');
- const pause = fixture.nativeElement.querySelector('#pause');
- const cycle = fixture.nativeElement.querySelector('#cycle');
-
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack)
- .toHaveBeenCalledWith(jasmine.objectContaining({paused: false, source: NgbSlideEventSource.TIMER}));
- spyCallBack.calls.reset();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- pause.click();
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- indicatorElms[0].click();
- fixture.detectChanges();
- expect(spyCallBack)
- .toHaveBeenCalledWith(jasmine.objectContaining({paused: true, source: NgbSlideEventSource.INDICATOR}));
- spyCallBack.calls.reset();
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- nextControlElm.click();
- fixture.detectChanges();
- expect(spyCallBack)
- .toHaveBeenCalledWith(jasmine.objectContaining({paused: true, source: NgbSlideEventSource.ARROW_RIGHT}));
- spyCallBack.calls.reset();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- prevControlElm.click();
- fixture.detectChanges();
- expect(spyCallBack)
- .toHaveBeenCalledWith(jasmine.objectContaining({paused: true, source: NgbSlideEventSource.ARROW_LEFT}));
- spyCallBack.calls.reset();
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- next.click();
- fixture.detectChanges();
- expect(spyCallBack).toHaveBeenCalledWith(jasmine.objectContaining({paused: true}));
- spyCallBack.calls.reset();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- carouselDebugEl.triggerEventHandler('mouseenter', {});
- fixture.detectChanges();
- carouselDebugEl.triggerEventHandler('mouseleave', {});
- fixture.detectChanges();
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack).not.toHaveBeenCalled();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- cycle.click();
- tick(1000);
- fixture.detectChanges();
- expect(spyCallBack)
- .toHaveBeenCalledWith(jasmine.objectContaining({paused: false, source: NgbSlideEventSource.TIMER}));
- expectActiveSlides(fixture.nativeElement, [false, false, true]);
-
- discardPeriodicTasks();
- }));
-
-
- it('should mark component for check for API calls', () => {
- const html = `
-
- foo
- bar
- baz
-
- Next
- `;
-
- const fixture = createTestComponent(html);
- const next = fixture.nativeElement.querySelector('#next');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- next.click();
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
- });
-
- it('should mark component for check when slides change', () => {
- const html = `
-
-
- {{ s }}
-
-
- `;
-
- function getSlidesText(element: HTMLElement): string[] {
- return Array.from(element.querySelectorAll('.carousel-item .slide')).map((el: HTMLElement) => el.innerHTML);
- }
-
- const fixture = createTestComponent(html);
- expect(getSlidesText(fixture.nativeElement)).toEqual(['a', 'b']);
-
- fixture.componentInstance.slides = ['c', 'd'];
- fixture.detectChanges();
- expect(getSlidesText(fixture.nativeElement)).toEqual(['c', 'd']);
- });
-
- it('should change slide on indicator click', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- const indicatorElms = fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- indicatorElms[1].click();
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should fire a slide event with correct direction and source on indicator click', fakeAsync(() => {
- const html = `
-
- foo
- bar
- pluto
-
- `;
-
- const fixture = createTestComponent(html);
- const indicatorElms = fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li');
- const spyCallBack = spyOn(fixture.componentInstance, 'carouselSlideCallBack');
-
- indicatorElms[1].click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.LEFT,
- source: NgbSlideEventSource.INDICATOR
- }));
-
- spyCallBack.calls.reset();
- indicatorElms[0].click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.RIGHT,
- source: NgbSlideEventSource.INDICATOR
- }));
-
- spyCallBack.calls.reset();
- indicatorElms[2].click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.LEFT,
- source: NgbSlideEventSource.INDICATOR
- }));
-
- discardPeriodicTasks();
- }));
-
- it('should change slide on carousel control click', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- const prevControlElm = fixture.nativeElement.querySelector('.carousel-control-prev');
- const nextControlElm = fixture.nativeElement.querySelector('.carousel-control-next');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- nextControlElm.click(); // next
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- prevControlElm.click(); // prev
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should fire a slide event with correct direction and source on carousel control click', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- const prevControlElm = fixture.nativeElement.querySelector('.carousel-control-prev');
- const nextControlElm = fixture.nativeElement.querySelector('.carousel-control-next');
- const spyCallBack = spyOn(fixture.componentInstance, 'carouselSlideCallBack');
-
- prevControlElm.click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.RIGHT,
- source: NgbSlideEventSource.ARROW_LEFT
- }));
- spyCallBack.calls.reset();
- nextControlElm.click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.LEFT,
- source: NgbSlideEventSource.ARROW_RIGHT
- }));
-
- spyCallBack.calls.reset();
- prevControlElm.click();
- fixture.detectChanges();
- expect(fixture.componentInstance.carouselSlideCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.RIGHT,
- source: NgbSlideEventSource.ARROW_LEFT
- }));
-
- discardPeriodicTasks();
- }));
-
- it('should change slide on time passage (default interval value)', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should fire a slide event with correct direction and source on time passage', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- const spyCallBack = spyOn(fixture.componentInstance, 'carouselSlideCallBack');
-
- tick(1999);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
- expect(spyCallBack).not.toHaveBeenCalled();
-
- tick(1);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
- expect(spyCallBack).toHaveBeenCalledWith(jasmine.objectContaining({
- direction: NgbSlideEventDirection.LEFT,
- source: NgbSlideEventSource.TIMER
- }));
-
- discardPeriodicTasks();
- }));
-
- it('should change slide on time passage in OnPush component (default interval value)', fakeAsync(() => {
- const fixture = createTestComponent(' ');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should change slide on time passage (custom interval value)', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(1000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(1200);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should not change slide on time passage (custom interval value is zero)', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(1000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(1200);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- discardPeriodicTasks();
- }));
-
- it('should change slide with different rate when interval value changed', fakeAsync(() => {
- const html = `
-
- foo
- bar
- zoo
-
- `;
-
- const fixture = createTestComponent(html);
- fixture.componentInstance.interval = 5000;
- fixture.detectChanges();
-
- expectActiveSlides(fixture.nativeElement, [true, false, false]);
-
- tick(5001);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true, false]);
-
- fixture.componentInstance.interval = 1000;
- fixture.detectChanges();
-
- tick(1001);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should listen to mouse events based on pauseOnHover attribute', fakeAsync(() => {
-
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- const carouselDebugEl = fixture.debugElement.query(By.directive(NgbCarousel));
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- carouselDebugEl.triggerEventHandler('mouseenter', {});
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- carouselDebugEl.triggerEventHandler('mouseleave', {});
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- fixture.componentInstance.pauseOnHover = false;
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- carouselDebugEl.triggerEventHandler('mouseenter', {});
- fixture.detectChanges();
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
- discardPeriodicTasks();
- }));
-
- it('should pause / resume slide change with time passage on mouse enter / leave', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- const carouselDebugEl = fixture.debugElement.query(By.directive(NgbCarousel));
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- carouselDebugEl.triggerEventHandler('mouseenter', {});
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- carouselDebugEl.triggerEventHandler('mouseleave', {});
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- tick(6000);
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should wrap slide changes by default', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- const prevControlElm = fixture.nativeElement.querySelector('.carousel-control-prev');
- const nextControlElm = fixture.nativeElement.querySelector('.carousel-control-next');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- nextControlElm.click(); // next
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- nextControlElm.click(); // next
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- prevControlElm.click(); // prev
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should not wrap slide changes by when requested', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
-
- const prevControlElm = fixture.nativeElement.querySelector('.carousel-control-prev');
- const nextControlElm = fixture.nativeElement.querySelector('.carousel-control-next');
-
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- prevControlElm.click(); // prev
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- nextControlElm.click(); // next
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- nextControlElm.click(); // next
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
- }));
-
- it('should change on key arrowRight and arrowLeft', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- fixture.debugElement.query(By.directive(NgbCarousel)).triggerEventHandler('keydown.arrowRight', {}); // next()
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- fixture.debugElement.query(By.directive(NgbCarousel)).triggerEventHandler('keydown.arrowLeft', {}); // prev()
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- fixture.componentInstance.keyboard = false;
- fixture.detectChanges();
- fixture.debugElement.query(By.directive(NgbCarousel)).triggerEventHandler('keydown.arrowRight', {}); // prev()
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
-
- discardPeriodicTasks();
-
- }));
-
- it('should listen to keyevents based on keyboard attribute', fakeAsync(() => {
- const html = `
-
- foo
- bar
-
- `;
-
- const fixture = createTestComponent(html);
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- fixture.componentInstance.keyboard = false;
- fixture.detectChanges();
- fixture.debugElement.query(By.directive(NgbCarousel)).triggerEventHandler('keydown.arrowRight', {}); // prev()
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [true, false]);
-
- fixture.componentInstance.keyboard = true;
- fixture.detectChanges();
- fixture.debugElement.query(By.directive(NgbCarousel)).triggerEventHandler('keydown.arrowRight', {}); // next()
- fixture.detectChanges();
- expectActiveSlides(fixture.nativeElement, [false, true]);
-
- discardPeriodicTasks();
-
- }));
-
- it('should render navigation indicators according to the flags', fakeAsync(() => {
- const html = `
-
- foo
-
- `;
- const fixture = createTestComponent(html);
-
- const slideElms = fixture.nativeElement.querySelectorAll('.carousel-item');
- expect(slideElms.length).toBe(1);
- expect(slideElms[0].textContent).toMatch(/foo/);
- expect(fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li').length).toBe(1);
-
- fixture.componentInstance.showNavigationIndicators = false;
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelectorAll('ol.carousel-indicators > li').length).toBe(0);
-
- discardPeriodicTasks();
- }));
-
- it('should render navigation buttons according to the flags', fakeAsync(() => {
- const html = `
-
- foo
-
- `;
- const fixture = createTestComponent(html);
-
- const slideElms = fixture.nativeElement.querySelectorAll('.carousel-item');
- expect(slideElms.length).toBe(1);
- expect(fixture.nativeElement.querySelectorAll('[role="button"]').length).toBe(2);
-
- fixture.componentInstance.showNavigationArrows = false;
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelectorAll('[role="button"]').length).toBe(0);
-
- discardPeriodicTasks();
- }));
-
- describe('Custom config', () => {
- let config: NgbCarouselConfig;
-
- beforeEach(() => { TestBed.configureTestingModule({imports: [NgbCarouselModule]}); });
-
- beforeEach(inject([NgbCarouselConfig], (c: NgbCarouselConfig) => {
- config = c;
- config.interval = 1000;
- config.wrap = false;
- config.keyboard = false;
- config.pauseOnHover = false;
- config.showNavigationIndicators = true;
- config.showNavigationArrows = true;
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(NgbCarousel);
- fixture.detectChanges();
-
- const carousel = fixture.componentInstance;
- expect(carousel.interval).toBe(config.interval);
- expect(carousel.wrap).toBe(config.wrap);
- expect(carousel.keyboard).toBe(config.keyboard);
- expect(carousel.pauseOnHover).toBe(config.pauseOnHover);
- expect(carousel.showNavigationIndicators).toBe(config.showNavigationIndicators);
- expect(carousel.showNavigationArrows).toBe(config.showNavigationArrows);
- });
- });
-
- describe('Custom config as provider', () => {
- const config = new NgbCarouselConfig();
- config.interval = 1000;
- config.wrap = false;
- config.keyboard = false;
- config.pauseOnHover = false;
- config.showNavigationIndicators = true;
- config.showNavigationArrows = true;
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [NgbCarouselModule], providers: [{provide: NgbCarouselConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = TestBed.createComponent(NgbCarousel);
- fixture.detectChanges();
-
- const carousel = fixture.componentInstance;
- expect(carousel.interval).toBe(config.interval);
- expect(carousel.wrap).toBe(config.wrap);
- expect(carousel.keyboard).toBe(config.keyboard);
- expect(carousel.pauseOnHover).toBe(config.pauseOnHover);
- expect(carousel.showNavigationIndicators).toBe(config.showNavigationIndicators);
- expect(carousel.showNavigationArrows).toBe(config.showNavigationArrows);
- });
- });
-
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- addNewSlide = false;
- interval;
- activeSlideId;
- keyboard = true;
- pauseOnHover = true;
- showNavigationArrows = true;
- showNavigationIndicators = true;
- slides = ['a', 'b'];
- carouselSlideCallBack = (event: NgbSlideEvent) => {};
-}
-
-@Component({
- selector: 'test-cmp-on-push',
- changeDetection: ChangeDetectionStrategy.OnPush,
- template: `
-
- foo
- bar
-
- `
-})
-class TestComponentOnPush {
-}
diff --git a/backup/src/carousel/carousel.ts b/backup/src/carousel/carousel.ts
deleted file mode 100644
index 531121f..0000000
--- a/backup/src/carousel/carousel.ts
+++ /dev/null
@@ -1,342 +0,0 @@
-import {
- AfterContentChecked,
- AfterContentInit,
- ChangeDetectionStrategy,
- ChangeDetectorRef,
- Component,
- ContentChildren,
- Directive,
- EventEmitter,
- Inject,
- Input,
- NgZone,
- OnDestroy,
- Output,
- PLATFORM_ID,
- QueryList,
- TemplateRef,
- HostListener
-} from '@angular/core';
-import {isPlatformBrowser} from '@angular/common';
-
-import {NgbCarouselConfig} from './carousel-config';
-
-import {Subject, timer, BehaviorSubject, combineLatest, NEVER} from 'rxjs';
-import {startWith, map, switchMap, takeUntil, distinctUntilChanged} from 'rxjs/operators';
-
-let nextId = 0;
-
-/**
- * A directive that wraps the individual carousel slide.
- */
-@Directive({selector: 'ng-template[ngbSlide]'})
-export class NgbSlide {
- /**
- * Slide id that must be unique for the entire document.
- *
- * If not provided, will be generated in the `ngb-slide-xx` format.
- */
- @Input() id = `ngb-slide-${nextId++}`;
- constructor(public tplRef: TemplateRef) {}
-}
-
-/**
- * Carousel is a component to easily create and control slideshows.
- *
- * Allows to set intervals, change the way user interacts with the slides and provides a programmatic API.
- */
-@Component({
- selector: 'ngb-carousel',
- exportAs: 'ngbCarousel',
- changeDetection: ChangeDetectionStrategy.OnPush,
- host: {
- 'class': 'carousel slide',
- '[style.display]': '"block"',
- 'tabIndex': '0',
- '(keydown.arrowLeft)': 'keyboard && prev(NgbSlideEventSource.ARROW_LEFT)',
- '(keydown.arrowRight)': 'keyboard && next(NgbSlideEventSource.ARROW_RIGHT)'
- },
- template: `
-
-
-
-
-
-
- Previous
-
-
-
- Next
-
- `
-})
-export class NgbCarousel implements AfterContentChecked,
- AfterContentInit, OnDestroy {
- @ContentChildren(NgbSlide) slides: QueryList;
-
- public NgbSlideEventSource = NgbSlideEventSource;
-
- private _destroy$ = new Subject();
- private _interval$ = new BehaviorSubject(0);
- private _mouseHover$ = new BehaviorSubject(false);
- private _pauseOnHover$ = new BehaviorSubject(false);
- private _pause$ = new BehaviorSubject(false);
- private _wrap$ = new BehaviorSubject(false);
-
- /**
- * The slide id that should be displayed **initially**.
- *
- * For subsequent interactions use methods `select()`, `next()`, etc. and the `(slide)` output.
- */
- @Input() activeId: string;
-
- /**
- * Time in milliseconds before the next slide is shown.
- */
- @Input()
- set interval(value: number) {
- this._interval$.next(value);
- }
-
- get interval() { return this._interval$.value; }
-
- /**
- * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
- */
- @Input()
- set wrap(value: boolean) {
- this._wrap$.next(value);
- }
-
- get wrap() { return this._wrap$.value; }
-
- /**
- * If `true`, allows to interact with carousel using keyboard 'arrow left' and 'arrow right'.
- */
- @Input() keyboard: boolean;
-
- /**
- * If `true`, will pause slide switching when mouse cursor hovers the slide.
- *
- * @since 2.2.0
- */
- @Input()
- set pauseOnHover(value: boolean) {
- this._pauseOnHover$.next(value);
- }
-
- get pauseOnHover() { return this._pauseOnHover$.value; }
-
- /**
- * If `true`, 'previous' and 'next' navigation arrows will be visible on the slide.
- *
- * @since 2.2.0
- */
- @Input() showNavigationArrows: boolean;
-
- /**
- * If `true`, navigation indicators at the bottom of the slide will be visible.
- *
- * @since 2.2.0
- */
- @Input() showNavigationIndicators: boolean;
-
- /**
- * An event emitted right after the slide transition is completed.
- *
- * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.
- */
- @Output() slide = new EventEmitter();
-
- constructor(
- config: NgbCarouselConfig, @Inject(PLATFORM_ID) private _platformId, private _ngZone: NgZone,
- private _cd: ChangeDetectorRef) {
- this.interval = config.interval;
- this.wrap = config.wrap;
- this.keyboard = config.keyboard;
- this.pauseOnHover = config.pauseOnHover;
- this.showNavigationArrows = config.showNavigationArrows;
- this.showNavigationIndicators = config.showNavigationIndicators;
- }
-
- @HostListener('mouseenter')
- mouseEnter() {
- this._mouseHover$.next(true);
- }
-
- @HostListener('mouseleave')
- mouseLeave() {
- this._mouseHover$.next(false);
- }
-
- ngAfterContentInit() {
- // setInterval() doesn't play well with SSR and protractor,
- // so we should run it in the browser and outside Angular
- if (isPlatformBrowser(this._platformId)) {
- this._ngZone.runOutsideAngular(() => {
- const hasNextSlide$ = combineLatest(
- this.slide.pipe(map(slideEvent => slideEvent.current), startWith(this.activeId)),
- this._wrap$, this.slides.changes.pipe(startWith(null)))
- .pipe(
- map(([currentSlideId, wrap]) => {
- const slideArr = this.slides.toArray();
- const currentSlideIdx = this._getSlideIdxById(currentSlideId);
- return wrap ? slideArr.length > 1 : currentSlideIdx < slideArr.length - 1;
- }),
- distinctUntilChanged());
- combineLatest(this._pause$, this._pauseOnHover$, this._mouseHover$, this._interval$, hasNextSlide$)
- .pipe(
- map(([pause, pauseOnHover, mouseHover, interval, hasNextSlide]) =>
- ((pause || (pauseOnHover && mouseHover) || !hasNextSlide) ? 0 : interval)),
-
- distinctUntilChanged(), switchMap(interval => interval > 0 ? timer(interval, interval) : NEVER),
- takeUntil(this._destroy$))
- .subscribe(() => this._ngZone.run(() => this.next(NgbSlideEventSource.TIMER)));
- });
- }
-
- this.slides.changes.pipe(takeUntil(this._destroy$)).subscribe(() => this._cd.markForCheck());
- }
-
- ngAfterContentChecked() {
- let activeSlide = this._getSlideById(this.activeId);
- this.activeId = activeSlide ? activeSlide.id : (this.slides.length ? this.slides.first.id : null);
- }
-
- ngOnDestroy() { this._destroy$.next(); }
-
- /**
- * Navigates to a slide with the specified identifier.
- */
- select(slideId: string, source?: NgbSlideEventSource) {
- this._cycleToSelected(slideId, this._getSlideEventDirection(this.activeId, slideId), source);
- }
-
- /**
- * Navigates to the previous slide.
- */
- prev(source?: NgbSlideEventSource) {
- this._cycleToSelected(this._getPrevSlide(this.activeId), NgbSlideEventDirection.RIGHT, source);
- }
-
- /**
- * Navigates to the next slide.
- */
- next(source?: NgbSlideEventSource) {
- this._cycleToSelected(this._getNextSlide(this.activeId), NgbSlideEventDirection.LEFT, source);
- }
-
- /**
- * Pauses cycling through the slides.
- */
- pause() { this._pause$.next(true); }
-
- /**
- * Restarts cycling through the slides from left to right.
- */
- cycle() { this._pause$.next(false); }
-
- private _cycleToSelected(slideIdx: string, direction: NgbSlideEventDirection, source?: NgbSlideEventSource) {
- let selectedSlide = this._getSlideById(slideIdx);
- if (selectedSlide && selectedSlide.id !== this.activeId) {
- this.slide.emit(
- {prev: this.activeId, current: selectedSlide.id, direction: direction, paused: this._pause$.value, source});
- this.activeId = selectedSlide.id;
- }
-
- // we get here after the interval fires or any external API call like next(), prev() or select()
- this._cd.markForCheck();
- }
-
- private _getSlideEventDirection(currentActiveSlideId: string, nextActiveSlideId: string): NgbSlideEventDirection {
- const currentActiveSlideIdx = this._getSlideIdxById(currentActiveSlideId);
- const nextActiveSlideIdx = this._getSlideIdxById(nextActiveSlideId);
-
- return currentActiveSlideIdx > nextActiveSlideIdx ? NgbSlideEventDirection.RIGHT : NgbSlideEventDirection.LEFT;
- }
-
- private _getSlideById(slideId: string): NgbSlide { return this.slides.find(slide => slide.id === slideId); }
-
- private _getSlideIdxById(slideId: string): number {
- return this.slides.toArray().indexOf(this._getSlideById(slideId));
- }
-
- private _getNextSlide(currentSlideId: string): string {
- const slideArr = this.slides.toArray();
- const currentSlideIdx = this._getSlideIdxById(currentSlideId);
- const isLastSlide = currentSlideIdx === slideArr.length - 1;
-
- return isLastSlide ? (this.wrap ? slideArr[0].id : slideArr[slideArr.length - 1].id) :
- slideArr[currentSlideIdx + 1].id;
- }
-
- private _getPrevSlide(currentSlideId: string): string {
- const slideArr = this.slides.toArray();
- const currentSlideIdx = this._getSlideIdxById(currentSlideId);
- const isFirstSlide = currentSlideIdx === 0;
-
- return isFirstSlide ? (this.wrap ? slideArr[slideArr.length - 1].id : slideArr[0].id) :
- slideArr[currentSlideIdx - 1].id;
- }
-}
-
-/**
- * A slide change event emitted right after the slide transition is completed.
- */
-export interface NgbSlideEvent {
- /**
- * The previous slide id.
- */
- prev: string;
-
- /**
- * The current slide id.
- */
- current: string;
-
- /**
- * The slide event direction.
- *
- * Possible values are `'left' | 'right'`.
- */
- direction: NgbSlideEventDirection;
-
- /**
- * Whether the pause() method was called (and no cycle() call was done afterwards).
- *
- * @since 5.1.0
- */
- paused: boolean;
-
- /**
- * Source triggering the slide change event.
- *
- * Possible values are `'timer' | 'arrowLeft' | 'arrowRight' | 'indicator'`
- *
- * @since 5.1.0
- */
- source?: NgbSlideEventSource;
-}
-
-/**
- * Defines the carousel slide transition direction.
- */
-export enum NgbSlideEventDirection {
- LEFT = 'left',
- RIGHT = 'right'
-}
-
-export enum NgbSlideEventSource {
- TIMER = 'timer',
- ARROW_LEFT = 'arrowLeft',
- ARROW_RIGHT = 'arrowRight',
- INDICATOR = 'indicator'
-}
-
-export const NGB_CAROUSEL_DIRECTIVES = [NgbCarousel, NgbSlide];
diff --git a/backup/src/collapse/collapse.module.ts b/backup/src/collapse/collapse.module.ts
deleted file mode 100644
index c5722ff..0000000
--- a/backup/src/collapse/collapse.module.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import {NgModule} from '@angular/core';
-import {NgbCollapse} from './collapse';
-
-export {NgbCollapse} from './collapse';
-
-@NgModule({declarations: [NgbCollapse], exports: [NgbCollapse]})
-export class NgbCollapseModule {
-}
diff --git a/backup/src/collapse/collapse.spec.ts b/backup/src/collapse/collapse.spec.ts
deleted file mode 100644
index a48a519..0000000
--- a/backup/src/collapse/collapse.spec.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import {ComponentFixture, TestBed} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {NgbCollapseModule} from './collapse.module';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getCollapsibleContent(element: HTMLElement): HTMLDivElement {
- return element.querySelector('.collapse');
-}
-
-describe('ngb-collapse', () => {
- beforeEach(() => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbCollapseModule]}); });
-
- it('should have content open', () => {
- const fixture = createTestComponent(`Some content
`);
-
- const collapseEl = getCollapsibleContent(fixture.nativeElement);
-
- expect(collapseEl).toHaveCssClass('show');
- });
-
- it('should have content closed', () => {
- const fixture = createTestComponent(`Some content
`);
- const tc = fixture.componentInstance;
- tc.collapsed = true;
- fixture.detectChanges();
-
- const collapseEl = getCollapsibleContent(fixture.nativeElement);
-
- expect(collapseEl).not.toHaveCssClass('show');
- });
-
- it('should toggle collapsed content based on bound model change', () => {
- const fixture = createTestComponent(`Some content
`);
-
- const tc = fixture.componentInstance;
- const collapseEl = getCollapsibleContent(fixture.nativeElement);
- expect(collapseEl).toHaveCssClass('show');
-
- tc.collapsed = true;
- fixture.detectChanges();
- expect(collapseEl).not.toHaveCssClass('show');
-
- tc.collapsed = false;
- fixture.detectChanges();
- expect(collapseEl).toHaveCssClass('show');
- });
-
- it('should allow toggling collapse from outside', () => {
- const fixture = createTestComponent(`
- Collapse
-
`);
-
- const compiled = fixture.nativeElement;
- const collapseEl = getCollapsibleContent(compiled);
- const buttonEl = compiled.querySelector('button');
-
- buttonEl.click();
- fixture.detectChanges();
- expect(collapseEl).not.toHaveCssClass('show');
-
- buttonEl.click();
- fixture.detectChanges();
- expect(collapseEl).toHaveCssClass('show');
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- collapsed = false;
-}
diff --git a/backup/src/collapse/collapse.ts b/backup/src/collapse/collapse.ts
deleted file mode 100644
index 2661e4f..0000000
--- a/backup/src/collapse/collapse.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import {Directive, Input} from '@angular/core';
-
-/**
- * A directive to provide a simple way of hiding and showing elements on the page.
- */
-@Directive({
- selector: '[ngbCollapse]',
- exportAs: 'ngbCollapse',
- host: {'[class.collapse]': 'true', '[class.show]': '!collapsed'}
-})
-export class NgbCollapse {
- /**
- * If `true`, will collapse the element or show it otherwise.
- */
- @Input('ngbCollapse') collapsed = false;
-}
diff --git a/backup/src/datepicker/adapters/ngb-date-adapter.spec.ts b/backup/src/datepicker/adapters/ngb-date-adapter.spec.ts
deleted file mode 100644
index 8c9dd24..0000000
--- a/backup/src/datepicker/adapters/ngb-date-adapter.spec.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-import {NgbDateStructAdapter} from './ngb-date-adapter';
-
-describe('ngb-date model adapter', () => {
- let adapter: NgbDateStructAdapter;
-
- beforeEach(() => { adapter = new NgbDateStructAdapter(); });
-
- describe('fromModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.fromModel(null)).toBeNull();
- expect(adapter.fromModel(undefined)).toBeNull();
- expect(adapter.fromModel('')).toBeNull();
- expect(adapter.fromModel('s')).toBeNull();
- expect(adapter.fromModel(2)).toBeNull();
- expect(adapter.fromModel({})).toBeNull();
- expect(adapter.fromModel(new Date())).toBeNull();
- expect(adapter.fromModel({year: 2017, month: 10})).toBeNull();
- expect(adapter.fromModel({month: 10, day: 10})).toBeNull();
- expect(adapter.fromModel({year: 2017, day: 10})).toBeNull();
- expect(adapter.fromModel({year: '2017', month: 10, day: 10})).toBeNull();
- expect(adapter.fromModel({year: 2017, month: '10', day: 10})).toBeNull();
- expect(adapter.fromModel({year: 2017, month: 10, day: '10'})).toBeNull();
- });
-
- it('should bypass numeric date', () => {
- expect(adapter.fromModel({year: 0, month: 0, day: 0})).toEqual({year: 0, month: 0, day: 0});
- expect(adapter.fromModel({year: 2016, month: 5, day: 1})).toEqual({year: 2016, month: 5, day: 1});
- });
- });
-
- describe('toModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.toModel(null)).toBeNull();
- expect(adapter.toModel(undefined)).toBeNull();
- expect(adapter.toModel('')).toBeNull();
- expect(adapter.toModel('s')).toBeNull();
- expect(adapter.toModel(2)).toBeNull();
- expect(adapter.toModel({})).toBeNull();
- expect(adapter.toModel(new Date())).toBeNull();
- expect(adapter.toModel({year: 2017, month: 10})).toBeNull();
- expect(adapter.toModel({month: 10, day: 10})).toBeNull();
- expect(adapter.toModel({year: 2017, day: 10})).toBeNull();
- expect(adapter.toModel({year: '2017', month: 10, day: 10})).toBeNull();
- expect(adapter.toModel({year: 2017, month: '10', day: 10})).toBeNull();
- expect(adapter.toModel({year: 2017, month: 10, day: '10'})).toBeNull();
- });
-
- it('should bypass numeric date', () => {
- expect(adapter.toModel({year: 0, month: 0, day: 0})).toEqual({year: 0, month: 0, day: 0});
- expect(adapter.toModel({year: 2016, month: 10, day: 15})).toEqual({year: 2016, month: 10, day: 15});
- });
- });
-
-});
diff --git a/backup/src/datepicker/adapters/ngb-date-adapter.ts b/backup/src/datepicker/adapters/ngb-date-adapter.ts
deleted file mode 100644
index 464314c..0000000
--- a/backup/src/datepicker/adapters/ngb-date-adapter.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import {Injectable} from '@angular/core';
-import {NgbDateStruct} from '../ngb-date-struct';
-import {isInteger} from '../../util/util';
-
-export function NGB_DATEPICKER_DATE_ADAPTER_FACTORY() {
- return new NgbDateStructAdapter();
-}
-
-/**
- * An abstract service that does the conversion between the internal datepicker `NgbDateStruct` model and
- * any provided user date model `D`, ex. a string, a native date, etc.
- *
- * The adapter is used **only** for conversion when binding datepicker to a form control,
- * ex. `[(ngModel)]="userDateModel"`. Here `userDateModel` can be of any type.
- *
- * The default datepicker implementation assumes we use `NgbDateStruct` as a user model.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details
- * and the [custom adapter demo](#/components/datepicker/examples#adapter) for an example.
- */
-@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY})
-export abstract class NgbDateAdapter {
- /**
- * Converts a user-model date of type `D` to an `NgbDateStruct` for internal use.
- */
- abstract fromModel(value: D): NgbDateStruct;
-
- /**
- * Converts an internal `NgbDateStruct` date to a user-model date of type `D`.
- */
- abstract toModel(date: NgbDateStruct): D;
-}
-
-@Injectable()
-export class NgbDateStructAdapter extends NgbDateAdapter {
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- */
- fromModel(date: NgbDateStruct): NgbDateStruct {
- return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
- {year: date.year, month: date.month, day: date.day} :
- null;
- }
-
- /**
- * Converts a NgbDateStruct value into NgbDateStruct value
- */
- toModel(date: NgbDateStruct): NgbDateStruct {
- return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
- {year: date.year, month: date.month, day: date.day} :
- null;
- }
-}
diff --git a/backup/src/datepicker/adapters/ngb-date-native-adapter.spec.ts b/backup/src/datepicker/adapters/ngb-date-native-adapter.spec.ts
deleted file mode 100644
index 55c2f93..0000000
--- a/backup/src/datepicker/adapters/ngb-date-native-adapter.spec.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import {NgbDateNativeAdapter} from './ngb-date-native-adapter';
-
-describe('ngb-date-native model adapter', () => {
- let adapter: NgbDateNativeAdapter;
-
- beforeEach(() => { adapter = new NgbDateNativeAdapter(); });
-
- describe('fromModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.fromModel(null)).toBeNull();
- expect(adapter.fromModel(undefined)).toBeNull();
- expect(adapter.fromModel('')).toBeNull();
- expect(adapter.fromModel('s')).toBeNull();
- expect(adapter.fromModel(2)).toBeNull();
- expect(adapter.fromModel({})).toBeNull();
- expect(adapter.fromModel({year: 2017, month: 10})).toBeNull();
- expect(adapter.fromModel(new Date('boom'))).toBeNull();
- });
-
- it('should convert valid date',
- () => { expect(adapter.fromModel(new Date(2016, 4, 1))).toEqual({year: 2016, month: 5, day: 1}); });
- });
-
- describe('toModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.toModel(null)).toBeNull();
- expect(adapter.toModel(undefined)).toBeNull();
- expect(adapter.toModel('')).toBeNull();
- expect(adapter.toModel('s')).toBeNull();
- expect(adapter.toModel(2)).toBeNull();
- expect(adapter.toModel({})).toBeNull();
- expect(adapter.toModel(new Date())).toBeNull();
- });
-
- it('should convert a valid date',
- () => { expect(adapter.toModel({year: 2016, month: 10, day: 15})).toEqual(new Date(2016, 9, 15, 12)); });
-
- it('should convert years between 0 and 99 correctly', () => {
-
- function jsDate(jsYear: number, jsMonth: number, jsDay: number): Date {
- const date = new Date(jsYear, jsMonth, jsDay, 12);
- if (jsYear >= 0 && jsYear <= 99) {
- date.setFullYear(jsYear);
- }
- return date;
- }
-
- expect(adapter.toModel({year: 0, month: 1, day: 1})).toEqual(jsDate(0, 0, 1));
- expect(adapter.toModel({year: 1, month: 1, day: 1})).toEqual(jsDate(1, 0, 1));
- expect(adapter.toModel({year: 99, month: 1, day: 1})).toEqual(jsDate(99, 0, 1));
- expect(adapter.toModel({year: 1900, month: 1, day: 1})).toEqual(jsDate(1900, 0, 1));
- });
- });
-
-});
diff --git a/backup/src/datepicker/adapters/ngb-date-native-adapter.ts b/backup/src/datepicker/adapters/ngb-date-native-adapter.ts
deleted file mode 100644
index 1c9bff5..0000000
--- a/backup/src/datepicker/adapters/ngb-date-native-adapter.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import {Injectable} from '@angular/core';
-import {NgbDateAdapter} from './ngb-date-adapter';
-import {NgbDateStruct} from '../ngb-date-struct';
-import {isInteger} from '../../util/util';
-
-/**
- * [`NgbDateAdapter`](#/components/datepicker/api#NgbDateAdapter) implementation that uses
- * native javascript dates as a user date model.
- */
-@Injectable()
-export class NgbDateNativeAdapter extends NgbDateAdapter {
- /**
- * Converts a native `Date` to a `NgbDateStruct`.
- */
- fromModel(date: Date): NgbDateStruct {
- return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;
- }
-
- /**
- * Converts a `NgbDateStruct` to a native `Date`.
- */
- toModel(date: NgbDateStruct): Date {
- return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :
- null;
- }
-
- protected _fromNativeDate(date: Date): NgbDateStruct {
- return {year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate()};
- }
-
- protected _toNativeDate(date: NgbDateStruct): Date {
- const jsDate = new Date(date.year, date.month - 1, date.day, 12);
- // avoid 30 -> 1930 conversion
- jsDate.setFullYear(date.year);
- return jsDate;
- }
-}
diff --git a/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.spec.ts b/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.spec.ts
deleted file mode 100644
index 014ab76..0000000
--- a/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.spec.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import {NgbDateNativeUTCAdapter} from './ngb-date-native-utc-adapter';
-
-describe('ngb-date-native-utc model adapter', () => {
- let adapter: NgbDateNativeUTCAdapter;
-
- beforeEach(() => { adapter = new NgbDateNativeUTCAdapter(); });
-
- describe('fromModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.fromModel(null)).toBeNull();
- expect(adapter.fromModel(undefined)).toBeNull();
- expect(adapter.fromModel('')).toBeNull();
- expect(adapter.fromModel('s')).toBeNull();
- expect(adapter.fromModel(2)).toBeNull();
- expect(adapter.fromModel({})).toBeNull();
- expect(adapter.fromModel({year: 2017, month: 10})).toBeNull();
- expect(adapter.fromModel(new Date('boom'))).toBeNull();
- });
-
- it('should convert valid date',
- () => { expect(adapter.fromModel(new Date(Date.UTC(2016, 4, 1)))).toEqual({year: 2016, month: 5, day: 1}); });
- });
-
- describe('toModel', () => {
-
- it('should convert invalid and incomplete values to null', () => {
- expect(adapter.toModel(null)).toBeNull();
- expect(adapter.toModel(undefined)).toBeNull();
- expect(adapter.toModel('')).toBeNull();
- expect(adapter.toModel('s')).toBeNull();
- expect(adapter.toModel(2)).toBeNull();
- expect(adapter.toModel({})).toBeNull();
- expect(adapter.toModel(new Date())).toBeNull();
- });
-
- it('should convert a valid date',
- () => { expect(adapter.toModel({year: 2016, month: 10, day: 15})).toEqual(new Date(Date.UTC(2016, 9, 15))); });
-
- it('should convert years between 0 and 99 correctly', () => {
-
- function jsDate(jsYear: number, jsMonth: number, jsDay: number): Date {
- const date = new Date(Date.UTC(jsYear, jsMonth, jsDay));
- if (jsYear >= 0 && jsYear <= 99) {
- date.setUTCFullYear(jsYear);
- }
- return date;
- }
-
- expect(adapter.toModel({year: 0, month: 1, day: 1})).toEqual(jsDate(0, 0, 1));
- expect(adapter.toModel({year: 1, month: 1, day: 1})).toEqual(jsDate(1, 0, 1));
- expect(adapter.toModel({year: 99, month: 1, day: 1})).toEqual(jsDate(99, 0, 1));
- expect(adapter.toModel({year: 1900, month: 1, day: 1})).toEqual(jsDate(1900, 0, 1));
- });
- });
-
-});
diff --git a/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.ts b/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.ts
deleted file mode 100644
index 9c7e98b..0000000
--- a/backup/src/datepicker/adapters/ngb-date-native-utc-adapter.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import {Injectable} from '@angular/core';
-import {NgbDateStruct} from '../ngb-date-struct';
-import {NgbDateNativeAdapter} from './ngb-date-native-adapter';
-
-/**
- * Same as [`NgbDateNativeAdapter`](#/components/datepicker/api#NgbDateNativeAdapter), but with UTC dates.
- *
- * @since 3.2.0
- */
-@Injectable()
-export class NgbDateNativeUTCAdapter extends NgbDateNativeAdapter {
- protected _fromNativeDate(date: Date): NgbDateStruct {
- return {year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate()};
- }
-
- protected _toNativeDate(date: NgbDateStruct): Date {
- const jsDate = new Date(Date.UTC(date.year, date.month - 1, date.day));
- // avoid 30 -> 1930 conversion
- jsDate.setUTCFullYear(date.year);
- return jsDate;
- }
-}
diff --git a/backup/src/datepicker/datepicker-config.spec.ts b/backup/src/datepicker/datepicker-config.spec.ts
deleted file mode 100644
index e14860d..0000000
--- a/backup/src/datepicker/datepicker-config.spec.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {NgbDatepickerConfig} from './datepicker-config';
-
-describe('ngb-datepicker-config', () => {
- it('should have sensible default values', () => {
- const config = new NgbDatepickerConfig();
-
- expect(config.dayTemplate).toBeUndefined();
- expect(config.displayMonths).toBe(1);
- expect(config.firstDayOfWeek).toBe(1);
- expect(config.markDisabled).toBeUndefined();
- expect(config.minDate).toBeUndefined();
- expect(config.maxDate).toBeUndefined();
- expect(config.navigation).toBe('select');
- expect(config.outsideDays).toBe('visible');
- expect(config.showWeekdays).toBe(true);
- expect(config.showWeekNumbers).toBe(false);
- expect(config.startDate).toBeUndefined();
- });
-});
diff --git a/backup/src/datepicker/datepicker-config.ts b/backup/src/datepicker/datepicker-config.ts
deleted file mode 100644
index fd23204..0000000
--- a/backup/src/datepicker/datepicker-config.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {Injectable, TemplateRef} from '@angular/core';
-import {DayTemplateContext} from './datepicker-day-template-context';
-import {NgbDateStruct} from './ngb-date-struct';
-
-/**
- * A configuration service for the [`NgbDatepicker`](#/components/datepicker/api#NgbDatepicker) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the datepickers used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class NgbDatepickerConfig {
- dayTemplate: TemplateRef;
- dayTemplateData: (date: NgbDateStruct, current: {year: number, month: number}) => any;
- footerTemplate: TemplateRef;
- displayMonths = 1;
- firstDayOfWeek = 1;
- markDisabled: (date: NgbDateStruct, current: {year: number, month: number}) => boolean;
- minDate: NgbDateStruct;
- maxDate: NgbDateStruct;
- navigation: 'select' | 'arrows' | 'none' = 'select';
- outsideDays: 'visible' | 'collapsed' | 'hidden' = 'visible';
- showWeekdays = true;
- showWeekNumbers = false;
- startDate: {year: number, month: number};
-}
diff --git a/backup/src/datepicker/datepicker-day-template-context.ts b/backup/src/datepicker/datepicker-day-template-context.ts
deleted file mode 100644
index 1172ac7..0000000
--- a/backup/src/datepicker/datepicker-day-template-context.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import {NgbDate} from './ngb-date';
-/**
- * The context for the datepicker 'day' template.
- *
- * You can override the way dates are displayed in the datepicker via the `[dayTemplate]` input.
- */
-export interface DayTemplateContext {
- /**
- * The date that corresponds to the template. Same as the `date` parameter.
- *
- * Can be used for convenience as a default template key, ex. `let-d`.
- *
- * @since 3.3.0
- */
- $implicit: NgbDate;
-
- /**
- * The month currently displayed by the datepicker.
- */
- currentMonth: number;
-
- /**
- * Any data you pass using the `[dayTemplateData]` input in the datepicker.
- *
- * @since 3.3.0
- */
- data?: any;
-
- /**
- * The date that corresponds to the template.
- */
- date: NgbDate;
-
- /**
- * `True` if the current date is disabled.
- */
- disabled: boolean;
-
- /**
- * `True` if the current date is focused.
- */
- focused: boolean;
-
- /**
- * `True` if the current date is selected.
- */
- selected: boolean;
-
- /**
- * `True` if the current date is today (equal to `NgbCalendar.getToday()`).
- *
- * @since 4.1.0
- */
- today: boolean;
-}
diff --git a/backup/src/datepicker/datepicker-day-view.scss b/backup/src/datepicker/datepicker-day-view.scss
deleted file mode 100644
index 2eba44a..0000000
--- a/backup/src/datepicker/datepicker-day-view.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-[ngbDatepickerDayView] {
- text-align: center;
- width: 2rem;
- height: 2rem;
- line-height: 2rem;
- border-radius: 0.25rem;
- background: transparent;
-
- &.outside {
- opacity: 0.5;
- }
-}
diff --git a/backup/src/datepicker/datepicker-day-view.spec.ts b/backup/src/datepicker/datepicker-day-view.spec.ts
deleted file mode 100644
index fb6274a..0000000
--- a/backup/src/datepicker/datepicker-day-view.spec.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import {TestBed} from '@angular/core/testing';
-
-import {Component} from '@angular/core';
-import {NgbDatepickerDayView} from './datepicker-day-view';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerI18n, NgbDatepickerI18nDefault} from './datepicker-i18n';
-
-function getElement(element: HTMLElement): HTMLElement {
- return element.querySelector('[ngbDatepickerDayView]');
-}
-
-describe('ngbDatepickerDayView', () => {
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [TestComponent, NgbDatepickerDayView],
- providers: [{provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nDefault}]
- });
- });
-
- it('should display date', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const el = getElement(fixture.nativeElement);
- expect(el.innerText).toBe('22');
-
- fixture.componentInstance.date = new NgbDate(2016, 7, 25);
- fixture.detectChanges();
- expect(el.innerText).toBe('25');
- });
-
- it('should apply text-muted style for disabled days', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const el = getElement(fixture.nativeElement);
- expect(el).not.toHaveCssClass('text-muted');
-
- fixture.componentInstance.disabled = true;
- fixture.detectChanges();
- expect(el).toHaveCssClass('text-muted');
- });
-
- it('should apply text-muted and outside classes for days of a different month', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const el = getElement(fixture.nativeElement);
- expect(el).not.toHaveCssClass('text-muted');
- expect(el).not.toHaveCssClass('outside');
-
- fixture.componentInstance.date = new NgbDate(2016, 8, 22);
- fixture.detectChanges();
- expect(el).toHaveCssClass('text-muted');
- expect(el).toHaveCssClass('outside');
- });
-
- it('should apply selected style', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const el = getElement(fixture.nativeElement);
- expect(el).not.toHaveCssClass('text-white');
- expect(el).not.toHaveCssClass('bg-primary');
-
- fixture.componentInstance.selected = true;
- fixture.detectChanges();
- expect(el).toHaveCssClass('text-white');
- expect(el).toHaveCssClass('bg-primary');
- });
-
- it('should not apply muted style if disabled but selected', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.componentInstance.disabled = true;
- fixture.componentInstance.selected = true;
- fixture.detectChanges();
-
- const el = getElement(fixture.nativeElement);
- expect(el).toHaveCssClass('bg-primary');
- expect(el).not.toHaveCssClass('text-muted');
- });
-});
-
-@Component({
- selector: 'test-cmp',
- template:
- '
'
-})
-class TestComponent {
- currentMonth = 7;
- date: NgbDate = new NgbDate(2016, 7, 22);
- disabled = false;
- selected = false;
-}
diff --git a/backup/src/datepicker/datepicker-day-view.ts b/backup/src/datepicker/datepicker-day-view.ts
deleted file mode 100644
index 39aa234..0000000
--- a/backup/src/datepicker/datepicker-day-view.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@angular/core';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-
-@Component({
- selector: '[ngbDatepickerDayView]',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- styleUrls: ['./datepicker-day-view.scss'],
- host: {
- 'class': 'btn-light',
- '[class.bg-primary]': 'selected',
- '[class.text-white]': 'selected',
- '[class.text-muted]': 'isMuted()',
- '[class.outside]': 'isMuted()',
- '[class.active]': 'focused'
- },
- template: `{{ i18n.getDayNumerals(date) }}`
-})
-export class NgbDatepickerDayView {
- @Input() currentMonth: number;
- @Input() date: NgbDate;
- @Input() disabled: boolean;
- @Input() focused: boolean;
- @Input() selected: boolean;
-
- constructor(public i18n: NgbDatepickerI18n) {}
-
- isMuted() { return !this.selected && (this.date.month !== this.currentMonth || this.disabled); }
-}
diff --git a/backup/src/datepicker/datepicker-i18n.spec.ts b/backup/src/datepicker/datepicker-i18n.spec.ts
deleted file mode 100644
index ed44aaa..0000000
--- a/backup/src/datepicker/datepicker-i18n.spec.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import {NgbDatepickerI18nDefault} from './datepicker-i18n';
-import {TestBed} from '@angular/core/testing';
-import {NgbDate} from './ngb-date';
-
-describe('ngb-datepicker-i18n-default', () => {
-
- let i18n: NgbDatepickerI18nDefault;
-
- beforeEach(() => {
- TestBed.configureTestingModule({providers: [NgbDatepickerI18nDefault]});
- i18n = TestBed.get(NgbDatepickerI18nDefault);
- });
-
- it('should return abbreviated month name', () => {
- expect(i18n.getMonthShortName(0)).toBe(undefined);
- expect(i18n.getMonthShortName(1)).toBe('Jan');
- expect(i18n.getMonthShortName(12)).toBe('Dec');
- expect(i18n.getMonthShortName(13)).toBe(undefined);
- });
-
- it('should return wide month name', () => {
- expect(i18n.getMonthFullName(0)).toBe(undefined);
- expect(i18n.getMonthFullName(1)).toBe('January');
- expect(i18n.getMonthFullName(12)).toBe('December');
- expect(i18n.getMonthFullName(13)).toBe(undefined);
- });
-
- it('should return weekday name', () => {
- expect(i18n.getWeekdayShortName(0)).toBe(undefined);
- expect(i18n.getWeekdayShortName(1)).toBe('Mo');
- expect(i18n.getWeekdayShortName(7)).toBe('Su');
- expect(i18n.getWeekdayShortName(8)).toBe(undefined);
- });
-
- it('should generate aria label for a date',
- () => { expect(i18n.getDayAriaLabel(new NgbDate(2010, 10, 8))).toBe('Friday, October 8, 2010'); });
-
- it('should generate week number numerals', () => {
- expect(i18n.getWeekNumerals(1)).toBe('1');
- expect(i18n.getWeekNumerals(55)).toBe('55');
- });
-
- it('should generate day numerals', () => {
- expect(i18n.getDayNumerals(new NgbDate(2010, 10, 1))).toBe('1');
- expect(i18n.getDayNumerals(new NgbDate(2010, 10, 31))).toBe('31');
- });
-
- it('should generate year numerals', () => {
- expect(i18n.getYearNumerals(0)).toBe('0');
- expect(i18n.getYearNumerals(2000)).toBe('2000');
- });
-});
diff --git a/backup/src/datepicker/datepicker-i18n.ts b/backup/src/datepicker/datepicker-i18n.ts
deleted file mode 100644
index d6315e0..0000000
--- a/backup/src/datepicker/datepicker-i18n.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import {Inject, Injectable, LOCALE_ID} from '@angular/core';
-import {FormStyle, getLocaleDayNames, getLocaleMonthNames, TranslationWidth, formatDate} from '@angular/common';
-import {NgbDateStruct} from './ngb-date-struct';
-
-export function NGB_DATEPICKER_18N_FACTORY(locale) {
- return new NgbDatepickerI18nDefault(locale);
-}
-
-/**
- * A service supplying i18n data to the datepicker component.
- *
- * The default implementation of this service uses the Angular locale and registered locale data for
- * weekdays and month names (as explained in the Angular i18n guide).
- *
- * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year
- * numerals. For other static labels the datepicker uses the default Angular i18n.
- *
- * See the [i18n demo](#/components/datepicker/examples#i18n) and
- * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define
- * a custom provider for i18n.
- */
-@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_18N_FACTORY, deps: [LOCALE_ID]})
-export abstract class NgbDatepickerI18n {
- /**
- * Returns the short weekday name to display in the heading of the month view.
- *
- * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.
- */
- abstract getWeekdayShortName(weekday: number): string;
-
- /**
- * Returns the short month name to display in the date picker navigation.
- *
- * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- */
- abstract getMonthShortName(month: number, year?: number): string;
-
- /**
- * Returns the full month name to display in the date picker navigation.
- *
- * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- */
- abstract getMonthFullName(month: number, year?: number): string;
-
- /**
- * Returns the value of the `aria-label` attribute for a specific date.
- *
- * @since 2.0.0
- */
- abstract getDayAriaLabel(date: NgbDateStruct): string;
-
- /**
- * Returns the textual representation of a day that is rendered in a day cell.
- *
- * @since 3.0.0
- */
- getDayNumerals(date: NgbDateStruct): string { return `${date.day}`; }
-
- /**
- * Returns the textual representation of a week number rendered by datepicker.
- *
- * @since 3.0.0
- */
- getWeekNumerals(weekNumber: number): string { return `${weekNumber}`; }
-
- /**
- * Returns the textual representation of a year that is rendered in the datepicker year select box.
- *
- * @since 3.0.0
- */
- getYearNumerals(year: number): string { return `${year}`; }
-}
-
-@Injectable()
-export class NgbDatepickerI18nDefault extends NgbDatepickerI18n {
- private _weekdaysShort: Array;
- private _monthsShort: Array;
- private _monthsFull: Array;
-
- constructor(@Inject(LOCALE_ID) private _locale: string) {
- super();
-
- const weekdaysStartingOnSunday = getLocaleDayNames(_locale, FormStyle.Standalone, TranslationWidth.Short);
- this._weekdaysShort = weekdaysStartingOnSunday.map((day, index) => weekdaysStartingOnSunday[(index + 1) % 7]);
-
- this._monthsShort = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Abbreviated);
- this._monthsFull = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Wide);
- }
-
- getWeekdayShortName(weekday: number): string { return this._weekdaysShort[weekday - 1]; }
-
- getMonthShortName(month: number): string { return this._monthsShort[month - 1]; }
-
- getMonthFullName(month: number): string { return this._monthsFull[month - 1]; }
-
- getDayAriaLabel(date: NgbDateStruct): string {
- const jsDate = new Date(date.year, date.month - 1, date.day);
- return formatDate(jsDate, 'fullDate', this._locale);
- }
-}
diff --git a/backup/src/datepicker/datepicker-input.spec.ts b/backup/src/datepicker/datepicker-input.spec.ts
deleted file mode 100644
index 910bd1d..0000000
--- a/backup/src/datepicker/datepicker-input.spec.ts
+++ /dev/null
@@ -1,931 +0,0 @@
-import {TestBed, ComponentFixture, fakeAsync, tick} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component, Injectable} from '@angular/core';
-import {FormsModule, NgForm} from '@angular/forms';
-
-import {NgbDateAdapter, NgbDatepickerModule} from './datepicker.module';
-import {NgbInputDatepicker} from './datepicker-input';
-import {NgbDatepicker} from './datepicker';
-import {NgbDateStruct} from './ngb-date-struct';
-import {NgbDate} from './ngb-date';
-import * as positioning from 'src/util/positioning';
-
-const createTestCmpt = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-const createTestNativeCmpt = (html: string) =>
- createGenericTestComponent(html, TestNativeComponent) as ComponentFixture;
-
-describe('NgbInputDatepicker', () => {
-
- beforeEach(() => {
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDatepickerModule, FormsModule]});
- });
-
- describe('open, close and toggle', () => {
-
- it('should allow controlling datepicker popup from outside', () => {
- const fixture = createTestCmpt(`
-
- Open
- Close
- Toggle `);
-
- const buttons = fixture.nativeElement.querySelectorAll('button');
-
- buttons[0].click(); // open
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
-
- buttons[1].click(); // close
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).toBeNull();
-
- buttons[2].click(); // toggle
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
-
- buttons[2].click(); // toggle
- fixture.detectChanges();
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).toBeNull();
- });
-
- it('should support the "position" option',
- () => { createTestCmpt(` `); });
- });
-
- describe('ngModel interactions', () => {
- it('should not change again the value in the model on a change coming from the model (popup closed)',
- fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- fixture.detectChanges();
-
- const input = fixture.nativeElement.querySelector('input');
-
- const value = new NgbDate(2018, 8, 29);
- fixture.componentInstance.date = value;
-
- fixture.detectChanges();
- tick();
- expect(fixture.componentInstance.date).toBe(value);
- expect(input.value).toBe('2018-08-29');
- }));
-
- it('should not change again the value in the model on a change coming from the model (popup opened)',
- fakeAsync(() => {
- const fixture = createTestCmpt(`
- Open `);
- fixture.detectChanges();
-
- const button = fixture.nativeElement.querySelector('button');
- const input = fixture.nativeElement.querySelector('input');
-
- button.click(); // open
- tick();
- fixture.detectChanges();
-
- const value = new NgbDate(2018, 8, 29);
- fixture.componentInstance.date = value;
- fixture.detectChanges();
- tick();
- expect(fixture.componentInstance.date).toBe(value);
- expect(input.value).toBe('2018-08-29');
- }));
-
-
- it('should format bound date as ISO (by default) in the input field', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const input = fixture.nativeElement.querySelector('input');
-
- fixture.componentInstance.date = {year: 2016, month: 10, day: 10};
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('2016-10-10');
-
- fixture.componentInstance.date = {year: 2016, month: 10, day: 15};
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('2016-10-15');
- }));
-
- it('should parse user-entered date as ISO (by default)', () => {
- const fixture = createTestCmpt(` `);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- inputDebugEl.triggerEventHandler('input', {target: {value: '2016-09-10'}});
- expect(fixture.componentInstance.date).toEqual({year: 2016, month: 9, day: 10});
- });
-
- it('should not update the model twice with the same value on input and on change', fakeAsync(() => {
- const fixture =
- createTestCmpt(` `);
- const componentInstance = fixture.componentInstance;
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
- spyOn(componentInstance, 'onModelChange');
-
- tick();
- fixture.detectChanges();
-
- inputDebugEl.triggerEventHandler('input', {target: {value: '2018-08-29'}});
- tick();
- fixture.detectChanges();
-
- const value = componentInstance.date;
- expect(value).toEqual({year: 2018, month: 8, day: 29});
- expect(componentInstance.onModelChange).toHaveBeenCalledTimes(1);
- expect(componentInstance.onModelChange).toHaveBeenCalledWith(value);
-
- inputDebugEl.triggerEventHandler('change', {target: {value: '2018-08-29'}});
-
- tick();
- fixture.detectChanges();
-
- expect(fixture.componentInstance.date).toBe(value);
-
- // the value is still the same, there should not be new calls of onModelChange:
- expect(componentInstance.onModelChange).toHaveBeenCalledTimes(1);
- }));
-
- it('should set only valid dates', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const input = fixture.nativeElement.querySelector('input');
-
- fixture.componentInstance.date = {};
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = null;
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new Date();
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = undefined;
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new NgbDate(300000, 1, 1);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new NgbDate(2017, 2, null);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new NgbDate(2017, null, 5);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new NgbDate(null, 2, 5);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
-
- fixture.componentInstance.date = new NgbDate('2017', '03', '10');
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('');
- }));
-
- it('should propagate disabled state', fakeAsync(() => {
- const fixture = createTestCmpt(`
-
- Open `);
- fixture.componentInstance.isDisabled = true;
- fixture.detectChanges();
-
- const button = fixture.nativeElement.querySelector('button');
- const input = fixture.nativeElement.querySelector('input');
-
- button.click(); // open
- tick();
- fixture.detectChanges();
- const buttonInDatePicker = fixture.nativeElement.querySelector('ngb-datepicker button');
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
- expect(input.disabled).toBeTruthy();
- expect(buttonInDatePicker.disabled).toBeTruthy();
-
- const dayElements = fixture.nativeElement.querySelectorAll('ngb-datepicker-month-view .ngb-dp-day');
- expect(dayElements[1]).toHaveCssClass('disabled');
- expect(dayElements[11]).toHaveCssClass('disabled');
- expect(dayElements[21]).toHaveCssClass('disabled');
-
- fixture.componentInstance.isDisabled = false;
- fixture.detectChanges();
- tick();
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
- expect(input.disabled).toBeFalsy();
- expect(buttonInDatePicker.disabled).toBeFalsy();
-
- const dayElements2 = fixture.nativeElement.querySelectorAll('ngb-datepicker-month-view .ngb-dp-day');
- expect(dayElements2[1]).not.toHaveCssClass('disabled');
- expect(dayElements2[11]).not.toHaveCssClass('disabled');
- expect(dayElements2[21]).not.toHaveCssClass('disabled');
- }));
-
- it('should propagate disabled state without form control', () => {
- const fixture = createTestCmpt(`
-
- Open `);
- fixture.componentInstance.isDisabled = true;
- fixture.detectChanges();
-
- const button = fixture.nativeElement.querySelector('button');
- const input = fixture.nativeElement.querySelector('input');
-
- expect(input.disabled).toBeTruthy();
-
- button.click(); // open
- fixture.detectChanges();
- const buttonInDatePicker = fixture.nativeElement.querySelector('ngb-datepicker button');
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
- expect(input.disabled).toBeTruthy();
- expect(buttonInDatePicker.disabled).toBeTruthy();
-
- const dayElements = fixture.nativeElement.querySelectorAll('ngb-datepicker-month-view .ngb-dp-day');
- expect(dayElements[1]).toHaveCssClass('disabled');
- expect(dayElements[11]).toHaveCssClass('disabled');
- expect(dayElements[21]).toHaveCssClass('disabled');
-
- fixture.componentInstance.isDisabled = false;
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).not.toBeNull();
- expect(input.disabled).toBeFalsy();
- expect(buttonInDatePicker.disabled).toBeFalsy();
-
- const dayElements2 = fixture.nativeElement.querySelectorAll('ngb-datepicker-month-view .ngb-dp-day');
- expect(dayElements2[1]).not.toHaveCssClass('disabled');
- expect(dayElements2[11]).not.toHaveCssClass('disabled');
- expect(dayElements2[21]).not.toHaveCssClass('disabled');
- });
-
- it('should propagate touched state on (blur)', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- expect(inputDebugEl.classes['ng-touched']).toBeFalsy();
-
- inputDebugEl.triggerEventHandler('blur', {});
- tick();
- fixture.detectChanges();
-
- expect(inputDebugEl.classes['ng-touched']).toBeTruthy();
- }));
-
- it('should propagate touched state when setting a date', fakeAsync(() => {
- const fixture = createTestCmpt(`
-
- Open `);
-
- const buttonDebugEl = fixture.debugElement.query(By.css('button'));
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- expect(inputDebugEl.classes['ng-touched']).toBeFalsy();
-
- buttonDebugEl.triggerEventHandler('click', {}); // open
- inputDebugEl.triggerEventHandler('change', {target: {value: '2016-09-10'}});
- tick();
- fixture.detectChanges();
-
- expect(inputDebugEl.classes['ng-touched']).toBeTruthy();
- }));
-
- it('should update model with updateOnBlur when selecting a date', fakeAsync(() => {
- const fixture = createTestCmpt(`
- `);
-
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- // open
- dpInput.open();
- fixture.detectChanges();
- expect(inputDebugEl.classes['ng-touched']).toBeFalsy();
- expect(fixture.componentInstance.date).toBeUndefined();
-
- // select date
- fixture.nativeElement.querySelectorAll('.ngb-dp-day')[3].click(); // 1 MAR 2018
- fixture.detectChanges();
- expect(fixture.componentInstance.date).toEqual({year: 2018, month: 3, day: 1});
- expect(inputDebugEl.nativeElement.value).toBe('2018-03-01');
- expect(inputDebugEl.classes['ng-touched']).toBeTruthy();
- }));
- });
-
- describe('manual data entry', () => {
-
- it('should reformat value entered by a user when it is valid', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- inputDebugEl.triggerEventHandler('change', {target: {value: '2016-9-1'}});
- tick();
- fixture.detectChanges();
-
- expect(inputDebugEl.nativeElement.value).toBe('2016-09-01');
- }));
-
- it('should retain value entered by a user if it is not valid', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- inputDebugEl.nativeElement.value = '2016-09-aa';
- inputDebugEl.triggerEventHandler('change', {target: {value: inputDebugEl.nativeElement.value}});
- tick();
- fixture.detectChanges();
-
- expect(inputDebugEl.nativeElement.value).toBe('2016-09-aa');
- }));
-
- });
-
- describe('validation', () => {
-
- describe('values set from model', () => {
-
- it('should not return errors for valid model', fakeAsync(() => {
- const fixture = createTestCmpt(
- ``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
- expect(form.control.hasError('ngbDate', ['dp'])).toBeFalsy();
- }));
-
- it('should not return errors for empty model', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
- }));
-
- it('should return "invalid" errors for invalid model', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- expect(form.control.getError('ngbDate', ['dp']).invalid).toBe(5);
- }));
-
- it('should return "requiredBefore" errors for dates before minimal date', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- expect(form.control.getError('ngbDate', ['dp']).requiredBefore).toEqual({year: 2017, month: 6, day: 4});
- }));
-
- it('should return "requiredAfter" errors for dates after maximal date', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- expect(form.control.getError('ngbDate', ['dp']).requiredAfter).toEqual({year: 2017, month: 2, day: 4});
- }));
-
- it('should update validity status when model changes', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.componentRef.instance.date = 'invalid';
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
-
- fixture.componentRef.instance.date = {year: 2015, month: 7, day: 3};
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
- }));
-
- it('should update validity status when minDate changes', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
-
- fixture.componentRef.instance.date = {year: 2018, month: 7, day: 3};
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- }));
-
- it('should update validity status when maxDate changes', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
-
- fixture.componentRef.instance.date = {year: 2015, month: 7, day: 3};
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- }));
-
- it('should update validity for manually entered dates', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- inputDebugEl.triggerEventHandler('input', {target: {value: '2016-09-10'}});
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
-
- inputDebugEl.triggerEventHandler('input', {target: {value: 'invalid'}});
- fixture.detectChanges();
- tick();
- expect(form.control.invalid).toBeTruthy();
- }));
-
- it('should consider empty strings as valid', fakeAsync(() => {
- const fixture = createTestCmpt(``);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
- const form = fixture.debugElement.query(By.directive(NgForm)).injector.get(NgForm);
-
- inputDebugEl.triggerEventHandler('change', {target: {value: '2016-09-10'}});
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
-
- inputDebugEl.triggerEventHandler('change', {target: {value: ''}});
- fixture.detectChanges();
- tick();
- expect(form.control.valid).toBeTruthy();
- }));
- });
-
- });
-
- describe('options', () => {
-
- it('should propagate the "dayTemplate" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.dayTemplate).toBeDefined();
- });
-
- it('should propagate the "dayTemplateData" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.dayTemplateData).toBeDefined();
- });
-
- it('should propagate the "displayMonths" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.displayMonths).toBe(3);
- });
-
- it('should propagate the "firstDayOfWeek" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.firstDayOfWeek).toBe(5);
- });
-
- it('should propagate the "footerTemplate" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.footerTemplate).toBeDefined();
- });
-
- it('should propagate the "markDisabled" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.markDisabled).toBeDefined();
- });
-
- it('should propagate the "minDate" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.minDate).toEqual({year: 2016, month: 9, day: 13});
- });
-
- it('should propagate the "maxDate" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.maxDate).toEqual({year: 2016, month: 9, day: 13});
- });
-
- it('should propagate the "outsideDays" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.outsideDays).toEqual('collapsed');
- });
-
- it('should propagate the "navigation" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.navigation).toBe('none');
- });
-
- it('should propagate the "showWeekdays" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.showWeekdays).toBeTruthy();
- });
-
- it('should propagate the "showWeekNumbers" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.showWeekNumbers).toBeTruthy();
- });
-
- it('should propagate the "startDate" option', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.startDate).toEqual({year: 2016, month: 9});
- });
-
- it('should propagate model as "startDate" option when "startDate" not provided', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- tick();
- fixture.detectChanges();
- dpInput.open();
- fixture.detectChanges();
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- expect(dp.startDate).toEqual(new NgbDate(2016, 9, 13));
- }));
-
- it('should relay the "navigate" event', () => {
- const fixture =
- createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- spyOn(fixture.componentInstance, 'onNavigate');
-
- dpInput.open();
- fixture.detectChanges();
- expect(fixture.componentInstance.onNavigate)
- .toHaveBeenCalledWith({current: null, next: {year: 2016, month: 9}, preventDefault: jasmine.any(Function)});
-
- const dp = fixture.debugElement.query(By.css('ngb-datepicker')).injector.get(NgbDatepicker);
- dp.navigateTo({year: 2018, month: 4});
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith({
- current: {year: 2016, month: 9},
- next: {year: 2018, month: 4},
- preventDefault: jasmine.any(Function)
- });
- });
-
- it('should relay the "closed" event', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- spyOn(fixture.componentInstance, 'onClose');
-
- // open
- dpInput.open();
- fixture.detectChanges();
-
- // close
- dpInput.close();
- expect(fixture.componentInstance.onClose).toHaveBeenCalledTimes(1);
- });
-
- it('should emit both "dateSelect" and "onModelChange" events', () => {
- const fixture = createTestCmpt(`
- `);
-
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
- spyOn(fixture.componentInstance, 'onDateSelect');
- spyOn(fixture.componentInstance, 'onModelChange');
-
- // open
- dpInput.open();
- fixture.detectChanges();
-
- // click on a date
- fixture.nativeElement.querySelectorAll('.ngb-dp-day')[3].click(); // 1 MAR 2018
- fixture.detectChanges();
- expect(fixture.componentInstance.onDateSelect).toHaveBeenCalledTimes(1);
- expect(fixture.componentInstance.onModelChange).toHaveBeenCalledTimes(1);
-
- // open again
- dpInput.open();
- fixture.detectChanges();
-
- // click the same date
- fixture.nativeElement.querySelectorAll('.ngb-dp-day')[3].click(); // 1 MAR 2018
- fixture.detectChanges();
- expect(fixture.componentInstance.onDateSelect).toHaveBeenCalledTimes(2);
- expect(fixture.componentInstance.onModelChange).toHaveBeenCalledTimes(1);
-
- expect(fixture.componentInstance.onDateSelect).toHaveBeenCalledWith(new NgbDate(2018, 3, 1));
- expect(fixture.componentInstance.onModelChange).toHaveBeenCalledWith({year: 2018, month: 3, day: 1});
- });
- });
-
- describe('container', () => {
-
- it('should be appended to the element matching the selector passed to "container"', () => {
- const selector = 'body';
- const fixture = createTestCmpt(`
-
- Open
- `);
-
- // open date-picker
- const button = fixture.nativeElement.querySelector('button');
- button.click();
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).toBeNull();
- expect(document.querySelector(selector).querySelector('ngb-datepicker')).not.toBeNull();
- });
-
- it('should properly destroy datepicker window when the "container" option is used', () => {
- const selector = 'body';
- const fixture = createTestCmpt(`
-
- Open
- Close
- `);
-
- // open date-picker
- const buttons = fixture.nativeElement.querySelectorAll('button');
- buttons[0].click(); // open button
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).toBeNull();
- expect(document.querySelector(selector).querySelector('ngb-datepicker')).not.toBeNull();
-
- // close date-picker
- buttons[1].click(); // close button
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('ngb-datepicker')).toBeNull();
- expect(document.querySelector(selector).querySelector('ngb-datepicker')).toBeNull();
- });
-
- it('should add .ngb-dp-body class when attached to body', () => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- // No container specified
- dpInput.open();
-
- let element = document.querySelector('ngb-datepicker') as HTMLElement;
- expect(element).not.toBeNull();
- expect(element).not.toHaveCssClass('ngb-dp-body');
-
- // Body
- dpInput.close();
- fixture.componentInstance.container = 'body';
- fixture.detectChanges();
- dpInput.open();
-
- element = document.querySelector('ngb-datepicker') as HTMLElement;
- expect(element).not.toBeNull();
- expect(element).toHaveCssClass('ngb-dp-body');
- });
- });
-
- describe('positionTarget', () => {
-
- let positionElementsSpy: jasmine.Spy;
-
- beforeEach(() => {
- positionElementsSpy = jasmine.createSpy('positionElementsSpy');
- spyOnProperty(positioning, 'positionElements').and.returnValue(positionElementsSpy);
- });
-
- it('should position popup by input if no target provided (default)', () => {
- const fixture = createTestCmpt(`
-
- Open
- `);
- const input = fixture.nativeElement.querySelector('input');
-
- // open date-picker
- const button = fixture.nativeElement.querySelector('button');
- button.click();
- fixture.detectChanges();
-
- expect(positionElementsSpy).toHaveBeenCalled();
- expect(positionElementsSpy.calls.argsFor(0)[0]).toBe(input);
- });
-
- it('should position popup by html element', () => {
- const fixture = createTestCmpt(`
-
- Open
- `);
-
- // open date-picker
- const button = fixture.nativeElement.querySelector('button');
- button.click();
- fixture.detectChanges();
-
- expect(positionElementsSpy).toHaveBeenCalled();
- expect(positionElementsSpy.calls.argsFor(0)[0]).toBe(button);
- });
-
- it('should position popup by css selector', () => {
- const selector = '#myButton';
- const fixture = createTestCmpt(`
-
- Open
- `);
-
- // open date-picker
- const button = fixture.nativeElement.querySelector(selector);
- button.click();
- fixture.detectChanges();
-
- expect(positionElementsSpy).toHaveBeenCalled();
- expect(positionElementsSpy.calls.argsFor(0)[0]).toBe(button);
- });
-
- it('should throw error if target element does not exists', fakeAsync(() => {
- const fixture = createTestCmpt(` `);
- const dpInput = fixture.debugElement.query(By.directive(NgbInputDatepicker)).injector.get(NgbInputDatepicker);
-
- dpInput.open();
- fixture.detectChanges();
-
- expect(() => tick())
- .toThrowError('ngbDatepicker could not find element declared in [positionTarget] to position against.');
- }));
- });
-
- describe('Native adapter', () => {
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- declarations: [TestNativeComponent],
- imports: [NgbDatepickerModule, FormsModule],
- providers: [{provide: NgbDateAdapter, useClass: NgbDateNativeAdapter}]
- });
- });
-
- it('should format bound date as ISO (by default) in the input field', fakeAsync(() => {
- const fixture = createTestNativeCmpt(` `);
- const input = fixture.nativeElement.querySelector('input');
-
- fixture.componentInstance.date = new Date(2018, 0, 3);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('2018-01-03');
-
- fixture.componentInstance.date = new Date(2018, 10, 13);
- fixture.detectChanges();
- tick();
- expect(input.value).toBe('2018-11-13');
- }));
-
- it('should parse user-entered date as ISO (by default)', () => {
- const fixture = createTestNativeCmpt(` `);
- const inputDebugEl = fixture.debugElement.query(By.css('input'));
-
- inputDebugEl.triggerEventHandler('input', {target: {value: '2018-01-03'}});
- expect(fixture.componentInstance.date).toEqual(new Date(2018, 0, 3));
- });
- });
-});
-
-@Injectable()
-class NgbDateNativeAdapter extends NgbDateAdapter {
- fromModel(date: Date): NgbDateStruct {
- return (date && date.getFullYear) ? {year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate()} :
- null;
- }
-
- toModel(date: NgbDateStruct): Date { return date ? new Date(date.year, date.month - 1, date.day) : null; }
-}
-
-@Component({selector: 'test-native-cmp', template: ''})
-class TestNativeComponent {
- date: Date;
-}
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- container;
- date: NgbDateStruct;
- isDisabled;
-
- onNavigate() {}
-
- onDateSelect() {}
-
- onModelChange() {}
-
- onClose() {}
-
- open(d: NgbInputDatepicker) { d.open(); }
-
- close(d: NgbInputDatepicker) { d.close(); }
-
- toggle(d: NgbInputDatepicker) { d.toggle(); }
-
- noop() {}
-}
diff --git a/backup/src/datepicker/datepicker-input.ts b/backup/src/datepicker/datepicker-input.ts
deleted file mode 100644
index c7c2561..0000000
--- a/backup/src/datepicker/datepicker-input.ts
+++ /dev/null
@@ -1,472 +0,0 @@
-import {
- ChangeDetectorRef,
- ComponentFactoryResolver,
- ComponentRef,
- Directive,
- ElementRef,
- EventEmitter,
- forwardRef,
- Inject,
- Input,
- NgZone,
- OnChanges,
- OnDestroy,
- Output,
- Renderer2,
- SimpleChanges,
- TemplateRef,
- ViewContainerRef
-} from '@angular/core';
-import {DOCUMENT} from '@angular/common';
-import {AbstractControl, ControlValueAccessor, NG_VALIDATORS, NG_VALUE_ACCESSOR, Validator} from '@angular/forms';
-
-import {ngbAutoClose} from '../util/autoclose';
-import {ngbFocusTrap} from '../util/focus-trap';
-import {PlacementArray, positionElements} from '../util/positioning';
-
-import {NgbDateAdapter} from './adapters/ngb-date-adapter';
-import {NgbDatepicker, NgbDatepickerNavigateEvent} from './datepicker';
-import {DayTemplateContext} from './datepicker-day-template-context';
-import {NgbDatepickerService} from './datepicker-service';
-import {NgbCalendar} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-import {NgbDateParserFormatter} from './ngb-date-parser-formatter';
-import {NgbDateStruct} from './ngb-date-struct';
-
-const NGB_DATEPICKER_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgbInputDatepicker),
- multi: true
-};
-
-const NGB_DATEPICKER_VALIDATOR = {
- provide: NG_VALIDATORS,
- useExisting: forwardRef(() => NgbInputDatepicker),
- multi: true
-};
-
-/**
- * A directive that allows to stick a datepicker popup to an input field.
- *
- * Manages interaction with the input field itself, does value formatting and provides forms integration.
- */
-@Directive({
- selector: 'input[ngbDatepicker]',
- exportAs: 'ngbDatepicker',
- host: {
- '(input)': 'manualDateChange($event.target.value)',
- '(change)': 'manualDateChange($event.target.value, true)',
- '(blur)': 'onBlur()',
- '[disabled]': 'disabled'
- },
- providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NGB_DATEPICKER_VALIDATOR, NgbDatepickerService]
-})
-export class NgbInputDatepicker implements OnChanges,
- OnDestroy, ControlValueAccessor, Validator {
- private _cRef: ComponentRef = null;
- private _disabled = false;
- private _model: NgbDate;
- private _inputValue: string;
- private _zoneSubscription: any;
-
- /**
- * Indicates whether the datepicker popup should be closed automatically after date selection / outside click or not.
- *
- * * `true` - the popup will close on both date selection and outside click.
- * * `false` - the popup can only be closed manually via `close()` or `toggle()` methods.
- * * `"inside"` - the popup will close on date selection, but not outside clicks.
- * * `"outside"` - the popup will close only on the outside click and not on date selection/inside clicks.
- *
- * @since 3.0.0
- */
- @Input() autoClose: boolean | 'inside' | 'outside' = true;
-
- /**
- * The reference to a custom template for the day.
- *
- * Allows to completely override the way a day 'cell' in the calendar is displayed.
- *
- * See [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext) for the data you get inside.
- */
- @Input() dayTemplate: TemplateRef;
-
- /**
- * The callback to pass any arbitrary data to the template cell via the
- * [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext)'s `data` parameter.
- *
- * `current` is the month that is currently displayed by the datepicker.
- *
- * @since 3.3.0
- */
- @Input() dayTemplateData: (date: NgbDate, current: {year: number, month: number}) => any;
-
- /**
- * The number of months to display.
- */
- @Input() displayMonths: number;
-
- /**
- * The first day of the week.
- *
- * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.
- */
- @Input() firstDayOfWeek: number;
-
- /**
- * The reference to the custom template for the datepicker footer.
- *
- * @since 3.3.0
- */
- @Input() footerTemplate: TemplateRef;
-
- /**
- * The callback to mark some dates as disabled.
- *
- * It is called for each new date when navigating to a different month.
- *
- * `current` is the month that is currently displayed by the datepicker.
- */
- @Input() markDisabled: (date: NgbDate, current: {year: number, month: number}) => boolean;
-
- /**
- * The earliest date that can be displayed or selected. Also used for form validation.
- *
- * If not provided, 'year' select box will display 10 years before the current month.
- */
- @Input() minDate: NgbDateStruct;
-
- /**
- * The latest date that can be displayed or selected. Also used for form validation.
- *
- * If not provided, 'year' select box will display 10 years after the current month.
- */
- @Input() maxDate: NgbDateStruct;
-
- /**
- * Navigation type.
- *
- * * `"select"` - select boxes for month and navigation arrows
- * * `"arrows"` - only navigation arrows
- * * `"none"` - no navigation visible at all
- */
- @Input() navigation: 'select' | 'arrows' | 'none';
-
- /**
- * The way of displaying days that don't belong to the current month.
- *
- * * `"visible"` - days are visible
- * * `"hidden"` - days are hidden, white space preserved
- * * `"collapsed"` - days are collapsed, so the datepicker height might change between months
- *
- * For the 2+ months view, days in between months are never shown.
- */
- @Input() outsideDays: 'visible' | 'collapsed' | 'hidden';
-
- /**
- * The preferred placement of the datepicker popup.
- *
- * Possible values are `"top"`, `"top-left"`, `"top-right"`, `"bottom"`, `"bottom-left"`,
- * `"bottom-right"`, `"left"`, `"left-top"`, `"left-bottom"`, `"right"`, `"right-top"`,
- * `"right-bottom"`
- *
- * Accepts an array of strings or a string with space separated possible values.
- *
- * The default order of preference is `"bottom-left bottom-right top-left top-right"`
- *
- * Please see the [positioning overview](#/positioning) for more details.
- */
- @Input() placement: PlacementArray = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
-
- /**
- * If `true`, weekdays will be displayed.
- */
- @Input() showWeekdays: boolean;
-
- /**
- * If `true`, week numbers will be displayed.
- */
- @Input() showWeekNumbers: boolean;
-
- /**
- * The date to open calendar with.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date is provided, calendar will open with current month.
- *
- * You could use `navigateTo(date)` method as an alternative.
- */
- @Input() startDate: {year: number, month: number, day?: number};
-
- /**
- * A selector specifying the element the datepicker popup should be appended to.
- *
- * Currently only supports `"body"`.
- */
- @Input() container: string;
-
- /**
- * A css selector or html element specifying the element the datepicker popup should be positioned against.
- *
- * By default the input is used as a target.
- *
- * @since 4.2.0
- */
- @Input() positionTarget: string | HTMLElement;
-
- /**
- * An event emitted when user selects a date using keyboard or mouse.
- *
- * The payload of the event is currently selected `NgbDate`.
- *
- * @since 1.1.1
- */
- @Output() dateSelect = new EventEmitter();
-
- /**
- * Event emitted right after the navigation happens and displayed month changes.
- *
- * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
- */
- @Output() navigate = new EventEmitter();
-
- /**
- * An event fired after closing datepicker window.
- *
- * @since 4.2.0
- */
- @Output() closed = new EventEmitter();
-
- @Input()
- get disabled() {
- return this._disabled;
- }
- set disabled(value: any) {
- this._disabled = value === '' || (value && value !== 'false');
-
- if (this.isOpen()) {
- this._cRef.instance.setDisabledState(this._disabled);
- }
- }
-
- private _onChange = (_: any) => {};
- private _onTouched = () => {};
- private _validatorChange = () => {};
-
-
- constructor(
- private _parserFormatter: NgbDateParserFormatter, private _elRef: ElementRef,
- private _vcRef: ViewContainerRef, private _renderer: Renderer2, private _cfr: ComponentFactoryResolver,
- private _ngZone: NgZone, private _service: NgbDatepickerService, private _calendar: NgbCalendar,
- private _dateAdapter: NgbDateAdapter, @Inject(DOCUMENT) private _document: any,
- private _changeDetector: ChangeDetectorRef) {
- this._zoneSubscription = _ngZone.onStable.subscribe(() => this._updatePopupPosition());
- }
-
- registerOnChange(fn: (value: any) => any): void { this._onChange = fn; }
-
- registerOnTouched(fn: () => any): void { this._onTouched = fn; }
-
- registerOnValidatorChange(fn: () => void): void { this._validatorChange = fn; }
-
- setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
-
- validate(c: AbstractControl): {[key: string]: any} {
- const value = c.value;
-
- if (value === null || value === undefined) {
- return null;
- }
-
- const ngbDate = this._fromDateStruct(this._dateAdapter.fromModel(value));
-
- if (!this._calendar.isValid(ngbDate)) {
- return {'ngbDate': {invalid: c.value}};
- }
-
- if (this.minDate && ngbDate.before(NgbDate.from(this.minDate))) {
- return {'ngbDate': {requiredBefore: this.minDate}};
- }
-
- if (this.maxDate && ngbDate.after(NgbDate.from(this.maxDate))) {
- return {'ngbDate': {requiredAfter: this.maxDate}};
- }
- }
-
- writeValue(value) {
- this._model = this._fromDateStruct(this._dateAdapter.fromModel(value));
- this._writeModelValue(this._model);
- }
-
- manualDateChange(value: string, updateView = false) {
- const inputValueChanged = value !== this._inputValue;
- if (inputValueChanged) {
- this._inputValue = value;
- this._model = this._fromDateStruct(this._parserFormatter.parse(value));
- }
- if (inputValueChanged || !updateView) {
- this._onChange(this._model ? this._dateAdapter.toModel(this._model) : (value === '' ? null : value));
- }
- if (updateView && this._model) {
- this._writeModelValue(this._model);
- }
- }
-
- isOpen() { return !!this._cRef; }
-
- /**
- * Opens the datepicker popup.
- *
- * If the related form control contains a valid date, the corresponding month will be opened.
- */
- open() {
- if (!this.isOpen()) {
- const cf = this._cfr.resolveComponentFactory(NgbDatepicker);
- this._cRef = this._vcRef.createComponent(cf);
-
- this._applyPopupStyling(this._cRef.location.nativeElement);
- this._applyDatepickerInputs(this._cRef.instance);
- this._subscribeForDatepickerOutputs(this._cRef.instance);
- this._cRef.instance.ngOnInit();
- this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model));
-
- // date selection event handling
- this._cRef.instance.registerOnChange((selectedDate) => {
- this.writeValue(selectedDate);
- this._onChange(selectedDate);
- this._onTouched();
- });
-
- this._cRef.changeDetectorRef.detectChanges();
-
- this._cRef.instance.setDisabledState(this.disabled);
-
- if (this.container === 'body') {
- window.document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);
- }
-
- // focus handling
- ngbFocusTrap(this._cRef.location.nativeElement, this.closed, true);
- this._cRef.instance.focus();
-
- ngbAutoClose(
- this._ngZone, this._document, this.autoClose, () => this.close(), this.closed, [],
- [this._elRef.nativeElement, this._cRef.location.nativeElement]);
- }
- }
-
- /**
- * Closes the datepicker popup.
- */
- close() {
- if (this.isOpen()) {
- this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));
- this._cRef = null;
- this.closed.emit();
- this._changeDetector.markForCheck();
- }
- }
-
- /**
- * Toggles the datepicker popup.
- */
- toggle() {
- if (this.isOpen()) {
- this.close();
- } else {
- this.open();
- }
- }
-
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- */
- navigateTo(date?: {year: number, month: number, day?: number}) {
- if (this.isOpen()) {
- this._cRef.instance.navigateTo(date);
- }
- }
-
- onBlur() { this._onTouched(); }
-
- ngOnChanges(changes: SimpleChanges) {
- if (changes['minDate'] || changes['maxDate']) {
- this._validatorChange();
- }
- }
-
- ngOnDestroy() {
- this.close();
- this._zoneSubscription.unsubscribe();
- }
-
- private _applyDatepickerInputs(datepickerInstance: NgbDatepicker): void {
- ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
- 'maxDate', 'navigation', 'outsideDays', 'showNavigation', 'showWeekdays', 'showWeekNumbers']
- .forEach((optionName: string) => {
- if (this[optionName] !== undefined) {
- datepickerInstance[optionName] = this[optionName];
- }
- });
- datepickerInstance.startDate = this.startDate || this._model;
- }
-
- private _applyPopupStyling(nativeElement: any) {
- this._renderer.addClass(nativeElement, 'dropdown-menu');
- this._renderer.addClass(nativeElement, 'show');
-
- if (this.container === 'body') {
- this._renderer.addClass(nativeElement, 'ngb-dp-body');
- }
- }
-
- private _subscribeForDatepickerOutputs(datepickerInstance: NgbDatepicker) {
- datepickerInstance.navigate.subscribe(navigateEvent => this.navigate.emit(navigateEvent));
- datepickerInstance.select.subscribe(date => {
- this.dateSelect.emit(date);
- if (this.autoClose === true || this.autoClose === 'inside') {
- this.close();
- }
- });
- }
-
- private _writeModelValue(model: NgbDate) {
- const value = this._parserFormatter.format(model);
- this._inputValue = value;
- this._renderer.setProperty(this._elRef.nativeElement, 'value', value);
- if (this.isOpen()) {
- this._cRef.instance.writeValue(this._dateAdapter.toModel(model));
- this._onTouched();
- }
- }
-
- private _fromDateStruct(date: NgbDateStruct): NgbDate {
- const ngbDate = date ? new NgbDate(date.year, date.month, date.day) : null;
- return this._calendar.isValid(ngbDate) ? ngbDate : null;
- }
-
- private _updatePopupPosition() {
- if (!this._cRef) {
- return;
- }
-
- let hostElement: HTMLElement;
- if (typeof this.positionTarget === 'string') {
- hostElement = window.document.querySelector(this.positionTarget);
- } else if (this.positionTarget instanceof HTMLElement) {
- hostElement = this.positionTarget;
- } else {
- hostElement = this._elRef.nativeElement;
- }
-
- if (this.positionTarget && !hostElement) {
- throw new Error('ngbDatepicker could not find element declared in [positionTarget] to position against.');
- }
-
- positionElements(hostElement, this._cRef.location.nativeElement, this.placement, this.container === 'body');
- }
-}
diff --git a/backup/src/datepicker/datepicker-integration.spec.ts b/backup/src/datepicker/datepicker-integration.spec.ts
deleted file mode 100644
index 1773982..0000000
--- a/backup/src/datepicker/datepicker-integration.spec.ts
+++ /dev/null
@@ -1,113 +0,0 @@
-import {ComponentFixture, TestBed} from '@angular/core/testing';
-import {Component, Injectable} from '@angular/core';
-import {NgbDatepickerModule, NgbDateStruct} from './datepicker.module';
-import {NgbCalendar, NgbCalendarGregorian} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-import {getMonthSelect, getYearSelect} from '../test/datepicker/common';
-import {NgbDatepickerI18n, NgbDatepickerI18nDefault} from './datepicker-i18n';
-
-describe('ngb-datepicker integration', () => {
-
- beforeEach(
- () => { TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDatepickerModule]}); });
-
- it('should allow overriding datepicker calendar', () => {
-
- class FixedTodayCalendar extends NgbCalendarGregorian {
- getToday() { return new NgbDate(2000, 7, 1); }
- }
-
- TestBed.overrideComponent(TestComponent, {
- set: {
- template: ` `,
- providers: [{provide: NgbCalendar, useClass: FixedTodayCalendar}]
- }
- });
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('7');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2000');
- });
-
- describe('i18n', () => {
-
- const ALPHABET = 'ABCDEFGHIJKLMNOPRSTQUVWXYZ';
-
- @Injectable()
- class CustomI18n extends NgbDatepickerI18nDefault {
- // alphabetic months: Jan -> A, Feb -> B, etc
- getMonthShortName(month: number) { return ALPHABET[month - 1]; }
-
- // alphabetic months: Jan -> A, Feb -> B, etc
- getMonthFullName(month: number) { return ALPHABET[month - 1]; }
-
- // alphabetic days: 1 -> A, 2 -> B, etc
- getDayNumerals(date: NgbDateStruct) { return ALPHABET[date.day - 1]; }
-
- // alphabetic week numbers: 1 -> A, 2 -> B, etc
- getWeekNumerals(week: number) { return ALPHABET[week - 1]; }
-
- // reversed years: 1998 -> 9881
- getYearNumerals(year: number) { return `${year}`.split('').reverse().join(''); }
- }
-
- let fixture: ComponentFixture;
-
- beforeEach(() => {
- TestBed.overrideComponent(TestComponent, {
- set: {
- template: `
- `,
- providers: [{provide: NgbDatepickerI18n, useClass: CustomI18n}]
- }
- });
-
- fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
- });
-
- it('should allow overriding month names', () => {
- const monthOptions = getMonthSelect(fixture.nativeElement).querySelectorAll('option');
- const months = Array.from(monthOptions).map(o => o.innerHTML);
- expect(months.join('')).toEqual(ALPHABET.slice(0, 12));
- });
-
- it('should allow overriding week number numerals', () => {
- // month view that displays JAN 2018 starts directly with week 01
- const weekNumberElements = fixture.nativeElement.querySelectorAll('.ngb-dp-week-number');
- const weekNumbers = Array.from(weekNumberElements).map((o: HTMLElement) => o.innerHTML);
- expect(weekNumbers.slice(0, 6).join('')).toEqual(ALPHABET.slice(0, 6));
- });
-
- it('should allow overriding day numerals', () => {
- // month view that displays JAN 2018 starts directly with 01 JAN
- const daysElements = fixture.nativeElement.querySelectorAll('.ngb-dp-day > div');
- const days = Array.from(daysElements).map((o: HTMLElement) => o.innerHTML);
- expect(days.slice(0, 26).join('')).toEqual(ALPHABET);
- });
-
- it('should allow overriding year numerals', () => {
- // we have only 2017, 2018 and 2019 in the select box
- const yearOptions = getYearSelect(fixture.nativeElement).querySelectorAll('option');
- const years = Array.from(yearOptions).map(o => o.innerText);
- expect(years).toEqual(['7102', '8102', '9102']);
- });
-
- it('should allow overriding year and month numerals for multiple months', () => {
- // we have JAN 2018 and FEB 2018 -> A 8102 and B 8102
- const monthNameElements = fixture.nativeElement.querySelectorAll('.ngb-dp-month-name');
- const monthNames = Array.from(monthNameElements).map((o: HTMLElement) => o.innerText.trim());
- expect(monthNames).toEqual(['A 8102', 'B 8102']);
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
-}
diff --git a/backup/src/datepicker/datepicker-keymap-service.spec.ts b/backup/src/datepicker/datepicker-keymap-service.spec.ts
deleted file mode 100644
index a3269ae..0000000
--- a/backup/src/datepicker/datepicker-keymap-service.spec.ts
+++ /dev/null
@@ -1,133 +0,0 @@
-import {NgbDatepickerKeyMapService} from './datepicker-keymap-service';
-import {NgbCalendar, NgbCalendarGregorian} from './ngb-calendar';
-import {NgbDatepickerService} from './datepicker-service';
-import {TestBed} from '@angular/core/testing';
-import {Subject} from 'rxjs';
-import {NgbDate} from './ngb-date';
-import {Key} from '../util/key';
-import {Type} from '@angular/core';
-
-const event = (keyCode: number, shift = false) =>
- ({which: keyCode, shiftKey: shift, preventDefault: () => {}, stopPropagation: () => {}});
-
-describe('ngb-datepicker-keymap-service', () => {
-
- let service: NgbDatepickerKeyMapService;
- let calendar: NgbCalendar;
- let mock: {focus, focusMove, focusSelect, model$};
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [
- NgbDatepickerKeyMapService, {provide: NgbCalendar, useClass: NgbCalendarGregorian}, {
- provide: NgbDatepickerService,
- useValue: {focus: () => {}, focusMove: () => {}, focusSelect: () => {}, model$: new Subject()}
- }
- ]
- });
-
- calendar = TestBed.get(NgbCalendar as Type);
- service = TestBed.get(NgbDatepickerKeyMapService);
- mock = TestBed.get(NgbDatepickerService);
-
- spyOn(mock, 'focus');
- spyOn(mock, 'focusMove');
- spyOn(mock, 'focusSelect');
- });
-
- it('should be instantiated', () => { expect(service).toBeTruthy(); });
-
- it('should move focus by 1 day or 1 week with "Arrow" keys', () => {
- service.processKey(event(Key.ArrowUp));
- expect(mock.focusMove).toHaveBeenCalledWith('d', -7);
-
- service.processKey(event(Key.ArrowDown));
- expect(mock.focusMove).toHaveBeenCalledWith('d', 7);
-
- service.processKey(event(Key.ArrowLeft));
- expect(mock.focusMove).toHaveBeenCalledWith('d', -1);
-
- service.processKey(event(Key.ArrowRight));
- expect(mock.focusMove).toHaveBeenCalledWith('d', 1);
-
- expect(mock.focusMove).toHaveBeenCalledTimes(4);
- });
-
- it('should move focus by 1 month or year "PgUp" and "PageDown"', () => {
- service.processKey(event(Key.PageUp));
- expect(mock.focusMove).toHaveBeenCalledWith('m', -1);
-
- service.processKey(event(Key.PageDown));
- expect(mock.focusMove).toHaveBeenCalledWith('m', 1);
-
- service.processKey(event(Key.PageUp, true));
- expect(mock.focusMove).toHaveBeenCalledWith('y', -1);
-
- service.processKey(event(Key.PageDown, true));
- expect(mock.focusMove).toHaveBeenCalledWith('y', 1);
-
- expect(mock.focusMove).toHaveBeenCalledTimes(4);
- });
-
- it('should select focused date with "Space" and "Enter"', () => {
- service.processKey(event(Key.Enter));
- service.processKey(event(Key.Space));
- expect(mock.focusSelect).toHaveBeenCalledTimes(2);
- });
-
- it('should move focus to the first and last days in the view with "Home" and "End"', () => {
- service.processKey(event(Key.Home));
- expect(mock.focus).toHaveBeenCalledWith(undefined);
-
- service.processKey(event(Key.End));
- expect(mock.focus).toHaveBeenCalledWith(undefined);
-
- mock.model$.next({firstDate: new NgbDate(2017, 1, 1), lastDate: new NgbDate(2017, 12, 1)});
-
- service.processKey(event(Key.Home));
- expect(mock.focus).toHaveBeenCalledWith(new NgbDate(2017, 1, 1));
-
- service.processKey(event(Key.End));
- expect(mock.focus).toHaveBeenCalledWith(new NgbDate(2017, 12, 1));
-
- expect(mock.focus).toHaveBeenCalledTimes(4);
- });
-
- it('should move focus to the "min" and "max" dates with "Home" and "End"', () => {
- service.processKey(event(Key.Home, true));
- expect(mock.focus).toHaveBeenCalledWith(undefined);
-
- service.processKey(event(Key.End, true));
- expect(mock.focus).toHaveBeenCalledWith(undefined);
-
- mock.model$.next({minDate: new NgbDate(2017, 1, 1), maxDate: new NgbDate(2017, 12, 1), months: []});
-
- service.processKey(event(Key.Home, true));
- expect(mock.focus).toHaveBeenCalledWith(new NgbDate(2017, 1, 1));
-
- service.processKey(event(Key.End, true));
- expect(mock.focus).toHaveBeenCalledWith(new NgbDate(2017, 12, 1));
-
- expect(mock.focus).toHaveBeenCalledTimes(4);
- });
-
- it('should prevent default and stop propagation of the known key', () => {
- let e = event(Key.ArrowUp);
- spyOn(e, 'preventDefault');
- spyOn(e, 'stopPropagation');
-
- service.processKey(e);
- expect(e.preventDefault).toHaveBeenCalled();
- expect(e.stopPropagation).toHaveBeenCalled();
-
- // unknown key
- e = event(23);
- spyOn(e, 'preventDefault');
- spyOn(e, 'stopPropagation');
-
- service.processKey(e);
- expect(e.preventDefault).not.toHaveBeenCalled();
- expect(e.stopPropagation).not.toHaveBeenCalled();
- });
-
-});
diff --git a/backup/src/datepicker/datepicker-keymap-service.ts b/backup/src/datepicker/datepicker-keymap-service.ts
deleted file mode 100644
index 0bf6769..0000000
--- a/backup/src/datepicker/datepicker-keymap-service.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import {Injectable} from '@angular/core';
-import {NgbDatepickerService} from './datepicker-service';
-import {NgbCalendar} from './ngb-calendar';
-import {Key} from '../util/key';
-import {NgbDate} from './ngb-date';
-
-@Injectable()
-export class NgbDatepickerKeyMapService {
- private _minDate: NgbDate;
- private _maxDate: NgbDate;
- private _firstViewDate: NgbDate;
- private _lastViewDate: NgbDate;
-
- constructor(private _service: NgbDatepickerService, private _calendar: NgbCalendar) {
- _service.model$.subscribe(model => {
- this._minDate = model.minDate;
- this._maxDate = model.maxDate;
- this._firstViewDate = model.firstDate;
- this._lastViewDate = model.lastDate;
- });
- }
-
- processKey(event: KeyboardEvent) {
- // tslint:disable-next-line:deprecation
- switch (event.which) {
- case Key.PageUp:
- this._service.focusMove(event.shiftKey ? 'y' : 'm', -1);
- break;
- case Key.PageDown:
- this._service.focusMove(event.shiftKey ? 'y' : 'm', 1);
- break;
- case Key.End:
- this._service.focus(event.shiftKey ? this._maxDate : this._lastViewDate);
- break;
- case Key.Home:
- this._service.focus(event.shiftKey ? this._minDate : this._firstViewDate);
- break;
- case Key.ArrowLeft:
- this._service.focusMove('d', -1);
- break;
- case Key.ArrowUp:
- this._service.focusMove('d', -this._calendar.getDaysPerWeek());
- break;
- case Key.ArrowRight:
- this._service.focusMove('d', 1);
- break;
- case Key.ArrowDown:
- this._service.focusMove('d', this._calendar.getDaysPerWeek());
- break;
- case Key.Enter:
- case Key.Space:
- this._service.focusSelect();
- break;
- default:
- return;
- }
-
- // note 'return' in default case
- event.preventDefault();
- event.stopPropagation();
- }
-}
diff --git a/backup/src/datepicker/datepicker-month-view.scss b/backup/src/datepicker/datepicker-month-view.scss
deleted file mode 100644
index 62af26a..0000000
--- a/backup/src/datepicker/datepicker-month-view.scss
+++ /dev/null
@@ -1,38 +0,0 @@
-ngb-datepicker-month-view {
- display: block;
-}
-
-.ngb-dp {
- &-weekday,
- &-week-number {
- line-height: 2rem;
- text-align: center;
- font-style: italic;
- }
- &-weekday {
- color: #5bc0de;
- color: var(--info);
- }
- &-week {
- border-radius: 0.25rem;
- display: flex;
- }
- &-weekdays {
- border-bottom: 1px solid rgba(0, 0, 0, 0.125);
- border-radius: 0;
- }
- &-day,
- &-weekday,
- &-week-number {
- width: 2rem;
- height: 2rem;
- }
- &-day {
- cursor: pointer;
-
- &.disabled,
- &.hidden {
- cursor: default;
- }
- }
-}
\ No newline at end of file
diff --git a/backup/src/datepicker/datepicker-month-view.spec.ts b/backup/src/datepicker/datepicker-month-view.spec.ts
deleted file mode 100644
index 4a68969..0000000
--- a/backup/src/datepicker/datepicker-month-view.spec.ts
+++ /dev/null
@@ -1,338 +0,0 @@
-import {TestBed, ComponentFixture} from '@angular/core/testing';
-import {createGenericTestComponent, isBrowser} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {NgbDatepickerModule} from './datepicker.module';
-import {NgbDatepickerMonthView} from './datepicker-month-view';
-import {MonthViewModel} from './datepicker-view-model';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerDayView} from './datepicker-day-view';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getWeekdays(element: HTMLElement): HTMLElement[] {
- return Array.from(element.querySelectorAll('.ngb-dp-weekday'));
-}
-
-function getWeekNumbers(element: HTMLElement): HTMLElement[] {
- return Array.from(element.querySelectorAll('.ngb-dp-week-number'));
-}
-
-function getDates(element: HTMLElement): HTMLElement[] {
- return Array.from(element.querySelectorAll('.ngb-dp-day'));
-}
-
-function expectWeekdays(element: HTMLElement, weekdays: string[]) {
- const result = getWeekdays(element).map(td => td.innerText.trim());
- expect(result).toEqual(weekdays);
-}
-
-function expectWeekNumbers(element: HTMLElement, weeknumbers: string[]) {
- const result = getWeekNumbers(element).map(td => td.innerText.trim());
- expect(result).toEqual(weeknumbers);
-}
-
-function expectDates(element: HTMLElement, dates: string[]) {
- const result = getDates(element).map(td => td.innerText.trim());
- expect(result).toEqual(dates);
-}
-
-describe('ngb-datepicker-month-view', () => {
-
- beforeEach(() => {
- TestBed.overrideModule(NgbDatepickerModule, {set: {exports: [NgbDatepickerMonthView, NgbDatepickerDayView]}});
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDatepickerModule]});
- });
-
- it('should show/hide weekdays', () => {
- const fixture = createTestComponent(
- ' ');
-
- expectWeekdays(fixture.nativeElement, ['Mo', 'Tu']);
-
- fixture.componentInstance.showWeekdays = false;
- fixture.detectChanges();
- expectWeekdays(fixture.nativeElement, []);
- });
-
- it('should show/hide week numbers', () => {
- const fixture = createTestComponent(
- ' ');
-
- expectWeekNumbers(fixture.nativeElement, ['1', '2', '3']);
-
- fixture.componentInstance.showWeekNumbers = false;
- fixture.detectChanges();
- expectWeekNumbers(fixture.nativeElement, []);
- });
-
- it('should use custom template to display dates', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
- expectDates(fixture.nativeElement, ['', '1', '2', '3', '4', '']);
- });
-
- it('should use "date" as an implicit value for the template', () => {
- const fixture = createTestComponent(`
- {{ d.day }}
-
- `);
- expectDates(fixture.nativeElement, ['', '1', '2', '3', '4', '']);
- });
-
- it('should send date selection events', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
-
- spyOn(fixture.componentInstance, 'onClick');
-
- const dates = getDates(fixture.nativeElement);
- dates[1].click();
-
- expect(fixture.componentInstance.onClick).toHaveBeenCalledWith(new NgbDate(2016, 8, 1));
- });
-
- it('should not send date selection events for hidden and disabled dates', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
-
- spyOn(fixture.componentInstance, 'onClick');
-
- const dates = getDates(fixture.nativeElement);
- dates[0].click(); // hidden
- dates[2].click(); // disabled
-
- expect(fixture.componentInstance.onClick).not.toHaveBeenCalled();
- });
-
- it('should set cursor to pointer or default', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
-
- const dates = getDates(fixture.nativeElement);
- // hidden
- expect(window.getComputedStyle(dates[0]).getPropertyValue('cursor')).toBe('default');
- // normal
- expect(window.getComputedStyle(dates[1]).getPropertyValue('cursor')).toBe('pointer');
- // disabled
- expect(window.getComputedStyle(dates[2]).getPropertyValue('cursor')).toBe('default');
- });
-
- it('should apply correct CSS classes to days', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
-
- let dates = getDates(fixture.nativeElement);
- // hidden
- expect(dates[0]).toHaveCssClass('hidden');
- expect(dates[0]).not.toHaveCssClass('disabled');
- expect(dates[0]).not.toHaveCssClass('ngb-dp-today');
- // normal
- expect(dates[1]).not.toHaveCssClass('hidden');
- expect(dates[1]).not.toHaveCssClass('disabled');
- expect(dates[1]).not.toHaveCssClass('ngb-dp-today');
- // disabled
- expect(dates[2]).not.toHaveCssClass('hidden');
- expect(dates[2]).toHaveCssClass('disabled');
- expect(dates[2]).toHaveCssClass('ngb-dp-today');
- });
-
- it('should not display collapsed weeks', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
-
- `);
-
- expectDates(fixture.nativeElement, ['', '1', '2', '3', '4', '']);
- });
-
- it('should add correct aria-label attribute', () => {
- const fixture = createTestComponent(`
- {{ date.day }}
-
- `);
-
- let dates = getDates(fixture.nativeElement);
- expect(dates[0].getAttribute('aria-label')).toBe('Monday');
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- month: MonthViewModel = {
- firstDate: new NgbDate(2016, 8, 1),
- lastDate: new NgbDate(2016, 8, 31),
- year: 2016,
- number: 8,
- weekdays: [1, 2],
- weeks: [
- // month: 7, 8
- {
- number: 1,
- days: [
- {
- date: new NgbDate(2016, 7, 4),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 7, 4),
- date: new NgbDate(2016, 7, 4),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Monday',
- hidden: true
- },
- {
- date: new NgbDate(2016, 8, 1),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 8, 1),
- date: new NgbDate(2016, 8, 1),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Monday',
- hidden: false
- }
- ],
- collapsed: false
- },
- // month: 8, 8
- {
- number: 2,
- days: [
- {
- date: new NgbDate(2016, 8, 2),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 8, 2),
- date: new NgbDate(2016, 8, 2),
- disabled: true,
- focused: false,
- selected: false,
- today: true
- },
- tabindex: -1,
- ariaLabel: 'Friday',
- hidden: false
- },
- {
- date: new NgbDate(2016, 8, 3),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 8, 3),
- date: new NgbDate(2016, 8, 3),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Saturday',
- hidden: false
- }
- ],
- collapsed: false
- },
- // month: 8, 9
- {
- number: 3,
- days: [
- {
- date: new NgbDate(2016, 8, 4),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 8, 4),
- date: new NgbDate(2016, 8, 4),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Sunday',
- hidden: false
- },
- {
- date: new NgbDate(2016, 9, 1),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 9, 1),
- date: new NgbDate(2016, 9, 1),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Saturday',
- hidden: true
- }
- ],
- collapsed: false
- },
- // month: 9, 9 -> to collapse
- {
- number: 4,
- days: [
- {
- date: new NgbDate(2016, 9, 2),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 9, 2),
- date: new NgbDate(2016, 9, 2),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Sunday',
- hidden: true
- },
- {
- date: new NgbDate(2016, 9, 3),
- context: {
- currentMonth: 8,
- $implicit: new NgbDate(2016, 9, 3),
- date: new NgbDate(2016, 9, 3),
- disabled: false,
- focused: false,
- selected: false,
- today: false
- },
- tabindex: -1,
- ariaLabel: 'Monday',
- hidden: true
- }
- ],
- collapsed: true
- }
- ]
- };
-
- showWeekdays = true;
- showWeekNumbers = true;
- outsideDays = 'visible';
-
- onClick = () => {};
-}
diff --git a/backup/src/datepicker/datepicker-month-view.ts b/backup/src/datepicker/datepicker-month-view.ts
deleted file mode 100644
index d2411e8..0000000
--- a/backup/src/datepicker/datepicker-month-view.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import {Component, Input, TemplateRef, Output, EventEmitter, ViewEncapsulation} from '@angular/core';
-import {MonthViewModel, DayViewModel} from './datepicker-view-model';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-import {DayTemplateContext} from './datepicker-day-template-context';
-
-@Component({
- selector: 'ngb-datepicker-month-view',
- host: {'role': 'grid'},
- encapsulation: ViewEncapsulation.None,
- styleUrls: ['./datepicker-month-view.scss'],
- template: `
-
-
-
- {{ i18n.getWeekdayShortName(w) }}
-
-
-
-
-
{{ i18n.getWeekNumerals(week.number) }}
-
-
-
-
-
-
-
- `
-})
-export class NgbDatepickerMonthView {
- @Input() dayTemplate: TemplateRef;
- @Input() month: MonthViewModel;
- @Input() showWeekdays;
- @Input() showWeekNumbers;
-
- @Output() select = new EventEmitter();
-
- constructor(public i18n: NgbDatepickerI18n) {}
-
- doSelect(day: DayViewModel) {
- if (!day.context.disabled && !day.hidden) {
- this.select.emit(day.date);
- }
- }
-}
diff --git a/backup/src/datepicker/datepicker-navigation-select.scss b/backup/src/datepicker/datepicker-navigation-select.scss
deleted file mode 100644
index df6f8d9..0000000
--- a/backup/src/datepicker/datepicker-navigation-select.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-ngb-datepicker-navigation-select > .custom-select {
- flex: 1 1 auto;
- padding: 0 0.5rem;
- font-size: 0.875rem;
- height: 1.85rem;
-}
diff --git a/backup/src/datepicker/datepicker-navigation-select.spec.ts b/backup/src/datepicker/datepicker-navigation-select.spec.ts
deleted file mode 100644
index 96484c6..0000000
--- a/backup/src/datepicker/datepicker-navigation-select.spec.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-import {TestBed, ComponentFixture} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-import {getMonthSelect, getYearSelect} from '../test/datepicker/common';
-
-import {Component} from '@angular/core';
-
-import {NgbDatepickerModule} from './datepicker.module';
-import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
-import {NgbDate} from './ngb-date';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-const getOptions = (element: HTMLSelectElement): HTMLOptionElement[] => Array.from(element.options);
-const getOptionValues = (element: HTMLSelectElement): string[] => getOptions(element).map(x => x.value);
-
-function changeSelect(element: HTMLSelectElement, value: string) {
- element.value = value;
- const evt = document.createEvent('HTMLEvents');
- evt.initEvent('change', true, true);
- element.dispatchEvent(evt);
-}
-
-describe('ngb-datepicker-navigation-select', () => {
-
- beforeEach(() => {
- TestBed.overrideModule(NgbDatepickerModule, {set: {exports: [NgbDatepickerNavigationSelect]}});
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDatepickerModule]});
- });
-
- it('should generate month options correctly', () => {
- const fixture =
- createTestComponent(``);
- expect(getOptionValues(getMonthSelect(fixture.nativeElement))).toEqual([
- '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'
- ]);
-
- fixture.componentInstance.months = [1, 2, 3];
- fixture.detectChanges();
- expect(getOptionValues(getMonthSelect(fixture.nativeElement))).toEqual(['1', '2', '3']);
- });
-
- it('should generate year options correctly', () => {
- const fixture =
- createTestComponent(``);
-
- const yearSelect = getYearSelect(fixture.nativeElement);
- expect(getOptionValues(yearSelect)).toEqual(['2015', '2016', '2017']);
-
- fixture.componentInstance.years = [2001, 2002, 2003];
- fixture.detectChanges();
- expect(getOptionValues(yearSelect)).toEqual(['2001', '2002', '2003']);
- });
-
- it('should send date selection events', () => {
- const fixture = createTestComponent(
- ``);
-
- const monthSelect = getMonthSelect(fixture.nativeElement);
- const yearSelect = getYearSelect(fixture.nativeElement);
- spyOn(fixture.componentInstance, 'onSelect');
-
- changeSelect(monthSelect, '2');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(2016, 2, 1));
-
- changeSelect(monthSelect, '10');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(2016, 10, 1));
-
- changeSelect(yearSelect, '2017');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(2017, 8, 1));
-
- // out of range
- changeSelect(yearSelect, '2000');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(NaN, 8, 1));
- });
-
- it('should select months and years when date changes', () => {
- const fixture =
- createTestComponent(``);
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.date = new NgbDate(2017, 9, 22);
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('9');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2017');
-
- // out of range
- fixture.componentInstance.date = new NgbDate(2222, 22, 22);
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('');
- expect(getYearSelect(fixture.nativeElement).value).toBe('');
- });
-
- it('should have disabled select boxes when disabled', () => {
- const fixture = createTestComponent(
- ``);
-
- expect(getMonthSelect(fixture.nativeElement).disabled).toBe(true);
- expect(getYearSelect(fixture.nativeElement).disabled).toBe(true);
- });
-
- it('should have correct aria attributes on select options', () => {
- const fixture =
- createTestComponent(``);
-
- getOptions(getMonthSelect(fixture.nativeElement)).forEach((option, index) => {
- expect(option.getAttribute('aria-label')).toBe(fixture.componentInstance.ariaMonths[index]);
- });
- });
-
- it('should have correct aria attributes on select elements', () => {
- const fixture =
- createTestComponent(``);
-
- expect(getMonthSelect(fixture.nativeElement).getAttribute('aria-label')).toBe('Select month');
- expect(getYearSelect(fixture.nativeElement).getAttribute('aria-label')).toBe('Select year');
-
- });
-
- it('should have correct title attributes on select elements', () => {
- const fixture =
- createTestComponent(``);
-
- expect(getMonthSelect(fixture.nativeElement).getAttribute('title')).toBe('Select month');
- expect(getYearSelect(fixture.nativeElement).getAttribute('title')).toBe('Select year');
-
- });
-
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- date = new NgbDate(2016, 8, 22);
- months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
- ariaMonths = ['July', 'August', 'September'];
- years = [2015, 2016, 2017];
-
- onSelect = () => {};
-}
diff --git a/backup/src/datepicker/datepicker-navigation-select.ts b/backup/src/datepicker/datepicker-navigation-select.ts
deleted file mode 100644
index 9573288..0000000
--- a/backup/src/datepicker/datepicker-navigation-select.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
-import {NgbDate} from './ngb-date';
-import {toInteger} from '../util/util';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-
-@Component({
- selector: 'ngb-datepicker-navigation-select',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- styleUrls: ['./datepicker-navigation-select.scss'],
- template: `
-
- {{ i18n.getMonthShortName(m, date?.year) }}
-
- {{ i18n.getYearNumerals(y) }}
-
- `
-})
-export class NgbDatepickerNavigationSelect {
- @Input() date: NgbDate;
- @Input() disabled: boolean;
- @Input() months: number[];
- @Input() years: number[];
-
- @Output() select = new EventEmitter();
-
- constructor(public i18n: NgbDatepickerI18n) {}
-
- changeMonth(month: string) { this.select.emit(new NgbDate(this.date.year, toInteger(month), 1)); }
-
- changeYear(year: string) { this.select.emit(new NgbDate(toInteger(year), this.date.month, 1)); }
-}
diff --git a/backup/src/datepicker/datepicker-navigation.scss b/backup/src/datepicker/datepicker-navigation.scss
deleted file mode 100644
index d62475b..0000000
--- a/backup/src/datepicker/datepicker-navigation.scss
+++ /dev/null
@@ -1,70 +0,0 @@
-ngb-datepicker-navigation {
- display: flex;
- align-items: center;
-}
-
-.ngb-dp {
- &-navigation-chevron {
- border-style: solid;
- border-width: 0.2em 0.2em 0 0;
- display: inline-block;
- width: 0.75em;
- height: 0.75em;
- margin-left: 0.25em;
- margin-right: 0.15em;
- transform: rotate(-135deg);
- }
-
- .right &-navigation-chevron {
- transform: rotate(45deg);
- margin-left: 0.15em;
- margin-right: 0.25em;
- }
-
- &-arrow {
- display: flex;
- flex: 1 1 auto;
- padding-right: 0;
- padding-left: 0;
- margin: 0;
- width: 2rem;
- height: 2rem;
-
- &.right {
- justify-content: flex-end;
- }
-
- }
-
- &-arrow-btn {
- padding: 0 0.25rem;
- margin: 0 0.5rem;
- border: none;
- background-color: transparent;
- z-index: 1;
-
- &:focus {
- outline-width: 1px;
- outline-style: auto;
- }
-
- // IE workaround, as outline-style: auto doesn't work
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
- &:focus {
- outline-style: solid;
- }
- }
- }
-
- &-month-name {
- font-size: larger;
- height: 2rem;
- line-height: 2rem;
- text-align: center;
- }
-
- &-navigation-select {
- display: flex;
- flex: 1 1 9rem;
- }
-}
\ No newline at end of file
diff --git a/backup/src/datepicker/datepicker-navigation.spec.ts b/backup/src/datepicker/datepicker-navigation.spec.ts
deleted file mode 100644
index de50888..0000000
--- a/backup/src/datepicker/datepicker-navigation.spec.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-import {TestBed, ComponentFixture} from '@angular/core/testing';
-import {By} from '@angular/platform-browser';
-import {createGenericTestComponent} from '../test/common';
-import {getMonthSelect, getYearSelect, getNavigationLinks} from '../test/datepicker/common';
-
-import {Component} from '@angular/core';
-
-import {NgbDatepickerModule} from './datepicker.module';
-import {NavigationEvent} from './datepicker-view-model';
-import {NgbDatepickerNavigation} from './datepicker-navigation';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function changeSelect(element: HTMLSelectElement, value: string) {
- element.value = value;
- const evt = document.createEvent('HTMLEvents');
- evt.initEvent('change', true, true);
- element.dispatchEvent(evt);
-}
-
-describe('ngb-datepicker-navigation', () => {
-
- beforeEach(() => {
- TestBed.overrideModule(
- NgbDatepickerModule, {set: {exports: [NgbDatepickerNavigation, NgbDatepickerNavigationSelect]}});
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDatepickerModule]});
- });
-
- it('should toggle navigation select component', () => {
- const fixture = createTestComponent(` `);
-
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigationSelect))).not.toBeNull();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.showSelect = false;
- fixture.detectChanges();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigationSelect))).toBeNull();
- });
-
- it('should send date selection event', () => {
- const fixture = createTestComponent(` `);
-
- const monthSelect = getMonthSelect(fixture.nativeElement);
- const yearSelect = getYearSelect(fixture.nativeElement);
- spyOn(fixture.componentInstance, 'onSelect');
-
- changeSelect(monthSelect, '2');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(2016, 2, 1));
-
- changeSelect(yearSelect, '2020');
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledWith(new NgbDate(2020, 8, 1));
- });
-
- it('should make prev navigation button disabled', () => {
- const fixture =
- createTestComponent(` `);
-
- const links = getNavigationLinks(fixture.nativeElement);
- expect(links[0].hasAttribute('disabled')).toBeFalsy();
-
- fixture.componentInstance.prevDisabled = true;
- fixture.detectChanges();
- expect(links[0].hasAttribute('disabled')).toBeTruthy();
- });
-
- it('should make next navigation button disabled', () => {
- const fixture =
- createTestComponent(` `);
-
- const links = getNavigationLinks(fixture.nativeElement);
- expect(links[1].hasAttribute('disabled')).toBeFalsy();
-
- fixture.componentInstance.nextDisabled = true;
- fixture.detectChanges();
- expect(links[1].hasAttribute('disabled')).toBeTruthy();
- });
-
- it('should make year and month select boxes disabled', () => {
- const fixture = createTestComponent(` `);
-
- expect(getYearSelect(fixture.nativeElement).disabled).toBeTruthy();
- expect(getMonthSelect(fixture.nativeElement).disabled).toBeTruthy();
- });
-
- it('should send navigation events', () => {
- const fixture =
- createTestComponent(` `);
-
- const links = getNavigationLinks(fixture.nativeElement);
- spyOn(fixture.componentInstance, 'onNavigate');
-
- // prev
- links[0].click();
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith(NavigationEvent.PREV);
-
- // next
- links[1].click();
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith(NavigationEvent.NEXT);
- });
-
- it('should have buttons of type button', () => {
- const fixture = createTestComponent(` `);
-
- const links = getNavigationLinks(fixture.nativeElement);
- links.forEach((link) => { expect(link.getAttribute('type')).toBe('button'); });
- });
-
- it('should have correct titles and aria attributes on buttons', () => {
- const fixture = createTestComponent(` `);
-
- const links = getNavigationLinks(fixture.nativeElement);
- expect(links[0].getAttribute('aria-label')).toBe('Previous month');
- expect(links[1].getAttribute('aria-label')).toBe('Next month');
- expect(links[0].getAttribute('title')).toBe('Previous month');
- expect(links[1].getAttribute('title')).toBe('Next month');
- });
-
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- date = new NgbDate(2016, 8, 1);
- prevDisabled = false;
- nextDisabled = false;
- showSelect = true;
- selectBoxes = {months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], years: [2015, 2016, 2017, 2018, 2019, 2020]};
-
- onNavigate = () => {};
- onSelect = () => {};
-}
diff --git a/backup/src/datepicker/datepicker-navigation.ts b/backup/src/datepicker/datepicker-navigation.ts
deleted file mode 100644
index 4d033fe..0000000
--- a/backup/src/datepicker/datepicker-navigation.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import {Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
-import {NavigationEvent, MonthViewModel} from './datepicker-view-model';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-
-@Component({
- selector: 'ngb-datepicker-navigation',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- styleUrls: ['./datepicker-navigation.scss'],
- template: `
-
-
-
-
-
-
-
-
-
- 0">
-
- {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}
-
-
-
-
-
-
-
-
- `
-})
-export class NgbDatepickerNavigation {
- navigation = NavigationEvent;
-
- @Input() date: NgbDate;
- @Input() disabled: boolean;
- @Input() months: MonthViewModel[] = [];
- @Input() showSelect: boolean;
- @Input() prevDisabled: boolean;
- @Input() nextDisabled: boolean;
- @Input() selectBoxes: {years: number[], months: number[]};
-
- @Output() navigate = new EventEmitter();
- @Output() select = new EventEmitter();
-
- constructor(public i18n: NgbDatepickerI18n) {}
-}
diff --git a/backup/src/datepicker/datepicker-service.spec.ts b/backup/src/datepicker/datepicker-service.spec.ts
deleted file mode 100644
index 0538876..0000000
--- a/backup/src/datepicker/datepicker-service.spec.ts
+++ /dev/null
@@ -1,1431 +0,0 @@
-import {TestBed} from '@angular/core/testing';
-import {NgbDatepickerService} from './datepicker-service';
-import {NgbCalendar, NgbCalendarGregorian} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-import {Subscription} from 'rxjs';
-import {DatepickerViewModel} from './datepicker-view-model';
-import {NgbDatepickerI18n, NgbDatepickerI18nDefault} from './datepicker-i18n';
-import {Type} from '@angular/core';
-
-describe('ngb-datepicker-service', () => {
-
- let service: NgbDatepickerService;
- let calendar: NgbCalendar;
- let model: DatepickerViewModel;
- let mock: {onNext};
- let selectDate: NgbDate;
- let mockSelect: {onNext};
-
- let subscriptions: Subscription[];
-
- const getWeek = (week: number, month = 0) => model.months[month].weeks[week];
- const getDay = (day: number, week = 0, month = 0) => getWeek(week, month).days[day];
- const getDayCtx = (day: number) => getDay(day).context;
-
- beforeEach(() => {
- TestBed.configureTestingModule({
- providers: [
- NgbDatepickerService, {provide: NgbCalendar, useClass: NgbCalendarGregorian},
- {provide: NgbDatepickerI18n, useClass: NgbDatepickerI18nDefault}
- ]
- });
-
- calendar = TestBed.get(NgbCalendar as Type);
- service = TestBed.get(NgbDatepickerService);
- subscriptions = [];
- model = undefined;
- selectDate = null;
-
- mock = {onNext: () => {}};
- spyOn(mock, 'onNext');
-
- mockSelect = {onNext: () => {}};
- spyOn(mockSelect, 'onNext');
-
- // subscribing
- subscriptions.push(
- service.model$.subscribe(mock.onNext), service.model$.subscribe(m => model = m),
- service.select$.subscribe(mockSelect.onNext), service.select$.subscribe(d => selectDate = d));
- });
-
- afterEach(() => { subscriptions.forEach(s => s.unsubscribe()); });
-
- it(`should be possible to instantiate`, () => { expect(service).toBeTruthy(); });
-
- it(`should not return anything upon subscription`, () => {
- expect(model).toBeUndefined();
- expect(mock.onNext).not.toHaveBeenCalled();
- });
-
- describe(`min/max dates`, () => {
-
- it(`should emit null and valid 'minDate' values`, () => {
- // valid
- const minDate = new NgbDate(2017, 5, 1);
- service.minDate = minDate;
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.minDate).toEqual(minDate);
-
- // null
- service.minDate = null;
- expect(model.minDate).toBeNull();
-
- // undefined -> ignore
- service.minDate = undefined;
- expect(model.minDate).toBeNull();
-
- // invalid -> ignore
- service.minDate = new NgbDate(-2, 0, null);
- expect(model.minDate).toBeNull();
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should emit null and valid 'maxDate' values`, () => {
- // valid
- const maxDate = new NgbDate(2017, 5, 1);
- service.maxDate = maxDate;
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.maxDate).toEqual(maxDate);
-
- // null
- service.maxDate = null;
- expect(model.maxDate).toBeNull();
-
- // undefined -> ignore
- service.maxDate = undefined;
- expect(model.maxDate).toBeNull();
-
- // invalid -> ignore
- service.maxDate = new NgbDate(-2, 0, null);
- expect(model.maxDate).toBeNull();
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should not emit the same 'minDate' value twice`, () => {
- service.minDate = new NgbDate(2017, 5, 1);
- service.focus(new NgbDate(2015, 5, 1));
-
- service.minDate = new NgbDate(2017, 5, 1);
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not emit the same 'maxDate' value twice`, () => {
- service.maxDate = new NgbDate(2017, 5, 1);
- service.focus(new NgbDate(2015, 5, 1));
-
- service.maxDate = new NgbDate(2017, 5, 1);
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should throw if 'min' date is after 'max' date`, () => {
- const minDate = new NgbDate(2017, 5, 1);
- service.focus(new NgbDate(2015, 5, 1));
-
- expect(() => {
- service.minDate = minDate;
- service.maxDate = new NgbDate(2017, 4, 1);
- }).toThrowError();
- });
-
- it(`should align 'date' with 'maxDate'`, () => {
- service.maxDate = new NgbDate(2017, 5, 1);
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 1));
- });
-
- it(`should align 'date' with 'minDate'`, () => {
- service.minDate = new NgbDate(2017, 5, 10);
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 10));
- });
-
- it(`should mark dates outside 'min/maxDates' as disabled`, () => {
- // MAY 2017
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.minDate).toBeUndefined();
- expect(model.maxDate).toBeUndefined();
- expect(getDayCtx(0).disabled).toBe(false); // 1 MAY
- expect(getDayCtx(5).disabled).toBe(false); // 6 MAY
-
- service.minDate = new NgbDate(2017, 5, 2);
- service.maxDate = new NgbDate(2017, 5, 5);
- expect(getDayCtx(0).disabled).toBe(true); // 1 MAY
- expect(getDayCtx(5).disabled).toBe(true); // 6 MAY
- });
-
- it(`should update month when 'min/maxDates' change and visible`, () => {
- // MAY 2017
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.minDate).toBeUndefined();
- expect(model.maxDate).toBeUndefined();
-
- // MIN -> 5 MAY, 2017
- service.minDate = new NgbDate(2017, 5, 5);
- expect(model.months.length).toBe(1);
- expect(getDayCtx(0).disabled).toBe(true);
-
- // MAX -> 10 MAY, 2017
- service.maxDate = new NgbDate(2017, 5, 10);
- expect(model.months.length).toBe(1);
- expect(model.months[0].weeks[4].days[0].context.disabled).toBe(true);
- });
- });
-
- describe(`firstDayOfWeek`, () => {
-
- it(`should emit only positive numeric 'firstDayOfWeek' values`, () => {
- // valid
- service.firstDayOfWeek = 2;
- service.focus(new NgbDate(2015, 5, 1));
- expect(model.firstDayOfWeek).toEqual(2);
-
- // -1 -> ignore
- service.firstDayOfWeek = -1;
- expect(model.firstDayOfWeek).toEqual(2);
-
- // null -> ignore
- service.firstDayOfWeek = null;
- expect(model.firstDayOfWeek).toEqual(2);
-
- // undefined -> ignore
- service.firstDayOfWeek = null;
- expect(model.firstDayOfWeek).toEqual(2);
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not emit the same 'firstDayOfWeek' value twice`, () => {
- service.firstDayOfWeek = 2;
- service.focus(new NgbDate(2015, 5, 1));
-
- service.firstDayOfWeek = 2;
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should generate a month with firstDayOfWeek=1 by default`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.months[0].weekdays[0]).toBe(1);
- });
-
- it(`should generate weeks starting with 'firstDayOfWeek'`, () => {
- service.firstDayOfWeek = 2;
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.months[0].weekdays[0]).toBe(2);
-
- service.firstDayOfWeek = 4;
- expect(model.months.length).toBe(1);
- expect(model.months[0].weekdays[0]).toBe(4);
- });
-
- it(`should update months when 'firstDayOfWeek' changes`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.firstDayOfWeek).toBe(1);
-
- const oldFirstDate = getDay(0).date;
- expect(oldFirstDate).toEqual(new NgbDate(2017, 5, 1));
-
- service.firstDayOfWeek = 3;
- expect(model.months.length).toBe(1);
- expect(model.firstDayOfWeek).toBe(3);
- const newFirstDate = getDay(0).date;
- expect(newFirstDate).toEqual(new NgbDate(2017, 4, 26));
- });
- });
-
- describe(`displayMonths`, () => {
-
- it(`should emit only positive numeric 'displayMonths' values`, () => {
- // valid
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.displayMonths).toEqual(2);
-
- // -1 -> ignore
- service.displayMonths = -1;
- expect(model.displayMonths).toEqual(2);
-
- // null -> ignore
- service.displayMonths = null;
- expect(model.displayMonths).toEqual(2);
-
- // undefined -> ignore
- service.displayMonths = null;
- expect(model.displayMonths).toEqual(2);
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not emit the same 'displayMonths' value twice`, () => {
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 1));
-
- service.displayMonths = 2;
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should generate 'displayMonths' number of months`, () => {
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(2);
-
- service.displayMonths = 4;
- expect(model.months.length).toBe(4);
- });
-
- it(`should reuse existing months when 'displayMonths' changes`, () => {
- service.focus(new NgbDate(2017, 5, 5));
-
- // 1 month
- expect(model.months.length).toBe(1);
- const month = model.months[0];
- const date = month.weeks[0].days[0].date;
- expect(date).toEqual(new NgbDate(2017, 5, 1));
-
- // 2 months
- service.displayMonths = 2;
- expect(model.months.length).toBe(2);
- expect(model.months[0]).toBe(month);
- expect(getDay(0).date).toBe(date);
-
- // back to 1 month
- service.displayMonths = 1;
- expect(model.months.length).toBe(1);
- expect(model.months[0]).toBe(month);
- expect(getDay(0).date).toBe(date);
- });
-
- it(`should change the tabindex when changing the current month`, () => {
- service.displayMonths = 2;
- service.focus(new NgbDate(2018, 3, 31));
-
- expect(getDay(5, 4, 0).tabindex).toEqual(0); // 31 march in the first month block
- expect(getDay(5, 0, 1).tabindex).toEqual(-1); // 31 march in the second month block
-
- service.focusMove('d', 1);
- expect(getDay(5, 4, 0).tabindex).toEqual(-1); // 31 march in the first month block
- expect(getDay(5, 0, 1).tabindex).toEqual(-1); // 31 march in the second month block
- expect(getDay(6, 4, 0).tabindex).toEqual(-1); // 1st april in the first month block
- expect(getDay(6, 0, 1).tabindex).toEqual(0); // 1st april in the second month block
-
- });
-
- it(`should set the aria-label when changing the current month`, () => {
- service.displayMonths = 2;
- service.focus(new NgbDate(2018, 3, 31));
-
- expect(getDay(5, 4, 0).ariaLabel).toEqual('Saturday, March 31, 2018'); // 31 march in the first month block
- expect(getDay(5, 0, 1).ariaLabel).toEqual('Saturday, March 31, 2018'); // 31 march in the second month block
-
- service.focusMove('d', 1);
- expect(getDay(5, 4, 0).ariaLabel).toEqual('Saturday, March 31, 2018'); // 31 march in the first month block
- expect(getDay(5, 0, 1).ariaLabel).toEqual('Saturday, March 31, 2018'); // 31 march in the second month block
- expect(getDay(6, 4, 0).ariaLabel).toEqual('Sunday, April 1, 2018'); // 1st april in the first month block
- expect(getDay(6, 0, 1).ariaLabel).toEqual('Sunday, April 1, 2018'); // 1st april in the second month block
-
- });
- });
-
- describe(`disabled`, () => {
-
- it(`should emit 'disabled' values`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.disabled).toEqual(false);
-
- service.disabled = true;
- expect(model.disabled).toEqual(true);
- });
-
- it(`should not emit the same 'disabled' value twice`, () => {
- service.focus(new NgbDate(2017, 5, 1)); // 1
- service.disabled = true; // 2
-
- service.disabled = true; // ignored
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should not allow focusing when disabled`, () => {
- const today = new NgbDate(2017, 5, 2);
- service.focus(today); // 1
- service.disabled = true; // 2
-
- // focus
- service.focus(new NgbDate(2017, 5, 1)); // nope
- expect(model.focusDate).toEqual(today);
-
- // focusMove
- service.focusMove('d', 1); // nope
- expect(model.focusDate).toEqual(today);
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should not allow selecting when disabled`, () => {
- const today = new NgbDate(2017, 5, 2);
- service.focus(today); // 1
- service.disabled = true; // 2
-
- // select
- service.select(new NgbDate(2017, 5, 2)); // nope
- expect(model.selectedDate).toBeNull();
-
- // focus select
- service.focusSelect(); // nope
- expect(model.selectedDate).toBeNull();
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should not allow opening when disabled`, () => {
- service.focus(new NgbDate(2017, 5, 2)); // 1
- service.disabled = true; // 2
-
- // open
- service.open(new NgbDate(2016, 5, 1)); // nope
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
-
- expect(mock.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should turn focus off when disabled`, () => {
- service.focus(new NgbDate(2017, 5, 2));
- service.focusVisible = true;
- expect(model.focusVisible).toBeTruthy();
-
- service.disabled = true;
- expect(model.focusVisible).toBeFalsy();
- });
-
- it(`should not turn focus on when disabled`, () => {
- service.focus(new NgbDate(2017, 5, 2));
- service.disabled = true;
- expect(model.focusVisible).toBeFalsy();
-
- service.focusVisible = true;
- expect(model.focusVisible).toBeFalsy();
- });
-
- it(`should disable navigation arrows`, () => {
- service.focus(new NgbDate(2017, 5, 2));
- expect(model.prevDisabled).toBeFalsy();
- expect(model.nextDisabled).toBeFalsy();
-
- service.disabled = true;
- expect(model.prevDisabled).toBeTruthy();
- expect(model.nextDisabled).toBeTruthy();
-
- service.disabled = false;
- expect(model.prevDisabled).toBeFalsy();
- expect(model.nextDisabled).toBeFalsy();
- });
-
- });
-
- describe(`focusVisible`, () => {
-
- it(`should set focus visible or not`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.focusVisible).toEqual(false);
-
- service.focusVisible = true;
- expect(model.focusVisible).toEqual(true);
- });
-
- it(`should not emit the same 'focusVisible' value twice`, () => {
- service.focusVisible = true;
- service.focus(new NgbDate(2017, 5, 1));
-
- service.focusVisible = true; // ignored
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not rebuild months when focus visibility changes`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(model.focusVisible).toEqual(false);
- expect(model.months.length).toBe(1);
- const month = model.months[0];
- const date = month.weeks[0].days[0].date;
-
- service.focusVisible = true;
- expect(model.focusVisible).toEqual(true);
- expect(model.months[0]).toBe(month);
- expect(getDay(0).date).toBe(date);
- });
-
- });
-
- describe(`navigation`, () => {
-
- it(`should emit navigation values`, () => {
- // default = 'selected'
- service.focus(new NgbDate(2015, 5, 1));
- expect(model.navigation).toEqual('select');
-
- service.navigation = 'none';
- expect(model.navigation).toEqual('none');
-
- service.navigation = 'arrows';
- expect(model.navigation).toEqual('arrows');
- });
-
- it(`should not emit the same 'navigation' value twice`, () => {
- service.focus(new NgbDate(2017, 5, 1));
-
- service.navigation = 'select'; // ignored
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- describe(`select`, () => {
-
- const range = (start, end) => Array.from({length: end - start + 1}, (e, i) => start + i);
-
- it(`should not generate 'months' and 'years' for non-select navigations`, () => {
- service.minDate = new NgbDate(2010, 5, 1);
- service.maxDate = new NgbDate(2012, 5, 1);
- service.focus(new NgbDate(2011, 5, 1));
- expect(model.selectBoxes.years).not.toEqual([]);
- expect(model.selectBoxes.months).not.toEqual([]);
-
- service.navigation = 'none';
- expect(model.selectBoxes.years).toEqual([]);
- expect(model.selectBoxes.months).toEqual([]);
-
- service.navigation = 'arrows';
- expect(model.selectBoxes.years).toEqual([]);
- expect(model.selectBoxes.months).toEqual([]);
- });
-
- it(`should generate 'months' and 'years' for given min/max dates`, () => {
- service.minDate = new NgbDate(2010, 5, 1);
- service.maxDate = new NgbDate(2012, 5, 1);
- service.focus(new NgbDate(2011, 5, 1));
-
- expect(model.selectBoxes.years).toEqual([2010, 2011, 2012]);
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.focus(new NgbDate(2010, 5, 1));
- expect(model.selectBoxes.years).toEqual([2010, 2011, 2012]);
- expect(model.selectBoxes.months).toEqual([5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.focus(new NgbDate(2012, 5, 1));
- expect(model.selectBoxes.years).toEqual([2010, 2011, 2012]);
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5]);
- });
-
- it(`should update 'months' and 'years' when min/max dates change`, () => {
- service.minDate = new NgbDate(2010, 5, 1);
- service.maxDate = new NgbDate(2012, 5, 1);
- service.focus(new NgbDate(2011, 5, 1));
-
- expect(model.selectBoxes.years).toEqual([2010, 2011, 2012]);
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.minDate = new NgbDate(2011, 2, 1);
- expect(model.selectBoxes.years).toEqual([2011, 2012]);
- expect(model.selectBoxes.months).toEqual([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.maxDate = new NgbDate(2011, 8, 1);
- expect(model.selectBoxes.years).toEqual([2011]);
- expect(model.selectBoxes.months).toEqual([2, 3, 4, 5, 6, 7, 8]);
- });
-
- it(`should generate [-10, +10] 'years' when min/max dates are missing`, () => {
- const year = calendar.getToday().year;
- service.open(null);
- expect(model.selectBoxes.years).toEqual(range(year - 10, year + 10));
-
- service.focus(new NgbDate(2011, 1, 1));
- expect(model.selectBoxes.years).toEqual(range(2001, 2021));
-
- service.focus(new NgbDate(2020, 1, 1));
- expect(model.selectBoxes.years).toEqual(range(2010, 2030));
- });
-
- it(`should generate [min, +10] 'years' when max date is missing`, () => {
- service.minDate = new NgbDate(2010, 1, 1);
- service.open(new NgbDate(2011, 1, 1));
- expect(model.selectBoxes.years).toEqual(range(2010, 2021));
-
- service.minDate = new NgbDate(2015, 1, 1);
- expect(model.selectBoxes.years).toEqual(range(2015, 2025));
-
- service.minDate = new NgbDate(1000, 1, 1);
- expect(model.selectBoxes.years).toEqual(range(1000, 2025));
- });
-
- it(`should generate [min, +10] 'years' when min date is missing`, () => {
- service.maxDate = new NgbDate(2010, 1, 1);
- service.open(new NgbDate(2009, 1, 1));
- expect(model.selectBoxes.years).toEqual(range(1999, 2010));
-
- service.maxDate = new NgbDate(2005, 1, 1);
- expect(model.selectBoxes.years).toEqual(range(1995, 2005));
-
- service.maxDate = new NgbDate(3000, 1, 1);
- expect(model.selectBoxes.years).toEqual(range(1995, 3000));
- });
-
- it(`should generate 'months' when min/max dates are missing`, () => {
- service.open(null);
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.focus(new NgbDate(2010, 1, 1));
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it(`should generate 'months' and 'years' when resetting min/max dates`, () => {
- service.minDate = new NgbDate(2010, 3, 1);
- service.maxDate = new NgbDate(2010, 8, 1);
- service.open(new NgbDate(2010, 5, 10));
- expect(model.selectBoxes.months).toEqual([3, 4, 5, 6, 7, 8]);
- expect(model.selectBoxes.years).toEqual([2010]);
-
- service.minDate = null;
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8]);
- expect(model.selectBoxes.years).toEqual(range(2000, 2010));
-
- service.maxDate = null;
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(model.selectBoxes.years).toEqual(range(2000, 2020));
- });
-
- it(`should generate 'months' when max date is missing`, () => {
- service.minDate = new NgbDate(2010, 1, 1);
- service.open(new NgbDate(2010, 5, 1));
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.minDate = new NgbDate(2010, 4, 1);
- expect(model.selectBoxes.months).toEqual([4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it(`should generate 'months' when min date is missing`, () => {
- service.maxDate = new NgbDate(2010, 12, 1);
- service.open(new NgbDate(2010, 5, 1));
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- service.maxDate = new NgbDate(2010, 7, 1);
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7]);
- });
-
- it(`should generate 'months' based on the first date, not the focus date`, () => {
- service.displayMonths = 2;
- service.maxDate = new NgbDate(2017, 1, 11);
- service.open(new NgbDate(2017, 1, 1));
- expect(model.selectBoxes.months).toEqual([1]);
-
- service.open(new NgbDate(2016, 12, 1));
- expect(model.selectBoxes.months).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it(`should rebuild 'months' and 'years' only when year change`, () => {
- service.focus(new NgbDate(2010, 5, 1));
- let months = model.selectBoxes.months;
- let years = model.selectBoxes.years;
-
- // focusing -> nothing
- service.focus(new NgbDate(2010, 5, 10));
- expect(model.selectBoxes.months).toBe(months);
- expect(model.selectBoxes.years).toBe(years);
-
- // month changes -> nothing
- service.focus(new NgbDate(2010, 6, 1));
- expect(model.selectBoxes.months).toBe(months);
- expect(model.selectBoxes.years).toBe(years);
-
- // year changes -> rebuilding both
- service.focus(new NgbDate(2011, 6, 1));
- expect(model.selectBoxes.months).not.toBe(months);
- expect(model.selectBoxes.years).not.toBe(years);
- });
- });
-
- describe(`arrows`, () => {
-
- it(`should be enabled by default`, () => {
- service.focus(new NgbDate(2018, 3, 10));
- expect(model.prevDisabled).toBeFalsy();
- expect(model.nextDisabled).toBeFalsy();
- });
-
- it(`should use initial 'minDate' and 'maxDate' values`, () => {
- service.minDate = new NgbDate(2018, 3, 10);
- service.maxDate = new NgbDate(2018, 3, 10);
- service.focus(new NgbDate(2018, 3, 10));
- expect(model.prevDisabled).toBeTruthy();
- expect(model.nextDisabled).toBeTruthy();
- });
-
- it(`should react to 'minDate' changes`, () => {
- service.focus(new NgbDate(2018, 3, 10));
- service.minDate = new NgbDate(2018, 3, 1);
- expect(model.prevDisabled).toBeTruthy();
-
- service.minDate = new NgbDate(2018, 2, 1);
- expect(model.prevDisabled).toBeFalsy();
-
- service.minDate = new NgbDate(2018, 2, 28);
- expect(model.prevDisabled).toBeFalsy();
- });
-
- it(`should react to 'maxDate' changes`, () => {
- service.focus(new NgbDate(2018, 3, 10));
- service.maxDate = new NgbDate(2018, 3, 31);
- expect(model.nextDisabled).toBeTruthy();
-
- service.maxDate = new NgbDate(2018, 4, 1);
- expect(model.nextDisabled).toBeFalsy();
-
- service.maxDate = new NgbDate(2018, 4, 30);
- expect(model.nextDisabled).toBeFalsy();
- });
-
- it(`should react to 'minDate' changes with multiple months`, () => {
- service.displayMonths = 2;
- service.minDate = new NgbDate(2018, 3, 1);
- service.open(new NgbDate(2018, 3, 10)); // open: [MAR, APR], focus: MAR
- expect(model.prevDisabled).toBeTruthy();
-
- service.focus(new NgbDate(2018, 4, 10)); // open [MAR, APR], focus: APR
- expect(model.prevDisabled).toBeTruthy();
-
- service.open(new NgbDate(2018, 4, 10)); // open [APR, MAY], focus: APR
- expect(model.prevDisabled).toBeFalsy();
-
- service.focus(new NgbDate(2018, 5, 10)); // open [APR, MAY], focus: MAY
- expect(model.prevDisabled).toBeFalsy();
- });
-
- it(`should react to 'maxDate' changes with multiple months`, () => {
- service.displayMonths = 2;
- service.maxDate = new NgbDate(2018, 3, 10);
- service.open(new NgbDate(2018, 3, 1)); // open: [MAR, APR], focus: MAR
- expect(model.nextDisabled).toBeTruthy();
-
- service.open(new NgbDate(2018, 2, 1)); // open: [FEB, MAR], focus: FEB
- expect(model.nextDisabled).toBeTruthy();
-
- service.focus(new NgbDate(2018, 3, 1)); // open: [FEB, MAR], focus: MAR
- expect(model.nextDisabled).toBeTruthy();
-
- service.open(new NgbDate(2018, 1, 1)); // open: [JAN, FEB], focus: JAN
- expect(model.nextDisabled).toBeFalsy();
-
- service.focus(new NgbDate(2018, 2, 1)); // open: [JAN, FEB], focus: FEB
- expect(model.nextDisabled).toBeFalsy();
- });
- });
- });
-
- describe(`outsideDays`, () => {
-
- it(`should emit 'outsideDays' values`, () => {
- service.focus(new NgbDate(2015, 5, 1));
- expect(model.outsideDays).toEqual('visible');
-
- service.outsideDays = 'hidden';
- expect(model.outsideDays).toEqual('hidden');
-
- service.outsideDays = 'collapsed';
- expect(model.outsideDays).toEqual('collapsed');
- });
-
- it(`should not emit the same 'outsideDays' value twice`, () => {
- service.focus(new NgbDate(2017, 5, 1));
-
- service.outsideDays = 'visible'; // ignored
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not hide days when 'outsideDays' is 'visible'`, () => {
- // single month
- service.outsideDays = 'visible';
- service.focus(new NgbDate(2018, 5, 1));
-
- expect(getDay(0, 0).hidden).toBeFalsy(); // 30 APR
- expect(getWeek(0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 7 MAY
- expect(getWeek(1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5).hidden).toBeFalsy(); // 7 JUN
- expect(getWeek(5).collapsed).toBeFalsy();
-
- // multiple months
- // days is between two month must stay hidden regardless of outside days value
- service.displayMonths = 2;
-
- // MAY 2018
- expect(getDay(0, 0, 0).hidden).toBeFalsy(); // 30 APR
- expect(getWeek(0, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1, 0).hidden).toBeFalsy(); // 7 MAY
- expect(getWeek(1, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 0).hidden).toBeTruthy(); // 7 JUN
- expect(getWeek(5, 0).collapsed).toBeFalsy();
-
- // JUNE 2018
- expect(getDay(0, 0, 1).hidden).toBeTruthy(); // 28 MAY
- expect(getWeek(0, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 4 JUN
- expect(getWeek(1, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 1).hidden).toBeFalsy(); // 2 JUL
- expect(getWeek(5, 1).collapsed).toBeFalsy();
-
- // Edge case -> in between years
- service.focus(new NgbDate(2018, 12, 1));
-
- // DEC 2018
- expect(getDay(0, 0, 0).hidden).toBeFalsy(); // 26 NOV
- expect(getWeek(0, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1, 0).hidden).toBeFalsy(); // 3 DEC
- expect(getWeek(1, 0).collapsed).toBeFalsy();
-
- expect(getDay(1, 5, 0).hidden).toBeTruthy(); // 1 JAN
- expect(getWeek(5, 0).collapsed).toBeFalsy();
-
- // JAN 2019
- expect(getDay(0, 0, 1).hidden).toBeTruthy(); // 31 DEC
- expect(getWeek(0, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 7 JAN
- expect(getWeek(1, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 1).hidden).toBeFalsy(); // 4 FEB
- expect(getWeek(5, 1).collapsed).toBeFalsy();
- });
-
- it(`should hide days when 'outsideDays' is 'hidden'`, () => {
- // single month
- service.outsideDays = 'hidden';
- service.focus(new NgbDate(2018, 5, 1));
-
- expect(getDay(0, 0).hidden).toBeTruthy(); // 30, APR
- expect(getWeek(0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 7, MAY
- expect(getWeek(1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5).hidden).toBeTruthy(); // 7, JUN
- expect(getWeek(5).collapsed).toBeFalsy();
-
- // multiple months
- service.displayMonths = 2;
-
- // MAY 2018
- expect(getDay(0, 0, 0).hidden).toBeTruthy(); // 30 APR
- expect(getWeek(0, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1, 0).hidden).toBeFalsy(); // 7 MAY
- expect(getWeek(1, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 0).hidden).toBeTruthy(); // 7 JUN
- expect(getWeek(5, 0).collapsed).toBeFalsy();
-
- // JUNE 2018
- expect(getDay(0, 0, 1).hidden).toBeTruthy(); // 28 MAY
- expect(getWeek(0, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 4 JUN
- expect(getWeek(1, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 1).hidden).toBeTruthy(); // 2 JUL
- expect(getWeek(5, 1).collapsed).toBeFalsy();
- });
-
- it(`should hide days when 'outsideDays' is 'collapsed'`, () => {
- // single month
- service.outsideDays = 'collapsed';
- service.focus(new NgbDate(2018, 5, 1));
-
- expect(getDay(0, 0).hidden).toBeTruthy(); // 30, APR
- expect(getWeek(0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 7, MAY
- expect(getWeek(1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5).hidden).toBeTruthy(); // 7, JUN
- expect(getWeek(5).collapsed).toBeTruthy();
-
- // multiple months
- service.displayMonths = 2;
-
- // MAY 2018
- expect(getDay(0, 0, 0).hidden).toBeTruthy(); // 30 APR
- expect(getWeek(0, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 1, 0).hidden).toBeFalsy(); // 7 MAY
- expect(getWeek(1, 0).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 0).hidden).toBeTruthy(); // 7 JUN
- expect(getWeek(5, 0).collapsed).toBeTruthy();
-
- // JUNE 2018
- expect(getDay(0, 0, 1).hidden).toBeTruthy(); // 28 MAY
- expect(getWeek(0, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 1).hidden).toBeFalsy(); // 4 JUN
- expect(getWeek(1, 1).collapsed).toBeFalsy();
-
- expect(getDay(0, 5, 1).hidden).toBeTruthy(); // 2 JUL
- expect(getWeek(5, 1).collapsed).toBeTruthy();
- });
-
- it(`should toggle days when 'outsideDays' changes`, () => {
- service.outsideDays = 'visible';
- service.focus(new NgbDate(2018, 5, 1));
- expect(getDay(0).hidden).toBeFalsy(); // 30, APR
- expect(getWeek(5).collapsed).toBeFalsy();
-
- service.outsideDays = 'collapsed';
- expect(getDay(0).hidden).toBeTruthy(); // 30, APR
- expect(getWeek(5).collapsed).toBeTruthy();
- });
- });
-
- describe(`dayTemplateData`, () => {
-
- it(`should not pass anything to the template by default`, () => {
- // MAY 2017
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDay(0).context.data).toBeUndefined();
- });
-
- it(`should pass arbitrary data to the template`, () => {
- service.dayTemplateData = () => 'data';
-
- // MAY 2017
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDay(0).context.data).toBe('data');
- });
-
- it(`should update months when 'dayTemplateData' changes`, () => {
- // MAY 2017
- service.dayTemplateData = () => 'one';
- service.focus(new NgbDate(2017, 5, 1));
-
- expect(getDay(0).context.data).toBe('one');
-
- service.dayTemplateData = (_) => 'two';
-
- expect(getDay(0).context.data).toBe('two');
- });
- });
-
- describe(`markDisabled`, () => {
-
- it(`should mark dates as disabled by passing 'markDisabled'`, () => {
- // marking 5th day of each month as disabled
- service.markDisabled = (date) => date && date.day === 5;
-
- // MAY 2017
- service.focus(new NgbDate(2017, 5, 1));
-
- const day = getDay(4); // 5th day;
- expect(day.date).toEqual(new NgbDate(2017, 5, 5));
- expect(day.context.disabled).toBe(true);
- });
-
- it(`should update months when 'markDisabled changes'`, () => {
- // MAY 2017
- service.markDisabled = (_) => true;
- service.focus(new NgbDate(2017, 5, 1));
-
- expect(getDay(0).context.disabled).toBe(true);
-
- service.markDisabled = (_) => false;
-
- expect(getDay(0).context.disabled).toBe(false);
- });
- });
-
- describe(`focus handling`, () => {
-
- it(`should generate 1 month on 'focus()' by default`, () => {
- expect(model).toBeUndefined();
-
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months).toBeTruthy();
- expect(model.months.length).toBe(1);
- });
-
- it(`should emit new date on 'focus()'`, () => {
- const today = new NgbDate(2017, 5, 2);
- service.focus(today);
- expect(model.focusDate).toEqual(today);
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should ignore invalid 'focus()' values`, () => {
- service.focus(null);
- service.focus(undefined);
- service.focus(new NgbDate(-2, 0, null));
-
- expect(mock.onNext).not.toHaveBeenCalled();
- });
-
- it(`should not emit the same date twice on 'focus()'`, () => {
- service.focus(new NgbDate(2017, 5, 2));
- service.focus(new NgbDate(2017, 5, 2));
-
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should update months when focused date updates`, () => {
- service.focus(new NgbDate(2017, 5, 5));
-
- expect(model.months.length).toBe(1);
- expect(model.months[0].firstDate).toEqual(new NgbDate(2017, 5, 1));
-
- // next month
- service.focus(new NgbDate(2017, 6, 10));
-
- expect(model.months.length).toBe(1);
- expect(model.months[0].firstDate).toEqual(new NgbDate(2017, 6, 1));
-
- // next year
- service.focus(new NgbDate(2018, 6, 10));
-
- expect(model.months.length).toBe(1);
- expect(model.months[0].firstDate).toEqual(new NgbDate(2018, 6, 1));
-
- expect(mock.onNext).toHaveBeenCalledTimes(3);
- });
-
- it(`should move focus with 'focusMove()'`, () => {
- const date = new NgbDate(2017, 5, 5);
-
- // days
- service.focus(date);
- service.focusMove('d', 1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 6));
-
- service.focus(date);
- service.focusMove('d', -1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 4));
-
- // months
- service.focus(date);
- service.focusMove('m', 1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 6, 1));
-
- service.focus(date);
- service.focusMove('m', -1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 4, 1));
-
- // years
- service.focus(date);
- service.focusMove('y', 1);
- expect(model.focusDate).toEqual(new NgbDate(2018, 1, 1));
-
- service.focus(date);
- service.focusMove('y', -1);
- expect(model.focusDate).toEqual(new NgbDate(2016, 1, 1));
- });
-
- it(`should move focus when 'minDate' changes`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- service.maxDate = new NgbDate(2017, 5, 1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 1));
- });
-
- it(`should move focus when 'maxDate' changes`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- service.minDate = new NgbDate(2017, 5, 10);
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 10));
- });
-
- it(`should not rebuild a single month if newly focused date is visible`, () => {
- service.focus(new NgbDate(2017, 5, 5));
-
- expect(model.months.length).toBe(1);
- const month = model.months[0];
- const date = month.weeks[0].days[0].date;
- expect(date).toEqual(new NgbDate(2017, 5, 1));
-
- service.focus(new NgbDate(2017, 5, 10));
- expect(model.months[0]).toBe(month);
- expect(getDay(0).date).toBe(date);
- });
-
- it(`should not rebuild multiple months if newly focused date is visible`, () => {
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 5));
-
- expect(model.months.length).toBe(2);
- const months = model.months;
- expect(months[0].firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(months[1].lastDate).toEqual(new NgbDate(2017, 6, 30));
-
- service.focus(new NgbDate(2017, 6, 10));
- expect(model.months.length).toBe(2);
- expect(model.months[0]).toBe(months[0]);
- expect(model.months[1]).toBe(months[1]);
- });
- });
-
- describe(`view change handling`, () => {
-
- it(`should open current month if nothing is provided`, () => {
- const today = calendar.getToday();
- service.open(null);
- expect(model.months.length).toBe(1);
- expect(model.firstDate).toEqual(new NgbDate(today.year, today.month, 1));
- expect(model.focusDate).toEqual(today);
- });
-
- it(`should open month and set up focus correctly`, () => {
- service.open(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 5));
- });
-
- it(`should open month and move the focus with it`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 5));
-
- // same month, same focus
- service.open(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 5));
-
- // different month, moving focus along
- service.open(new NgbDate(2017, 10, 10));
- expect(model.focusDate).toEqual(new NgbDate(2017, 10, 10));
- });
-
- it(`should open multiple months and move focus with them`, () => {
- // MAY-JUN
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(2);
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 5));
-
- // moving view to JUL-AUG
- service.open(new NgbDate(2017, 7, 10));
- expect(model.firstDate).toEqual(new NgbDate(2017, 7, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 7, 10));
-
- // moving view to MAY-JUN
- service.open(new NgbDate(2017, 5, 10));
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 10));
- });
-
- it(`should open multiple months and do not touch focus if it is visible`, () => {
- // MAY-JUN
- service.displayMonths = 2;
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(2);
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 5, 5));
-
- // moving focus to JUN
- service.focus(new NgbDate(2017, 6, 5));
- expect(model.focusDate).toEqual(new NgbDate(2017, 6, 5));
-
- // moving view to JUN-JUL
- service.open(new NgbDate(2017, 6, 10));
- expect(model.firstDate).toEqual(new NgbDate(2017, 6, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 6, 5));
-
- // moving view to MAY-JUN
- service.open(new NgbDate(2017, 5, 10));
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(model.focusDate).toEqual(new NgbDate(2017, 6, 5));
- });
-
- it(`should reuse existing months when opening`, () => {
- service.focus(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- const month = model.months[0];
- const date = month.weeks[0].days[0].date;
- expect(date).toEqual(new NgbDate(2017, 5, 1));
-
- service.open(new NgbDate(2017, 5, 10));
- expect(model.months.length).toBe(1);
- expect(model.months[0]).toBe(month);
- expect(getDay(0).date).toBe(date);
- });
-
- it(`should not rebuild anything when opening dates from the same month`, () => {
- service.open(new NgbDate(2017, 5, 5));
- expect(model.months.length).toBe(1);
- expect(model.firstDate).toEqual(new NgbDate(2017, 5, 1));
- expect(mock.onNext).toHaveBeenCalledTimes(1);
-
- service.open(new NgbDate(2017, 5, 5)); // new object, same date
- service.open(new NgbDate(2017, 5, 1)); // another date
- expect(mock.onNext).toHaveBeenCalledTimes(1);
- });
- });
-
- describe(`selection handling`, () => {
-
- it(`should generate months for initial selection`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.select(date);
- expect(model.months.length).toBe(1);
- expect(model.selectedDate).toEqual(date);
- });
-
- it(`should select currently focused date with 'focusSelect()'`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- service.focusSelect();
- expect(model.selectedDate).toEqual(date);
- expect(selectDate).toEqual(date);
-
- expect(mockSelect.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not select disabled dates with 'focusSelect()'`, () => {
- // marking 5th day of each month as disabled
- service.markDisabled = (d) => d && d.day === 5;
-
- // focusing MAY, 5
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
- expect(model.focusDate).toEqual(date);
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- service.focusSelect();
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- expect(mockSelect.onNext).not.toHaveBeenCalled();
- });
-
- it(`should not emit selection event by default`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.select(date);
- expect(mockSelect.onNext).not.toHaveBeenCalled();
- });
-
- it(`should not emit selection event for null values`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.select(null, {emitEvent: true});
-
- expect(mockSelect.onNext).not.toHaveBeenCalled();
- });
-
- it(`should emit date selection event'`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- service.select(date, {emitEvent: true});
- expect(model.selectedDate).toEqual(date);
- expect(selectDate).toEqual(date);
-
- expect(mockSelect.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should emit date selection event for non-visible dates'`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- let invisibleDate = new NgbDate(2016, 5, 5);
- service.select(invisibleDate, {emitEvent: true});
- expect(model.selectedDate).toEqual(invisibleDate);
- expect(selectDate).toEqual(invisibleDate);
-
- expect(mockSelect.onNext).toHaveBeenCalledTimes(1);
- });
-
- it(`should not emit date selection event for disabled dates'`, () => {
- // marking 5th day of each month as disabled
- service.markDisabled = (d) => d && d.day === 5;
-
- // focusing MAY, 5
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- service.select(date, {emitEvent: true});
- expect(model.selectedDate).toBeNull();
- expect(selectDate).toBeNull();
-
- expect(mockSelect.onNext).not.toHaveBeenCalled();
- });
-
- it(`should emit date selection event when focusing on the same date twice`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
-
- service.focusSelect();
- service.focusSelect();
-
- expect(mockSelect.onNext).toHaveBeenCalledTimes(2);
- });
-
- it(`should emit date selection event when selecting the same date twice`, () => {
- const date = new NgbDate(2017, 5, 5);
- service.focus(date);
-
- service.select(date, {emitEvent: true});
- service.select(date, {emitEvent: true});
-
- expect(mockSelect.onNext).toHaveBeenCalledTimes(2);
- });
- });
-
- describe(`template context`, () => {
-
- it(`should generate 'date' for day template`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).date).toEqual(new NgbDate(2017, 5, 1));
- expect(getDayCtx(1).date).toEqual(new NgbDate(2017, 5, 2));
-
- service.focus(new NgbDate(2017, 10, 1));
- expect(getDayCtx(0).date).toEqual(new NgbDate(2017, 9, 25));
- expect(getDayCtx(1).date).toEqual(new NgbDate(2017, 9, 26));
- });
-
- it(`should generate date as $implicit value for day template`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).$implicit).toEqual(new NgbDate(2017, 5, 1));
- });
-
- it(`should generate 'currentMonth' for day template`, () => {
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).currentMonth).toBe(5);
-
- service.focus(new NgbDate(2017, 10, 1));
- expect(getDayCtx(0).currentMonth).toBe(10);
- });
-
- it(`should update 'focused' flag and tabindex for day template`, () => {
- // off
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).focused).toBeFalsy();
- expect(getDayCtx(1).focused).toBeFalsy();
- expect(getDay(0).tabindex).toEqual(0);
- expect(getDay(1).tabindex).toEqual(-1);
-
- // on
- service.focusVisible = true;
- expect(getDayCtx(0).focused).toBeTruthy();
- expect(getDayCtx(1).focused).toBeFalsy();
- expect(getDay(0).tabindex).toEqual(0);
- expect(getDay(1).tabindex).toEqual(-1);
-
- // move
- service.focusMove('d', 1);
- expect(getDayCtx(0).focused).toBeFalsy();
- expect(getDayCtx(1).focused).toBeTruthy();
- expect(getDay(0).tabindex).toEqual(-1);
- expect(getDay(1).tabindex).toEqual(0);
-
- // off
- service.focusVisible = false;
- expect(getDayCtx(0).focused).toBeFalsy();
- expect(getDayCtx(1).focused).toBeFalsy();
- expect(getDay(0).tabindex).toEqual(-1);
- expect(getDay(1).tabindex).toEqual(0);
- });
-
- it(`should update 'selected' flag for day template`, () => {
- // off
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).selected).toBeFalsy();
- expect(getDayCtx(1).selected).toBeFalsy();
-
- // select
- service.focusSelect();
- expect(getDayCtx(0).selected).toBeTruthy();
- expect(getDayCtx(1).selected).toBeFalsy();
-
- // move
- service.select(new NgbDate(2017, 5, 2));
- expect(getDayCtx(0).selected).toBeFalsy();
- expect(getDayCtx(1).selected).toBeTruthy();
-
- // off
- service.select(null);
- expect(getDayCtx(0).selected).toBeFalsy();
- expect(getDayCtx(1).selected).toBeFalsy();
- });
-
- it(`should update 'disabled' flag for day template`, () => {
- // off
- service.focus(new NgbDate(2017, 5, 1));
- expect(getDayCtx(0).disabled).toBeFalsy();
- expect(getDayCtx(1).disabled).toBeFalsy();
-
- // marking 2nd day of each month as disabled
- service.markDisabled = (date) => date && date.day === 2;
- expect(getDayCtx(0).disabled).toBeFalsy();
- expect(getDayCtx(1).disabled).toBeTruthy();
-
- // global disabled on
- service.disabled = true;
- expect(getDayCtx(0).disabled).toBeTruthy();
- expect(getDayCtx(1).disabled).toBeTruthy();
-
- // global disabled on
- service.disabled = false;
- expect(getDayCtx(0).disabled).toBeFalsy();
- expect(getDayCtx(1).disabled).toBeTruthy();
- });
-
- it(`should update 'today' flag for day template`, () => {
- calendar.getToday = () => new NgbDate(2018, 12, 20);
- const today = calendar.getToday();
- service.open(today);
-
- expect(getDay(2, 2, 0).context.today).toBeFalsy();
- expect(getDay(3, 3, 0).context.today).toBeTruthy();
- });
- });
-
- describe('toValidDate()', () => {
-
- it('should convert a valid NgbDate', () => {
- expect(service.toValidDate(new NgbDate(2016, 10, 5))).toEqual(new NgbDate(2016, 10, 5));
- expect(service.toValidDate({year: 2016, month: 10, day: 5})).toEqual(new NgbDate(2016, 10, 5));
- });
-
- it('should return today for an invalid NgbDate', () => {
- const today = calendar.getToday();
- expect(service.toValidDate(null)).toEqual(today);
- expect(service.toValidDate({})).toEqual(today);
- expect(service.toValidDate(undefined)).toEqual(today);
- expect(service.toValidDate(new Date())).toEqual(today);
- expect(service.toValidDate(new NgbDate(275760, 9, 14))).toEqual(today);
- });
-
- it('should return today if default value is undefined',
- () => { expect(service.toValidDate(null, undefined)).toEqual(calendar.getToday()); });
-
- it('should return default value for an invalid NgbDate if provided', () => {
- expect(service.toValidDate(null, new NgbDate(1066, 6, 6))).toEqual(new NgbDate(1066, 6, 6));
- expect(service.toValidDate(null, null)).toEqual(null);
- });
- });
-});
diff --git a/backup/src/datepicker/datepicker-service.ts b/backup/src/datepicker/datepicker-service.ts
deleted file mode 100644
index 88b0665..0000000
--- a/backup/src/datepicker/datepicker-service.ts
+++ /dev/null
@@ -1,300 +0,0 @@
-import {NgbCalendar, NgbPeriod} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-import {NgbDateStruct} from './ngb-date-struct';
-import {DatepickerViewModel, NgbDayTemplateData, NgbMarkDisabled} from './datepicker-view-model';
-import {Injectable} from '@angular/core';
-import {isInteger, toInteger} from '../util/util';
-import {Observable, Subject} from 'rxjs';
-import {
- buildMonths,
- checkDateInRange,
- checkMinBeforeMax,
- isChangedDate,
- isChangedMonth,
- isDateSelectable,
- generateSelectBoxYears,
- generateSelectBoxMonths,
- prevMonthDisabled,
- nextMonthDisabled
-} from './datepicker-tools';
-
-import {filter} from 'rxjs/operators';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-
-@Injectable()
-export class NgbDatepickerService {
- private _model$ = new Subject();
-
- private _select$ = new Subject();
-
- private _state: DatepickerViewModel = {
- disabled: false,
- displayMonths: 1,
- firstDayOfWeek: 1,
- focusVisible: false,
- months: [],
- navigation: 'select',
- outsideDays: 'visible',
- prevDisabled: false,
- nextDisabled: false,
- selectBoxes: {years: [], months: []},
- selectedDate: null
- };
-
- get model$(): Observable { return this._model$.pipe(filter(model => model.months.length > 0)); }
-
- get select$(): Observable { return this._select$.pipe(filter(date => date !== null)); }
-
- set dayTemplateData(dayTemplateData: NgbDayTemplateData) {
- if (this._state.dayTemplateData !== dayTemplateData) {
- this._nextState({dayTemplateData});
- }
- }
-
- set disabled(disabled: boolean) {
- if (this._state.disabled !== disabled) {
- this._nextState({disabled});
- }
- }
-
- set displayMonths(displayMonths: number) {
- displayMonths = toInteger(displayMonths);
- if (isInteger(displayMonths) && displayMonths > 0 && this._state.displayMonths !== displayMonths) {
- this._nextState({displayMonths});
- }
- }
-
- set firstDayOfWeek(firstDayOfWeek: number) {
- firstDayOfWeek = toInteger(firstDayOfWeek);
- if (isInteger(firstDayOfWeek) && firstDayOfWeek >= 0 && this._state.firstDayOfWeek !== firstDayOfWeek) {
- this._nextState({firstDayOfWeek});
- }
- }
-
- set focusVisible(focusVisible: boolean) {
- if (this._state.focusVisible !== focusVisible && !this._state.disabled) {
- this._nextState({focusVisible});
- }
- }
-
- set maxDate(date: NgbDate) {
- const maxDate = this.toValidDate(date, null);
- if (isChangedDate(this._state.maxDate, maxDate)) {
- this._nextState({maxDate});
- }
- }
-
- set markDisabled(markDisabled: NgbMarkDisabled) {
- if (this._state.markDisabled !== markDisabled) {
- this._nextState({markDisabled});
- }
- }
-
- set minDate(date: NgbDate) {
- const minDate = this.toValidDate(date, null);
- if (isChangedDate(this._state.minDate, minDate)) {
- this._nextState({minDate});
- }
- }
-
- set navigation(navigation: 'select' | 'arrows' | 'none') {
- if (this._state.navigation !== navigation) {
- this._nextState({navigation});
- }
- }
-
- set outsideDays(outsideDays: 'visible' | 'collapsed' | 'hidden') {
- if (this._state.outsideDays !== outsideDays) {
- this._nextState({outsideDays});
- }
- }
-
- constructor(private _calendar: NgbCalendar, private _i18n: NgbDatepickerI18n) {}
-
- focus(date: NgbDate) {
- if (!this._state.disabled && this._calendar.isValid(date) && isChangedDate(this._state.focusDate, date)) {
- this._nextState({focusDate: date});
- }
- }
-
- focusMove(period?: NgbPeriod, number?: number) {
- this.focus(this._calendar.getNext(this._state.focusDate, period, number));
- }
-
- focusSelect() {
- if (isDateSelectable(this._state.focusDate, this._state)) {
- this.select(this._state.focusDate, {emitEvent: true});
- }
- }
-
- open(date: NgbDate) {
- const firstDate = this.toValidDate(date, this._calendar.getToday());
- if (!this._state.disabled && (!this._state.firstDate || isChangedMonth(this._state.firstDate, date))) {
- this._nextState({firstDate});
- }
- }
-
- select(date: NgbDate, options: {emitEvent?: boolean} = {}) {
- const selectedDate = this.toValidDate(date, null);
- if (!this._state.disabled) {
- if (isChangedDate(this._state.selectedDate, selectedDate)) {
- this._nextState({selectedDate});
- }
-
- if (options.emitEvent && isDateSelectable(selectedDate, this._state)) {
- this._select$.next(selectedDate);
- }
- }
- }
-
- toValidDate(date: NgbDateStruct, defaultValue?: NgbDate): NgbDate {
- const ngbDate = NgbDate.from(date);
- if (defaultValue === undefined) {
- defaultValue = this._calendar.getToday();
- }
- return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;
- }
-
- private _nextState(patch: Partial) {
- const newState = this._updateState(patch);
- this._patchContexts(newState);
- this._state = newState;
- this._model$.next(this._state);
- }
-
- private _patchContexts(state: DatepickerViewModel) {
- const {months, displayMonths, selectedDate, focusDate, focusVisible, disabled, outsideDays} = state;
- state.months.forEach(month => {
- month.weeks.forEach(week => {
- week.days.forEach(day => {
-
- // patch focus flag
- if (focusDate) {
- day.context.focused = focusDate.equals(day.date) && focusVisible;
- }
-
- // calculating tabindex
- day.tabindex = !disabled && day.date.equals(focusDate) && focusDate.month === month.number ? 0 : -1;
-
- // override context disabled
- if (disabled === true) {
- day.context.disabled = true;
- }
-
- // patch selection flag
- if (selectedDate !== undefined) {
- day.context.selected = selectedDate !== null && selectedDate.equals(day.date);
- }
-
- // visibility
- if (month.number !== day.date.month) {
- day.hidden = outsideDays === 'hidden' || outsideDays === 'collapsed' ||
- (displayMonths > 1 && day.date.after(months[0].firstDate) &&
- day.date.before(months[displayMonths - 1].lastDate));
- }
- });
- });
- });
- }
-
- private _updateState(patch: Partial): DatepickerViewModel {
- // patching fields
- const state = Object.assign({}, this._state, patch);
-
- let startDate = state.firstDate;
-
- // min/max dates changed
- if ('minDate' in patch || 'maxDate' in patch) {
- checkMinBeforeMax(state.minDate, state.maxDate);
- state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
- state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
- startDate = state.focusDate;
- }
-
- // disabled
- if ('disabled' in patch) {
- state.focusVisible = false;
- }
-
- // initial rebuild via 'select()'
- if ('selectedDate' in patch && this._state.months.length === 0) {
- startDate = state.selectedDate;
- }
-
- // terminate early if only focus visibility was changed
- if ('focusVisible' in patch) {
- return state;
- }
-
- // focus date changed
- if ('focusDate' in patch) {
- state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
- startDate = state.focusDate;
-
- // nothing to rebuild if only focus changed and it is still visible
- if (state.months.length !== 0 && !state.focusDate.before(state.firstDate) &&
- !state.focusDate.after(state.lastDate)) {
- return state;
- }
- }
-
- // first date changed
- if ('firstDate' in patch) {
- state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
- startDate = state.firstDate;
- }
-
- // rebuilding months
- if (startDate) {
- const forceRebuild = 'dayTemplateData' in patch || 'firstDayOfWeek' in patch || 'markDisabled' in patch ||
- 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch || 'outsideDays' in patch;
-
- const months = buildMonths(this._calendar, startDate, state, this._i18n, forceRebuild);
-
- // updating months and boundary dates
- state.months = months;
- state.firstDate = months.length > 0 ? months[0].firstDate : undefined;
- state.lastDate = months.length > 0 ? months[months.length - 1].lastDate : undefined;
-
- // reset selected date if 'markDisabled' returns true
- if ('selectedDate' in patch && !isDateSelectable(state.selectedDate, state)) {
- state.selectedDate = null;
- }
-
- // adjusting focus after months were built
- if ('firstDate' in patch) {
- if (state.focusDate === undefined || state.focusDate.before(state.firstDate) ||
- state.focusDate.after(state.lastDate)) {
- state.focusDate = startDate;
- }
- }
-
- // adjusting months/years for the select box navigation
- const yearChanged = !this._state.firstDate || this._state.firstDate.year !== state.firstDate.year;
- const monthChanged = !this._state.firstDate || this._state.firstDate.month !== state.firstDate.month;
- if (state.navigation === 'select') {
- // years -> boundaries (min/max were changed)
- if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.years.length === 0 || yearChanged) {
- state.selectBoxes.years = generateSelectBoxYears(state.firstDate, state.minDate, state.maxDate);
- }
-
- // months -> when current year or boundaries change
- if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.months.length === 0 || yearChanged) {
- state.selectBoxes.months =
- generateSelectBoxMonths(this._calendar, state.firstDate, state.minDate, state.maxDate);
- }
- } else {
- state.selectBoxes = {years: [], months: []};
- }
-
- // updating navigation arrows -> boundaries change (min/max) or month/year changes
- if ((state.navigation === 'arrows' || state.navigation === 'select') &&
- (monthChanged || yearChanged || 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch)) {
- state.prevDisabled = state.disabled || prevMonthDisabled(this._calendar, state.firstDate, state.minDate);
- state.nextDisabled = state.disabled || nextMonthDisabled(this._calendar, state.lastDate, state.maxDate);
- }
- }
-
- return state;
- }
-}
diff --git a/backup/src/datepicker/datepicker-tools.spec.ts b/backup/src/datepicker/datepicker-tools.spec.ts
deleted file mode 100644
index 89916c5..0000000
--- a/backup/src/datepicker/datepicker-tools.spec.ts
+++ /dev/null
@@ -1,608 +0,0 @@
-import {
- buildMonth,
- buildMonths,
- checkDateInRange,
- dateComparator,
- generateSelectBoxMonths,
- getFirstViewDate,
- isChangedMonth,
- isDateSelectable,
- generateSelectBoxYears
-} from './datepicker-tools';
-import {NgbDate} from './ngb-date';
-import {NgbCalendarGregorian} from './ngb-calendar';
-import {DatepickerViewModel, NgbMarkDisabled, MonthViewModel} from './datepicker-view-model';
-import {NgbDatepickerI18nDefault} from './datepicker-i18n';
-
-describe(`datepicker-tools`, () => {
-
- const calendar = new NgbCalendarGregorian();
- const i18n = new NgbDatepickerI18nDefault('en');
-
- describe(`dateComparator()`, () => {
-
- it(`should compare valid dates`, () => {
- expect(dateComparator(new NgbDate(2017, 5, 2), new NgbDate(2017, 5, 2))).toBe(true);
-
- expect(dateComparator(new NgbDate(2017, 5, 2), new NgbDate(2017, 5, 1))).toBe(false);
- expect(dateComparator(new NgbDate(2017, 5, 2), new NgbDate(2017, 1, 2))).toBe(false);
- expect(dateComparator(new NgbDate(2017, 5, 2), new NgbDate(2001, 5, 2))).toBe(false);
- });
-
- it(`should compare invalid dates`, () => {
- expect(dateComparator(undefined, undefined)).toBe(true);
- expect(dateComparator(null, null)).toBe(true);
-
- expect(dateComparator(new NgbDate(2017, 5, 2), null)).toBe(false);
- expect(dateComparator(new NgbDate(2017, 5, 2), undefined)).toBe(false);
- expect(dateComparator(null, new NgbDate(2017, 5, 2))).toBe(false);
- expect(dateComparator(undefined, new NgbDate(2017, 5, 2))).toBe(false);
- });
- });
-
- describe(`checkDateInRange()`, () => {
-
- it(`should throw adjust date to be in between of min and max dates`, () => {
- const minDate = new NgbDate(2015, 5, 1);
- const maxDate = new NgbDate(2015, 5, 10);
-
- expect(checkDateInRange(new NgbDate(2015, 5, 5), minDate, maxDate)).toEqual(new NgbDate(2015, 5, 5));
- expect(checkDateInRange(new NgbDate(2015, 4, 5), minDate, maxDate)).toEqual(minDate);
- expect(checkDateInRange(new NgbDate(2015, 6, 5), minDate, maxDate)).toEqual(maxDate);
- });
-
- it(`should allow for undefined max and min dates`, () => {
- const minDate = new NgbDate(2015, 5, 1);
- const maxDate = new NgbDate(2015, 5, 10);
-
- expect(checkDateInRange(new NgbDate(2015, 5, 5), undefined, undefined)).toEqual(new NgbDate(2015, 5, 5));
- expect(checkDateInRange(new NgbDate(2015, 5, 5), minDate, undefined)).toEqual(new NgbDate(2015, 5, 5));
- expect(checkDateInRange(new NgbDate(2015, 5, 5), undefined, maxDate)).toEqual(new NgbDate(2015, 5, 5));
-
- expect(checkDateInRange(new NgbDate(2015, 4, 5), minDate, undefined)).toEqual(minDate);
- expect(checkDateInRange(new NgbDate(2015, 6, 5), undefined, maxDate)).toEqual(maxDate);
- });
-
- it(`should bypass invalid date values`, () => {
- expect(checkDateInRange(undefined, undefined, undefined)).toBeUndefined();
- expect(checkDateInRange(null, undefined, undefined)).toBeNull();
- expect(checkDateInRange(new NgbDate(-2, 0, 0), undefined, undefined)).toEqual(new NgbDate(-2, 0, 0));
- });
-
- it(`should not alter date object`, () => {
- const date = new NgbDate(2017, 5, 1);
- expect(checkDateInRange(date, undefined, undefined)).toBe(date);
- });
- });
-
- describe(`buildMonth()`, () => {
-
- // TODO: this should be automated somehow, ex. generate next 10 years or something
- const months = [
- {
- // MAY 2017
- date: new NgbDate(2017, 5, 5),
- lastDay: 31,
- firstWeek: {number: 18, date: new NgbDate(2017, 5, 1)},
- lastWeek: {number: 23, date: new NgbDate(2017, 6, 11)}
- },
- {
- // JUN 2017
- date: new NgbDate(2017, 6, 5),
- lastDay: 30,
- firstWeek: {number: 22, date: new NgbDate(2017, 5, 29)},
- lastWeek: {number: 27, date: new NgbDate(2017, 7, 9)}
- },
- {
- // FEB 2017
- date: new NgbDate(2017, 2, 1),
- lastDay: 28,
- firstWeek: {number: 5, date: new NgbDate(2017, 1, 30)},
- lastWeek: {number: 10, date: new NgbDate(2017, 3, 12)}
- },
- {
- // FEB 2016
- date: new NgbDate(2016, 2, 10),
- lastDay: 29,
- firstWeek: {number: 5, date: new NgbDate(2016, 2, 1)},
- lastWeek: {number: 10, date: new NgbDate(2016, 3, 13)}
- }
- ];
-
- months.forEach(refMonth => {
- it(`should build month (${refMonth.date.year} - ${refMonth.date.month}) correctly`, () => {
-
- let month = buildMonth(calendar, refMonth.date, { firstDayOfWeek: 1 } as DatepickerViewModel, i18n);
-
- expect(month).toBeTruthy();
- expect(month.year).toEqual(refMonth.date.year);
- expect(month.number).toEqual(refMonth.date.month);
- expect(month.firstDate).toEqual(new NgbDate(refMonth.date.year, refMonth.date.month, 1));
- expect(month.lastDate).toEqual(new NgbDate(refMonth.date.year, refMonth.date.month, refMonth.lastDay));
- expect(month.weekdays).toEqual([1, 2, 3, 4, 5, 6, 7]);
- expect(month.weeks.length).toBe(6);
-
- // First week, first day
- expect(month.weeks[0].number).toEqual(refMonth.firstWeek.number);
- expect(month.weeks[0].days.length).toEqual(7);
- expect(month.weeks[0].days[0].date).toEqual(refMonth.firstWeek.date);
- expect(month.weeks[0].days[0].context.disabled).toBe(false);
-
- // Last week, last day
- expect(month.weeks[5].number).toEqual(refMonth.lastWeek.number);
- expect(month.weeks[5].days.length).toEqual(7);
- expect(month.weeks[5].days[6].date).toEqual(refMonth.lastWeek.date);
- expect(month.weeks[5].days[6].context.disabled).toBe(false);
- });
- });
-
- it(`should mark dates as disabled`, () => {
- // disable the second day
- const markDisabled: NgbMarkDisabled = (date) => date.day === 2;
-
- // MAY 2017
- let month = buildMonth(
- calendar, new NgbDate(2017, 5, 5), { firstDayOfWeek: 1, markDisabled } as DatepickerViewModel, i18n);
-
- // 2 MAY - disabled
- expect(month.weeks[0].days[0].context.disabled).toBe(false);
- expect(month.weeks[0].days[1].context.disabled).toBe(true);
- expect(month.weeks[0].days[2].context.disabled).toBe(false);
- });
-
-
- it(`should call 'markDisabled' with correct arguments`, () => {
- const mock: {markDisabled: NgbMarkDisabled} = {markDisabled: () => false};
- spyOn(mock, 'markDisabled').and.returnValue(false);
-
- // MAY 2017
- let state = {
- firstDayOfWeek: 1,
- minDate: new NgbDate(2017, 5, 10),
- maxDate: new NgbDate(2017, 5, 10),
- markDisabled: mock.markDisabled
- } as DatepickerViewModel;
- buildMonth(calendar, new NgbDate(2017, 5, 5), state, i18n);
-
- // called one time, because it should be used only inside min-max range
- expect(mock.markDisabled).toHaveBeenCalledWith(new NgbDate(2017, 5, 10), {year: 2017, month: 5});
- expect(mock.markDisabled).toHaveBeenCalledTimes(1);
- });
-
- it(`should mark dates before 'minDate' as disabled and ignore 'markDisabled'`, () => {
- const markDisabled: NgbMarkDisabled = (date) => date.day === 1;
-
- // MAY 2017
- let state = { firstDayOfWeek: 1, minDate: new NgbDate(2017, 5, 3), markDisabled } as DatepickerViewModel;
- const month = buildMonth(calendar, new NgbDate(2017, 5, 5), state, i18n);
-
- // MIN = 2, so 1-2 MAY - disabled
- expect(month.weeks[0].days[0].context.disabled).toBe(true);
- expect(month.weeks[0].days[1].context.disabled).toBe(true);
- expect(month.weeks[0].days[2].context.disabled).toBe(false);
- expect(month.weeks[0].days[3].context.disabled).toBe(false);
- });
-
- it(`should mark dates after 'maxDate' as disabled and ignore 'markDisabled`, () => {
- const markDisabled: NgbMarkDisabled = (date) => date.day === 3;
-
- // MAY 2017
- let state = { firstDayOfWeek: 1, maxDate: new NgbDate(2017, 5, 2), markDisabled } as DatepickerViewModel;
- const month = buildMonth(calendar, new NgbDate(2017, 5, 5), state, i18n);
-
- // MAX = 2, so 3-4 MAY - disabled
- expect(month.weeks[0].days[0].context.disabled).toBe(false);
- expect(month.weeks[0].days[1].context.disabled).toBe(false);
- expect(month.weeks[0].days[2].context.disabled).toBe(true);
- expect(month.weeks[0].days[3].context.disabled).toBe(true);
- });
-
- it(`should rotate days of the week`, () => {
- // SUN = 7
- let month = buildMonth(calendar, new NgbDate(2017, 5, 5), { firstDayOfWeek: 7 } as DatepickerViewModel, i18n);
- expect(month.weekdays).toEqual([7, 1, 2, 3, 4, 5, 6]);
- expect(month.weeks[0].days[0].date).toEqual(new NgbDate(2017, 4, 30));
-
- // WED = 3
- month = buildMonth(calendar, new NgbDate(2017, 5, 5), { firstDayOfWeek: 3 } as DatepickerViewModel, i18n);
- expect(month.weekdays).toEqual([3, 4, 5, 6, 7, 1, 2]);
- expect(month.weeks[0].days[0].date).toEqual(new NgbDate(2017, 4, 26));
- });
- });
-
- describe(`buildMonths()`, () => {
-
- it(`should generate 'displayMonths' number of months`, () => {
- let state = { displayMonths: 1, firstDayOfWeek: 1, months: [] } as DatepickerViewModel;
- let months = buildMonths(calendar, new NgbDate(2017, 5, 5), state, i18n, false);
- expect(months.length).toBe(1);
-
- state.displayMonths = 2;
- months = buildMonths(calendar, new NgbDate(2017, 5, 5), state, i18n, false);
- expect(months.length).toBe(2);
- });
-
- const storeMonthsDataStructure = (months: MonthViewModel[]) => {
- return months.map(month => {
- const storage = {weeks: month.weeks, weekdays: month.weekdays};
- const weeks = month.weeks;
- for (let weekIndex = 0, weeksLength = weeks.length; weekIndex < weeksLength; weekIndex++) {
- const currentWeek = weeks[weekIndex];
- storage[`weeks[${weekIndex}]`] = currentWeek;
- const days = currentWeek.days;
- storage[`weeks[${weekIndex}].days`] = days;
- for (let dayIndex = 0, daysLength = days.length; dayIndex < daysLength; dayIndex++) {
- const currentDay = days[dayIndex];
- storage[`weeks[${weekIndex}].days[${dayIndex}]`] = currentDay;
- }
- }
- return storage;
- });
- };
-
- const customMatchers: jasmine.CustomMatcherFactories = {
- toHaveTheSameMonthDataStructureAs: function(util, customEqualityTesters) {
- return {
- compare(actualMonthsStorage, expectedMonthsStorage) {
- try {
- const monthsNumber = actualMonthsStorage.length;
- if (expectedMonthsStorage.length !== monthsNumber) {
- throw 'the number of months';
- }
- for (let i = 0; i < monthsNumber; i++) {
- const storage1 = actualMonthsStorage[i];
- const storage2 = expectedMonthsStorage[i];
- const keys1 = Object.keys(storage1);
- const keys2 = Object.keys(storage2);
- if (!util.equals(keys2, keys1, customEqualityTesters)) {
- throw `the set of keys in months[${i}]: ${keys1} != ${keys2}`;
- }
- for (const key of keys1) {
- if (storage1[key] !== storage2[key]) {
- throw `months[${i}].${key}`;
- }
- }
- }
- return {
- pass: true,
- message: 'Expected different months data structures, but the same data structure was found.'
- };
- } catch (e) {
- return {
- pass: false,
- message: typeof e === 'string' ?
- `Expected the same months data structure, but a difference was found in ${e}` :
- `${e}`
- };
- }
- }
- };
- }
- };
-
- beforeEach(function() { jasmine.addMatchers(customMatchers); });
-
- it(`should reuse the same data structure (force = false)`, () => {
- let state = { displayMonths: 1, firstDayOfWeek: 1, months: [] } as DatepickerViewModel;
- let months = buildMonths(calendar, new NgbDate(2017, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(1);
- let monthsStructure = storeMonthsDataStructure(months);
-
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(1);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- state.displayMonths = 2;
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- monthsStructure.push(...storeMonthsDataStructure([months[1]]));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // next month
- months = buildMonths(calendar, new NgbDate(2018, 6, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- // the structures should be swapped:
- monthsStructure.push(monthsStructure.shift());
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // previous month
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- // the structures should be swapped (again):
- monthsStructure.push(monthsStructure.shift());
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- state.displayMonths = 5;
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- monthsStructure.push(...storeMonthsDataStructure(months.slice(2)));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // go to two months after, the 3 last months are reused as is
- months = buildMonths(calendar, new NgbDate(2018, 7, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- monthsStructure.unshift(...monthsStructure.splice(2, 3));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // go to two months before, the 3 first months are reused as is
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- monthsStructure.push(...monthsStructure.splice(0, 3));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // completely change the dates, nothing is shifted in monthsStructure
- months = buildMonths(calendar, new NgbDate(2018, 10, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // keep 2 months
- state.displayMonths = 2;
- months = buildMonths(calendar, new NgbDate(2018, 11, 5), state, i18n, false);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- monthsStructure = monthsStructure.slice(1, 3);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
- });
-
- it(`should reuse the same data structure (force = true)`, () => {
- let state = { displayMonths: 1, firstDayOfWeek: 1, months: [] } as DatepickerViewModel;
- let months = buildMonths(calendar, new NgbDate(2017, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(1);
- let monthsStructure = storeMonthsDataStructure(months);
-
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(1);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- state.displayMonths = 2;
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- monthsStructure.push(...storeMonthsDataStructure([months[1]]));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // next month
- months = buildMonths(calendar, new NgbDate(2018, 6, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // previous month
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- state.displayMonths = 5;
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- monthsStructure.push(...storeMonthsDataStructure(months.slice(2)));
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // go to two months after
- months = buildMonths(calendar, new NgbDate(2018, 7, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // go to two months before
- months = buildMonths(calendar, new NgbDate(2018, 5, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // completely change the dates
- months = buildMonths(calendar, new NgbDate(2018, 10, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(5);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
-
- // keep 2 months
- state.displayMonths = 2;
- months = buildMonths(calendar, new NgbDate(2018, 11, 5), state, i18n, true);
- expect(months).toBe(state.months);
- expect(months.length).toBe(2);
- monthsStructure = monthsStructure.slice(0, 2);
- expect(storeMonthsDataStructure(months))['toHaveTheSameMonthDataStructureAs'](monthsStructure);
- });
- });
-
- describe(`getFirstViewDate()`, () => {
-
- const months = [
- // Mon
- {start: 1, date: new NgbDate(2017, 1, 10), first: new NgbDate(2016, 12, 26)},
- {start: 1, date: new NgbDate(2017, 2, 10), first: new NgbDate(2017, 1, 30)},
- {start: 1, date: new NgbDate(2017, 3, 10), first: new NgbDate(2017, 2, 27)},
- {start: 1, date: new NgbDate(2017, 4, 10), first: new NgbDate(2017, 3, 27)},
- {start: 1, date: new NgbDate(2017, 5, 10), first: new NgbDate(2017, 5, 1)},
- {start: 1, date: new NgbDate(2017, 6, 10), first: new NgbDate(2017, 5, 29)},
- {start: 1, date: new NgbDate(2017, 7, 10), first: new NgbDate(2017, 6, 26)},
- {start: 1, date: new NgbDate(2017, 8, 10), first: new NgbDate(2017, 7, 31)},
- {start: 1, date: new NgbDate(2017, 9, 10), first: new NgbDate(2017, 8, 28)},
- {start: 1, date: new NgbDate(2017, 10, 10), first: new NgbDate(2017, 9, 25)},
- {start: 1, date: new NgbDate(2017, 11, 10), first: new NgbDate(2017, 10, 30)},
- {start: 1, date: new NgbDate(2017, 12, 10), first: new NgbDate(2017, 11, 27)},
- // Sun
- {start: 7, date: new NgbDate(2017, 1, 10), first: new NgbDate(2017, 1, 1)},
- {start: 7, date: new NgbDate(2017, 2, 10), first: new NgbDate(2017, 1, 29)},
- {start: 7, date: new NgbDate(2017, 3, 10), first: new NgbDate(2017, 2, 26)},
- {start: 7, date: new NgbDate(2017, 4, 10), first: new NgbDate(2017, 3, 26)},
- {start: 7, date: new NgbDate(2017, 5, 10), first: new NgbDate(2017, 4, 30)},
- {start: 7, date: new NgbDate(2017, 6, 10), first: new NgbDate(2017, 5, 28)},
- {start: 7, date: new NgbDate(2017, 7, 10), first: new NgbDate(2017, 6, 25)},
- {start: 7, date: new NgbDate(2017, 8, 10), first: new NgbDate(2017, 7, 30)},
- {start: 7, date: new NgbDate(2017, 9, 10), first: new NgbDate(2017, 8, 27)},
- {start: 7, date: new NgbDate(2017, 10, 10), first: new NgbDate(2017, 10, 1)},
- {start: 7, date: new NgbDate(2017, 11, 10), first: new NgbDate(2017, 10, 29)},
- {start: 7, date: new NgbDate(2017, 12, 10), first: new NgbDate(2017, 11, 26)},
- // Wed
- {start: 3, date: new NgbDate(2017, 1, 10), first: new NgbDate(2016, 12, 28)},
- {start: 3, date: new NgbDate(2017, 2, 10), first: new NgbDate(2017, 2, 1)},
- {start: 3, date: new NgbDate(2017, 3, 10), first: new NgbDate(2017, 3, 1)},
- {start: 3, date: new NgbDate(2017, 4, 10), first: new NgbDate(2017, 3, 29)},
- {start: 3, date: new NgbDate(2017, 5, 10), first: new NgbDate(2017, 4, 26)},
- {start: 3, date: new NgbDate(2017, 6, 10), first: new NgbDate(2017, 5, 31)},
- {start: 3, date: new NgbDate(2017, 7, 10), first: new NgbDate(2017, 6, 28)},
- {start: 3, date: new NgbDate(2017, 8, 10), first: new NgbDate(2017, 7, 26)},
- {start: 3, date: new NgbDate(2017, 9, 10), first: new NgbDate(2017, 8, 30)},
- {start: 3, date: new NgbDate(2017, 10, 10), first: new NgbDate(2017, 9, 27)},
- {start: 3, date: new NgbDate(2017, 11, 10), first: new NgbDate(2017, 11, 1)},
- {start: 3, date: new NgbDate(2017, 12, 10), first: new NgbDate(2017, 11, 29)}
- ];
-
- months.forEach(month => {
- it(`should return the correct first view date`,
- () => { expect(getFirstViewDate(calendar, month.date, month.start)).toEqual(month.first); });
- });
- });
-
- describe(`isDateSelectable()`, () => {
-
- // disabling 15th of any month
- const markDisabled: NgbMarkDisabled = (date, month) => date.day === 15;
-
- it(`should return false if date is invalid`, () => {
- let state = { disabled: false } as DatepickerViewModel;
- expect(isDateSelectable(null, state)).toBeFalsy();
- expect(isDateSelectable(undefined, state)).toBeFalsy();
- });
-
- it(`should return false if datepicker is disabled`, () => {
- let state = { disabled: true } as DatepickerViewModel;
- expect(isDateSelectable(new NgbDate(2016, 11, 10), state)).toBeFalsy();
- expect(isDateSelectable(new NgbDate(2017, 11, 10), state)).toBeFalsy();
- expect(isDateSelectable(new NgbDate(2018, 11, 10), state)).toBeFalsy();
- });
-
- it(`should take into account markDisabled values`, () => {
- let state = { disabled: false, markDisabled } as DatepickerViewModel;
- expect(isDateSelectable(new NgbDate(2016, 11, 15), state)).toBeFalsy();
- expect(isDateSelectable(new NgbDate(2017, 11, 15), state)).toBeFalsy();
- expect(isDateSelectable(new NgbDate(2018, 11, 15), state)).toBeFalsy();
- });
-
- it(`should take into account minDate values`, () => {
- let state = { disabled: false, minDate: new NgbDate(2018, 11, 10) } as DatepickerViewModel;
- expect(isDateSelectable(new NgbDate(2017, 11, 10), state)).toBeFalsy();
- });
-
- it(`should take into account maxDate values`, () => {
- let state = { disabled: false, maxDate: new NgbDate(2016, 11, 10) } as DatepickerViewModel;
- expect(isDateSelectable(new NgbDate(2017, 11, 10), state)).toBeFalsy();
- });
-
- it(`should return true for normal values`, () => {
- let state = { disabled: false } as DatepickerViewModel;
- expect(isDateSelectable(new NgbDate(2016, 11, 10), state)).toBeTruthy();
- expect(isDateSelectable(new NgbDate(2017, 11, 10), state)).toBeTruthy();
- expect(isDateSelectable(new NgbDate(2018, 11, 10), state)).toBeTruthy();
- });
- });
-
- describe(`generateSelectBoxMonths`, () => {
-
- const test = (minDate, date, maxDate, result) => {
- expect(generateSelectBoxMonths(calendar, date, minDate, maxDate)).toEqual(result);
- };
-
- it(`should handle edge cases`, () => {
- test(new NgbDate(2018, 6, 1), null, new NgbDate(2018, 6, 10), []);
- test(null, null, null, []);
- });
-
- it(`should generate months correctly`, () => {
- // clang-format off
- // different years
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 1, 1), new NgbDate(2019, 1, 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(null, new NgbDate(2018, 6, 10), null, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(null, new NgbDate(2018, 1, 1), new NgbDate(2019, 1, 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 1, 1), null, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
-
- // same 'min year'
- test(new NgbDate(2018, 1, 1), new NgbDate(2018, 6, 10), new NgbDate(2020, 1, 2), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2018, 6, 1), new NgbDate(2018, 6, 10), new NgbDate(2020, 1, 2), [6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2018, 6, 1), new NgbDate(2018, 6, 10), null, [6, 7, 8, 9, 10, 11, 12]);
-
- // same 'max' year
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 12, 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 6, 10), [1, 2, 3, 4, 5, 6]);
- test(null, new NgbDate(2018, 6, 10), new NgbDate(2018, 6, 10), [1, 2, 3, 4, 5, 6]);
-
- // same 'min' and 'max years'
- test(new NgbDate(2018, 1, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 12, 1), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2018, 3, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 12, 1), [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(new NgbDate(2018, 3, 1), new NgbDate(2018, 6, 10), null, [3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- test(null, new NgbDate(2018, 6, 10), new NgbDate(2018, 8, 1), [1, 2, 3, 4, 5, 6, 7, 8]);
- test(new NgbDate(2018, 3, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 8, 1), [3, 4, 5, 6, 7, 8] );
- test(new NgbDate(2018, 6, 1), new NgbDate(2018, 6, 10), new NgbDate(2018, 6, 10), [6]);
- // clang-format on
- });
- });
-
- describe(`generateSelectBoxYears`, () => {
-
- const test =
- (minDate, date, maxDate, result) => { expect(generateSelectBoxYears(date, minDate, maxDate)).toEqual(result); };
- const range = (start, end) => Array.from({length: end - start + 1}, (e, i) => start + i);
-
- it(`should handle edge cases`, () => {
- test(new NgbDate(2018, 6, 1), null, new NgbDate(2018, 6, 10), []);
- test(null, null, null, []);
- });
-
- it(`should generate years correctly`, () => {
- // both 'min' and 'max' are set
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 1, 1), new NgbDate(2019, 1, 1), range(2017, 2019));
- test(new NgbDate(2000, 1, 1), new NgbDate(2018, 1, 1), new NgbDate(3000, 1, 1), range(2000, 3000));
- test(new NgbDate(2018, 1, 1), new NgbDate(2018, 1, 1), new NgbDate(2018, 1, 1), [2018]);
-
- // 'min' is not set
- test(null, new NgbDate(2018, 1, 1), new NgbDate(2019, 1, 1), range(2008, 2019));
- test(null, new NgbDate(2018, 1, 1), new NgbDate(3000, 1, 1), range(2008, 3000));
- test(null, new NgbDate(2018, 1, 1), new NgbDate(2018, 1, 1), range(2008, 2018));
-
- // 'max' is not set
- test(new NgbDate(2017, 1, 1), new NgbDate(2018, 1, 1), null, range(2017, 2028));
- test(new NgbDate(2000, 1, 1), new NgbDate(2018, 1, 1), null, range(2000, 2028));
- test(new NgbDate(2018, 1, 1), new NgbDate(2018, 1, 1), null, range(2018, 2028));
-
- // both are not set
- test(null, new NgbDate(2018, 1, 1), null, range(2008, 2028));
- test(null, new NgbDate(2000, 1, 1), null, range(1990, 2010));
- });
- });
-
- describe(`isChangedMonth()`, () => {
-
- it(`should compare valid dates`, () => {
- expect(isChangedMonth(new NgbDate(2017, 1, 1), new NgbDate(2017, 1, 1))).toBe(false);
- expect(isChangedMonth(new NgbDate(2017, 1, 1), new NgbDate(2017, 1, 10))).toBe(false);
- expect(isChangedMonth(new NgbDate(2017, 1, 1), new NgbDate(2017, 2, 1))).toBe(true);
- expect(isChangedMonth(new NgbDate(2017, 1, 1), new NgbDate(2018, 1, 1))).toBe(true);
- expect(isChangedMonth(new NgbDate(2017, 1, 1), new NgbDate(2018, 2, 1))).toBe(true);
- });
-
- it(`should compare invalid dates`, () => {
- expect(isChangedMonth(undefined, undefined)).toBe(false);
- expect(isChangedMonth(null, null)).toBe(false);
-
- expect(isChangedMonth(new NgbDate(2017, 5, 2), null)).toBe(true);
- expect(isChangedMonth(new NgbDate(2017, 5, 2), undefined)).toBe(true);
- expect(isChangedMonth(null, new NgbDate(2017, 5, 2))).toBe(true);
- expect(isChangedMonth(undefined, new NgbDate(2017, 5, 2))).toBe(true);
- });
- });
-});
diff --git a/backup/src/datepicker/datepicker-tools.ts b/backup/src/datepicker/datepicker-tools.ts
deleted file mode 100644
index 29eb5d0..0000000
--- a/backup/src/datepicker/datepicker-tools.ts
+++ /dev/null
@@ -1,215 +0,0 @@
-import {NgbDate} from './ngb-date';
-import {DatepickerViewModel, DayViewModel, MonthViewModel} from './datepicker-view-model';
-import {NgbCalendar} from './ngb-calendar';
-import {isDefined} from '../util/util';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-
-export function isChangedDate(prev: NgbDate, next: NgbDate) {
- return !dateComparator(prev, next);
-}
-
-export function isChangedMonth(prev: NgbDate, next: NgbDate) {
- return !prev && !next ? false : !prev || !next ? true : prev.year !== next.year || prev.month !== next.month;
-}
-
-export function dateComparator(prev: NgbDate, next: NgbDate) {
- return (!prev && !next) || (!!prev && !!next && prev.equals(next));
-}
-
-export function checkMinBeforeMax(minDate: NgbDate, maxDate: NgbDate) {
- if (maxDate && minDate && maxDate.before(minDate)) {
- throw new Error(`'maxDate' ${maxDate} should be greater than 'minDate' ${minDate}`);
- }
-}
-
-export function checkDateInRange(date: NgbDate, minDate: NgbDate, maxDate: NgbDate): NgbDate {
- if (date && minDate && date.before(minDate)) {
- return minDate;
- }
- if (date && maxDate && date.after(maxDate)) {
- return maxDate;
- }
-
- return date;
-}
-
-export function isDateSelectable(date: NgbDate, state: DatepickerViewModel) {
- const {minDate, maxDate, disabled, markDisabled} = state;
- // clang-format off
- return !(
- !isDefined(date) ||
- disabled ||
- (markDisabled && markDisabled(date, {year: date.year, month: date.month})) ||
- (minDate && date.before(minDate)) ||
- (maxDate && date.after(maxDate))
- );
- // clang-format on
-}
-
-export function generateSelectBoxMonths(calendar: NgbCalendar, date: NgbDate, minDate: NgbDate, maxDate: NgbDate) {
- if (!date) {
- return [];
- }
-
- let months = calendar.getMonths(date.year);
-
- if (minDate && date.year === minDate.year) {
- const index = months.findIndex(month => month === minDate.month);
- months = months.slice(index);
- }
-
- if (maxDate && date.year === maxDate.year) {
- const index = months.findIndex(month => month === maxDate.month);
- months = months.slice(0, index + 1);
- }
-
- return months;
-}
-
-export function generateSelectBoxYears(date: NgbDate, minDate: NgbDate, maxDate: NgbDate) {
- if (!date) {
- return [];
- }
-
- const start = minDate && minDate.year || date.year - 10;
- const end = maxDate && maxDate.year || date.year + 10;
-
- return Array.from({length: end - start + 1}, (e, i) => start + i);
-}
-
-export function nextMonthDisabled(calendar: NgbCalendar, date: NgbDate, maxDate: NgbDate) {
- return maxDate && calendar.getNext(date, 'm').after(maxDate);
-}
-
-export function prevMonthDisabled(calendar: NgbCalendar, date: NgbDate, minDate: NgbDate) {
- const prevDate = calendar.getPrev(date, 'm');
- return minDate && (prevDate.year === minDate.year && prevDate.month < minDate.month ||
- prevDate.year < minDate.year && minDate.month === 1);
-}
-
-export function buildMonths(
- calendar: NgbCalendar, date: NgbDate, state: DatepickerViewModel, i18n: NgbDatepickerI18n,
- force: boolean): MonthViewModel[] {
- const {displayMonths, months} = state;
- // move old months to a temporary array
- const monthsToReuse = months.splice(0, months.length);
-
- // generate new first dates, nullify or reuse months
- const firstDates = Array.from({length: displayMonths}, (_, i) => {
- const firstDate = calendar.getNext(date, 'm', i);
- months[i] = null;
-
- if (!force) {
- const reusedIndex = monthsToReuse.findIndex(month => month.firstDate.equals(firstDate));
- // move reused month back to months
- if (reusedIndex !== -1) {
- months[i] = monthsToReuse.splice(reusedIndex, 1)[0];
- }
- }
-
- return firstDate;
- });
-
- // rebuild nullified months
- firstDates.forEach((firstDate, i) => {
- if (months[i] === null) {
- months[i] = buildMonth(calendar, firstDate, state, i18n, monthsToReuse.shift() || {} as MonthViewModel);
- }
- });
-
- return months;
-}
-
-export function buildMonth(
- calendar: NgbCalendar, date: NgbDate, state: DatepickerViewModel, i18n: NgbDatepickerI18n,
- month: MonthViewModel = {} as MonthViewModel): MonthViewModel {
- const {dayTemplateData, minDate, maxDate, firstDayOfWeek, markDisabled, outsideDays} = state;
- const calendarToday = calendar.getToday();
-
- month.firstDate = null;
- month.lastDate = null;
- month.number = date.month;
- month.year = date.year;
- month.weeks = month.weeks || [];
- month.weekdays = month.weekdays || [];
-
- date = getFirstViewDate(calendar, date, firstDayOfWeek);
-
- // month has weeks
- for (let week = 0; week < calendar.getWeeksPerMonth(); week++) {
- let weekObject = month.weeks[week];
- if (!weekObject) {
- weekObject = month.weeks[week] = {number: 0, days: [], collapsed: true};
- }
- const days = weekObject.days;
-
- // week has days
- for (let day = 0; day < calendar.getDaysPerWeek(); day++) {
- if (week === 0) {
- month.weekdays[day] = calendar.getWeekday(date);
- }
-
- const newDate = new NgbDate(date.year, date.month, date.day);
- const nextDate = calendar.getNext(newDate);
-
- const ariaLabel = i18n.getDayAriaLabel(newDate);
-
- // marking date as disabled
- let disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));
- if (!disabled && markDisabled) {
- disabled = markDisabled(newDate, {month: month.number, year: month.year});
- }
-
- // today
- let today = newDate.equals(calendarToday);
-
- // adding user-provided data to the context
- let contextUserData =
- dayTemplateData ? dayTemplateData(newDate, {month: month.number, year: month.year}) : undefined;
-
- // saving first date of the month
- if (month.firstDate === null && newDate.month === month.number) {
- month.firstDate = newDate;
- }
-
- // saving last date of the month
- if (newDate.month === month.number && nextDate.month !== month.number) {
- month.lastDate = newDate;
- }
-
- let dayObject = days[day];
- if (!dayObject) {
- dayObject = days[day] = {} as DayViewModel;
- }
- dayObject.date = newDate;
- dayObject.context = Object.assign(dayObject.context || {}, {
- $implicit: newDate,
- date: newDate,
- data: contextUserData,
- currentMonth: month.number, disabled,
- focused: false,
- selected: false, today
- });
- dayObject.tabindex = -1;
- dayObject.ariaLabel = ariaLabel;
- dayObject.hidden = false;
-
- date = nextDate;
- }
-
- weekObject.number = calendar.getWeekNumber(days.map(day => day.date), firstDayOfWeek);
-
- // marking week as collapsed
- weekObject.collapsed = outsideDays === 'collapsed' && days[0].date.month !== month.number &&
- days[days.length - 1].date.month !== month.number;
- }
-
- return month;
-}
-
-export function getFirstViewDate(calendar: NgbCalendar, date: NgbDate, firstDayOfWeek: number): NgbDate {
- const daysPerWeek = calendar.getDaysPerWeek();
- const firstMonthDate = new NgbDate(date.year, date.month, 1);
- const dayOfWeek = calendar.getWeekday(firstMonthDate) % daysPerWeek;
- return calendar.getPrev(firstMonthDate, 'd', (daysPerWeek + dayOfWeek - firstDayOfWeek) % daysPerWeek);
-}
diff --git a/backup/src/datepicker/datepicker-view-model.ts b/backup/src/datepicker/datepicker-view-model.ts
deleted file mode 100644
index 17c2b66..0000000
--- a/backup/src/datepicker/datepicker-view-model.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-import {NgbDate} from './ngb-date';
-import {NgbDateStruct} from './ngb-date-struct';
-import {DayTemplateContext} from './datepicker-day-template-context';
-
-export type NgbMarkDisabled = (date: NgbDateStruct, current: {year: number, month: number}) => boolean;
-export type NgbDayTemplateData = (date: NgbDateStruct, current: {year: number, month: number}) => any;
-
-export type DayViewModel = {
- date: NgbDate,
- context: DayTemplateContext,
- tabindex: number,
- ariaLabel: string,
- hidden: boolean
-};
-
-export type WeekViewModel = {
- number: number,
- days: DayViewModel[],
- collapsed: boolean
-};
-
-export type MonthViewModel = {
- firstDate: NgbDate,
- lastDate: NgbDate,
- number: number,
- year: number,
- weeks: WeekViewModel[],
- weekdays: number[]
-};
-
-// clang-format off
-export type DatepickerViewModel = {
- dayTemplateData?: NgbDayTemplateData,
- disabled: boolean,
- displayMonths: number,
- firstDate?: NgbDate,
- firstDayOfWeek: number,
- focusDate?: NgbDate,
- focusVisible: boolean,
- lastDate?: NgbDate,
- markDisabled?: NgbMarkDisabled,
- maxDate?: NgbDate,
- minDate?: NgbDate,
- months: MonthViewModel[],
- navigation: 'select' | 'arrows' | 'none',
- outsideDays: 'visible' | 'collapsed' | 'hidden',
- prevDisabled: boolean,
- nextDisabled: boolean,
- selectBoxes: {
- years: number[],
- months: number[]
- },
- selectedDate: NgbDate
-};
-// clang-format on
-
-export enum NavigationEvent {
- PREV,
- NEXT
-}
diff --git a/backup/src/datepicker/datepicker.module.ts b/backup/src/datepicker/datepicker.module.ts
deleted file mode 100644
index a4455b2..0000000
--- a/backup/src/datepicker/datepicker.module.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-import {FormsModule} from '@angular/forms';
-import {NgbDatepicker} from './datepicker';
-import {NgbDatepickerMonthView} from './datepicker-month-view';
-import {NgbDatepickerNavigation} from './datepicker-navigation';
-import {NgbInputDatepicker} from './datepicker-input';
-import {NgbDatepickerDayView} from './datepicker-day-view';
-import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
-
-export {NgbDatepicker, NgbDatepickerNavigateEvent} from './datepicker';
-export {NgbInputDatepicker} from './datepicker-input';
-export {NgbCalendar, NgbPeriod, NgbCalendarGregorian} from './ngb-calendar';
-export {NgbCalendarIslamicCivil} from './hijri/ngb-calendar-islamic-civil';
-export {NgbCalendarIslamicUmalqura} from './hijri/ngb-calendar-islamic-umalqura';
-export {NgbCalendarPersian} from './jalali/ngb-calendar-persian';
-export {NgbCalendarHebrew} from './hebrew/ngb-calendar-hebrew';
-export {NgbDatepickerI18nHebrew} from './hebrew/datepicker-i18n-hebrew';
-export {NgbDatepickerMonthView} from './datepicker-month-view';
-export {NgbDatepickerDayView} from './datepicker-day-view';
-export {NgbDatepickerNavigation} from './datepicker-navigation';
-export {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
-export {NgbDatepickerConfig} from './datepicker-config';
-export {NgbDatepickerI18n} from './datepicker-i18n';
-export {NgbDateStruct} from './ngb-date-struct';
-export {NgbDate} from './ngb-date';
-export {NgbDateAdapter} from './adapters/ngb-date-adapter';
-export {NgbDateNativeAdapter} from './adapters/ngb-date-native-adapter';
-export {NgbDateNativeUTCAdapter} from './adapters/ngb-date-native-utc-adapter';
-export {NgbDateParserFormatter} from './ngb-date-parser-formatter';
-
-@NgModule({
- declarations: [
- NgbDatepicker, NgbDatepickerMonthView, NgbDatepickerNavigation, NgbDatepickerNavigationSelect, NgbDatepickerDayView,
- NgbInputDatepicker
- ],
- exports: [NgbDatepicker, NgbInputDatepicker],
- imports: [CommonModule, FormsModule],
- entryComponents: [NgbDatepicker]
-})
-export class NgbDatepickerModule {
-}
diff --git a/backup/src/datepicker/datepicker.scss b/backup/src/datepicker/datepicker.scss
deleted file mode 100644
index eecef69..0000000
--- a/backup/src/datepicker/datepicker.scss
+++ /dev/null
@@ -1,60 +0,0 @@
-ngb-datepicker {
- border: 1px solid #dfdfdf;
- border-radius: .25rem;
- display: inline-block;
-
- &-month-view {
- pointer-events: auto;
- }
-
- &.dropdown-menu {
- padding: 0;
- }
-}
-
-.ngb-dp {
- &-body {
- z-index: 1050;
- }
-
- &-header {
- border-bottom: 0;
- border-radius: .25rem .25rem 0 0;
- padding-top: .25rem;
- background-color: #f8f9fa;
- }
-
- &-months {
- display: flex;
- }
-
- &-month {
- pointer-events: none;
-
- &-name {
- font-size: larger;
- height: 2rem;
- line-height: 2rem;
- text-align: center;
- background-color: #f8f9fa;
- }
-
- & + & {
- .ngb-dp-month-name, .ngb-dp-week {
- padding-left: 1rem;
- }
- }
-
- &:last-child .ngb-dp-week {
- padding-right: .25rem;
- }
-
- &:first-child .ngb-dp-week {
- padding-left: .25rem;
- }
-
- .ngb-dp-week:last-child {
- padding-bottom: .25rem;
- }
- }
-}
diff --git a/backup/src/datepicker/datepicker.spec.ts b/backup/src/datepicker/datepicker.spec.ts
deleted file mode 100644
index c6e36ba..0000000
--- a/backup/src/datepicker/datepicker.spec.ts
+++ /dev/null
@@ -1,1217 +0,0 @@
-import {TestBed, ComponentFixture, async, inject, fakeAsync, tick} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-import {getMonthSelect, getYearSelect, getNavigationLinks} from '../test/datepicker/common';
-
-import {Component, TemplateRef, DebugElement} from '@angular/core';
-import {By} from '@angular/platform-browser';
-import {FormsModule, ReactiveFormsModule, FormGroup, FormControl, Validators} from '@angular/forms';
-
-import {NgbDatepickerModule, NgbDatepickerNavigateEvent} from './datepicker.module';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerConfig} from './datepicker-config';
-import {NgbDatepicker} from './datepicker';
-import {DayTemplateContext} from './datepicker-day-template-context';
-import {NgbDateStruct} from './ngb-date-struct';
-import {NgbDatepickerMonthView} from './datepicker-month-view';
-import {NgbDatepickerDayView} from './datepicker-day-view';
-import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
-import {NgbDatepickerNavigation} from './datepicker-navigation';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getDates(element: HTMLElement): HTMLElement[] {
- return Array.from(element.querySelectorAll('.ngb-dp-day'));
-}
-
-function getDay(element: HTMLElement, index: number): HTMLElement {
- return getDates(element)[index].querySelector('div') as HTMLElement;
-}
-
-function getDatepicker(element: HTMLElement): HTMLElement {
- return element.querySelector('ngb-datepicker') as HTMLElement;
-}
-
-function getFocusableDays(element: DebugElement): DebugElement[] {
- return Array.from(element.queryAll(By.css('div.ngb-dp-day[tabindex="0"]')));
-}
-
-function getSelectedDays(element: DebugElement): DebugElement[] {
- return Array.from(element.queryAll(By.css('div.ngb-dp-day > div.bg-primary')));
-}
-
-function focusDay() {
- const element = document.querySelector('div.ngb-dp-day[tabindex="0"]') as HTMLElement;
- const evt = document.createEvent('Event');
- evt.initEvent('focusin', true, false);
- element.dispatchEvent(evt);
- element.focus();
-}
-
-function triggerKeyDown(element: DebugElement, keyCode: number, shiftKey = false) {
- let event = {
- which: keyCode,
- shiftKey: shiftKey,
- defaultPrevented: false,
- propagationStopped: false,
- stopPropagation: function() { this.propagationStopped = true; },
- preventDefault: function() { this.defaultPrevented = true; }
- };
- expect(document.activeElement.classList.contains('ngb-dp-day'))
- .toBeTruthy('You must focus day before triggering key events');
- element.triggerEventHandler('keydown', event);
- return event;
-}
-
-function getMonthContainer(datepicker: DebugElement) {
- return datepicker.query(By.css('div.ngb-dp-months'));
-}
-
-function expectSelectedDate(element: DebugElement, selectedDate: NgbDate) {
- // checking we have 1 day with .selected class
- const days = getSelectedDays(element);
-
- if (selectedDate) {
- expect(days.length).toBe(1);
-
- // checking it corresponds to our date
- const day = days[0];
- const dayView = day.parent.query(By.directive(NgbDatepickerDayView)).componentInstance as NgbDatepickerDayView;
- expect(NgbDate.from(dayView.date)).toEqual(selectedDate);
- } else {
- expect(days.length).toBe(0);
- }
-}
-
-function expectFocusedDate(element: DebugElement, focusableDate: NgbDate, isFocused = true) {
- // checking we have 1 day with tabIndex 0
- const days = getFocusableDays(element);
- expect(days.length).toBe(1);
-
- const day = days[0];
-
- // checking it corresponds to our date
- const dayView = day.query(By.directive(NgbDatepickerDayView)).componentInstance as NgbDatepickerDayView;
- expect(NgbDate.from(dayView.date)).toEqual(focusableDate);
-
- // checking the active class
- // Unable to test it because of unknown failure (works when tested manually)
- // expect(day.queryAll(By.css('div.active')).length).toEqual(1, `The day must have a single element with the active
- // class`);
-
- // checking it is focused by the browser
- if (isFocused) {
- expect(document.activeElement).toBe(day.nativeElement, `Date HTML element for ${focusableDate} is not focused`);
- } else {
- expect(document.activeElement)
- .not.toBe(day.nativeElement, `Date HTML element for ${focusableDate} must not be focused`);
- }
-}
-
-
-function expectSameValues(datepicker: NgbDatepicker, config: NgbDatepickerConfig) {
- expect(datepicker.dayTemplate).toBe(config.dayTemplate);
- expect(datepicker.dayTemplateData).toBe(config.dayTemplateData);
- expect(datepicker.displayMonths).toBe(config.displayMonths);
- expect(datepicker.firstDayOfWeek).toBe(config.firstDayOfWeek);
- expect(datepicker.footerTemplate).toBe(config.footerTemplate);
- expect(datepicker.markDisabled).toBe(config.markDisabled);
- expect(datepicker.minDate).toEqual(config.minDate);
- expect(datepicker.maxDate).toEqual(config.maxDate);
- expect(datepicker.navigation).toBe(config.navigation);
- expect(datepicker.outsideDays).toBe(config.outsideDays);
- expect(datepicker.showWeekdays).toBe(config.showWeekdays);
- expect(datepicker.showWeekNumbers).toBe(config.showWeekNumbers);
- expect(datepicker.startDate).toEqual(config.startDate);
-}
-
-function customizeConfig(config: NgbDatepickerConfig) {
- config.dayTemplate = {} as TemplateRef;
- config.dayTemplateData = (date, current) => 42;
- config.firstDayOfWeek = 2;
- config.footerTemplate = {} as TemplateRef;
- config.markDisabled = (date, current) => false;
- config.minDate = {year: 2000, month: 1, day: 1};
- config.maxDate = {year: 2030, month: 12, day: 31};
- config.navigation = 'none';
- config.outsideDays = 'collapsed';
- config.showWeekdays = false;
- config.showWeekNumbers = true;
- config.startDate = {year: 2015, month: 1};
-}
-
-describe('ngb-datepicker', () => {
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {declarations: [TestComponent], imports: [NgbDatepickerModule, FormsModule, ReactiveFormsModule]});
- });
-
- it('should initialize inputs with provided config', () => {
- const defaultConfig = new NgbDatepickerConfig();
- const datepicker = TestBed.createComponent(NgbDatepicker).componentInstance;
- expectSameValues(datepicker, defaultConfig);
- });
-
- it('should display current month if no date provided', () => {
- const fixture = createTestComponent(` `);
-
- const today = new Date();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(`${today.getMonth() + 1}`);
- expect(getYearSelect(fixture.nativeElement).value).toBe(`${today.getFullYear()}`);
- });
-
- it('should throw if max date is before min date', () => {
- expect(() => {
- createTestComponent(' ');
- }).toThrowError();
- });
-
- it('should handle incorrect startDate values', () => {
- const fixture = createTestComponent(` `);
- const today = new Date();
- const currentMonth = `${today.getMonth() + 1}`;
- const currentYear = `${today.getFullYear()}`;
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.date = null;
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(currentMonth);
- expect(getYearSelect(fixture.nativeElement).value).toBe(currentYear);
-
- fixture.componentInstance.date = undefined;
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(currentMonth);
- expect(getYearSelect(fixture.nativeElement).value).toBe(currentYear);
-
- fixture.componentInstance.date = {};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(currentMonth);
- expect(getYearSelect(fixture.nativeElement).value).toBe(currentYear);
-
- fixture.componentInstance.date = new Date();
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(currentMonth);
- expect(getYearSelect(fixture.nativeElement).value).toBe(currentYear);
-
- fixture.componentInstance.date = new NgbDate(3000000, 1, 1);
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(currentMonth);
- expect(getYearSelect(fixture.nativeElement).value).toBe(currentYear);
- });
-
- it(`should allow navigation work when startDate value changes`, () => {
- const fixture = createTestComponent(` `);
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- const navigation = getNavigationLinks(fixture.nativeElement);
-
- // JUL 2016
- navigation[0].click();
- fixture.detectChanges();
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('7');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
- });
-
- it('should allow infinite navigation when min/max dates are not set', () => {
- const fixture = createTestComponent(` `);
-
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.date = {year: 1066, month: 2};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('2');
- expect(getYearSelect(fixture.nativeElement).value).toBe('1066');
-
- fixture.componentInstance.date = {year: 3066, month: 5};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('5');
- expect(getYearSelect(fixture.nativeElement).value).toBe('3066');
- });
-
- it('should allow setting minDate separately', () => {
- const fixture = createTestComponent(` `);
-
- fixture.componentInstance.minDate = {year: 2000, month: 5, day: 20};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.date = {year: 1000, month: 2};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('5');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2000');
-
- fixture.componentInstance.date = {year: 3000, month: 5};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('5');
- expect(getYearSelect(fixture.nativeElement).value).toBe('3000');
- });
-
- it('should allow setting maxDate separately', () => {
- const fixture = createTestComponent(` `);
-
- fixture.componentInstance.maxDate = {year: 2050, month: 5, day: 20};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
-
- fixture.componentInstance.date = {year: 3000, month: 2};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('5');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2050');
-
- fixture.componentInstance.date = {year: 1000, month: 5};
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('5');
- expect(getYearSelect(fixture.nativeElement).value).toBe('1000');
- });
-
- it('should handle minDate edge case values', () => {
- const fixture = createTestComponent(` `);
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker)).injector.get(NgbDatepicker);
-
- function expectMinDate(year: number, month: number) {
- datepicker.navigateTo({year: 1000, month: 1});
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(`${month}`);
- expect(getYearSelect(fixture.nativeElement).value).toBe(`${year}`);
- }
-
- expectMinDate(2010, 1);
-
- // resetting
- fixture.componentInstance.minDate = {};
- fixture.detectChanges();
- expectMinDate(1000, 1);
-
- // resetting
- fixture.componentInstance.minDate = new Date();
- fixture.detectChanges();
- expectMinDate(1000, 1);
-
- // resetting
- fixture.componentInstance.minDate = new NgbDate(3000000, 1, 1);
- fixture.detectChanges();
- expectMinDate(1000, 1);
-
- // resetting
- fixture.componentInstance.minDate = null;
- fixture.detectChanges();
- expectMinDate(1000, 1);
-
- // resetting
- fixture.componentInstance.minDate = undefined;
- fixture.detectChanges();
- expectMinDate(1000, 1);
- });
-
- it('should handle maxDate edge case values', () => {
- const fixture = createTestComponent(` `);
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker)).injector.get(NgbDatepicker);
-
- function expectMaxDate(year: number, month: number) {
- datepicker.navigateTo({year: 10000, month: 1});
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(`${month}`);
- expect(getYearSelect(fixture.nativeElement).value).toBe(`${year}`);
- }
-
- expectMaxDate(2020, 12);
-
- // resetting
- fixture.componentInstance.maxDate = {};
- fixture.detectChanges();
- expectMaxDate(10000, 1);
-
- // resetting
- fixture.componentInstance.maxDate = new Date();
- fixture.detectChanges();
- expectMaxDate(10000, 1);
-
- // resetting
- fixture.componentInstance.maxDate = new NgbDate(3000000, 1, 1);
- fixture.detectChanges();
- expectMaxDate(10000, 1);
-
- // resetting
- fixture.componentInstance.maxDate = null;
- fixture.detectChanges();
- expectMaxDate(10000, 1);
-
- // resetting
- fixture.componentInstance.maxDate = undefined;
- fixture.detectChanges();
- expectMaxDate(10000, 1);
- });
-
- it('should support disabling dates via min/max dates', () => {
- const fixture = createTestComponent(
- ` `);
-
- fixture.componentInstance.minDate = {year: 2016, month: 8, day: 20};
- fixture.componentInstance.maxDate = {year: 2016, month: 8, day: 25};
- fixture.detectChanges();
-
- // 19 AUG 2016
- expect(getDay(fixture.nativeElement, 18)).toHaveCssClass('text-muted');
- // 20 AUG 2016
- expect(getDay(fixture.nativeElement, 19)).not.toHaveCssClass('text-muted');
- // 25 AUG 2016
- expect(getDay(fixture.nativeElement, 24)).not.toHaveCssClass('text-muted');
- // 26 AUG 2016
- expect(getDay(fixture.nativeElement, 25)).toHaveCssClass('text-muted');
- });
-
- it('should support disabling dates via callback', () => {
- const fixture = createTestComponent(
- ` `);
-
- // 22 AUG 2016
- expect(getDay(fixture.nativeElement, 21)).toHaveCssClass('text-muted');
- });
-
- it('should support passing custom data to the day template', () => {
- const fixture = createTestComponent(`
- {{ date.day }}{{ data }}
-
- `);
-
- // 22 AUG 2016
- expect(getDay(fixture.nativeElement, 21).innerText).toBe('22!');
- });
-
- it('should display multiple months', () => {
- const fixture = createTestComponent(` `);
-
- let months = fixture.debugElement.queryAll(By.directive(NgbDatepickerMonthView));
- expect(months.length).toBe(1);
-
- fixture.componentInstance.displayMonths = 3;
- fixture.detectChanges();
- months = fixture.debugElement.queryAll(By.directive(NgbDatepickerMonthView));
- expect(months.length).toBe(3);
- });
-
- it('should reuse DOM elements when changing month (single month display)', () => {
- const fixture = createTestComponent(` `);
-
- // AUG 2016
- const oldDates = getDates(fixture.nativeElement);
- const navigation = getNavigationLinks(fixture.nativeElement);
- expect(oldDates[0].innerText.trim()).toBe('1');
-
- // JUL 2016
- navigation[0].click();
- fixture.detectChanges();
-
- const newDates = getDates(fixture.nativeElement);
- expect(newDates[0].innerText.trim()).toBe('27');
-
- expect(oldDates).toEqual(newDates);
- });
-
- it('should reuse DOM elements when changing month (multiple months display)', () => {
- const fixture = createTestComponent(` `);
-
- // AUG 2016 and SEP 2016
- const oldDates = getDates(fixture.nativeElement);
- const oldAugDates = oldDates.slice(0, 42);
- const oldSepDates = oldDates.slice(42);
-
- const navigation = getNavigationLinks(fixture.nativeElement);
- expect(oldAugDates[0].innerText.trim()).toBe('1');
- expect(oldSepDates[3].innerText.trim()).toBe('1');
-
- // JUL 2016 and AUG 2016
- navigation[0].click();
- fixture.detectChanges();
-
- const newDates = getDates(fixture.nativeElement);
- const newJulDates = newDates.slice(0, 42);
- const newAugDates = newDates.slice(42);
-
- expect(newJulDates[0].innerText.trim()).toBe('27');
- expect(newAugDates[0].innerText.trim()).toBe('1');
-
- // DOM elements were reused:
- expect(newAugDates).toEqual(oldAugDates);
- expect(newJulDates).toEqual(oldSepDates);
- });
-
- it('should switch navigation types', () => {
- const fixture = createTestComponent(` `);
-
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigationSelect))).not.toBeNull();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigation))).not.toBeNull();
-
- fixture.componentInstance.navigation = 'arrows';
- fixture.detectChanges();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigationSelect))).toBeNull();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigation))).not.toBeNull();
-
- fixture.componentInstance.navigation = 'none';
- fixture.detectChanges();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigationSelect))).toBeNull();
- expect(fixture.debugElement.query(By.directive(NgbDatepickerNavigation))).toBeNull();
- });
-
- it('should toggle month names display for a single month', () => {
- const fixture = createTestComponent(
- ` `);
-
- let months = fixture.debugElement.queryAll(By.css('.ngb-dp-month-name'));
- expect(months.length).toBe(0);
-
- fixture.componentInstance.navigation = 'arrows';
- fixture.detectChanges();
- months = fixture.debugElement.queryAll(By.css('.ngb-dp-month-name'));
- expect(months.length).toBe(1);
- expect(months.map(c => c.nativeElement.innerText.trim())).toEqual(['August 2016']);
-
- fixture.componentInstance.navigation = 'none';
- fixture.detectChanges();
- months = fixture.debugElement.queryAll(By.css('.ngb-dp-month-name'));
- expect(months.length).toBe(1);
- expect(months.map(c => c.nativeElement.innerText.trim())).toEqual(['August 2016']);
- });
-
- it('should always display month names for multiple months', () => {
- const fixture = createTestComponent(
- ` `);
-
- let months = fixture.debugElement.queryAll(By.css('.ngb-dp-month-name'));
- expect(months.length).toBe(3);
- expect(months.map(c => c.nativeElement.innerText.trim())).toEqual([
- 'August 2016', 'September 2016', 'October 2016'
- ]);
-
- fixture.componentInstance.navigation = 'arrows';
- fixture.detectChanges();
- months = fixture.debugElement.queryAll(By.css('.ngb-dp-month-name'));
- expect(months.length).toBe(3);
- expect(months.map(c => c.nativeElement.innerText.trim())).toEqual([
- 'August 2016', 'September 2016', 'October 2016'
- ]);
- });
-
- it('should emit navigate event when startDate is defined', () => {
- TestBed.overrideComponent(
- TestComponent,
- {set: {template: ` `}});
- const fixture = TestBed.createComponent(TestComponent);
-
- spyOn(fixture.componentInstance, 'onNavigate');
- fixture.detectChanges();
-
- expect(fixture.componentInstance.onNavigate)
- .toHaveBeenCalledWith({current: null, next: {year: 2016, month: 8}, preventDefault: jasmine.any(Function)});
- });
-
- it('should emit navigate event without startDate defined', () => {
- TestBed.overrideComponent(
- TestComponent, {set: {template: ` `}});
- const fixture = TestBed.createComponent(TestComponent);
- const now = new Date();
-
- spyOn(fixture.componentInstance, 'onNavigate');
- fixture.detectChanges();
-
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith({
- current: null,
- next: {year: now.getFullYear(), month: now.getMonth() + 1},
- preventDefault: jasmine.any(Function)
- });
- });
-
- it('should emit navigate event using built-in navigation arrows', () => {
- const fixture =
- createTestComponent(` `);
-
- spyOn(fixture.componentInstance, 'onNavigate');
- const navigation = getNavigationLinks(fixture.nativeElement);
-
- // JUL 2016
- navigation[0].click();
- fixture.detectChanges();
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith({
- current: {year: 2016, month: 8},
- next: {year: 2016, month: 7},
- preventDefault: jasmine.any(Function)
- });
- });
-
- it('should emit navigate event using navigateTo({date})', () => {
- const fixture =
- createTestComponent(`
- `);
-
- spyOn(fixture.componentInstance, 'onNavigate');
- const button = fixture.nativeElement.querySelector('button#btn');
- button.click();
-
- fixture.detectChanges();
- expect(fixture.componentInstance.onNavigate).toHaveBeenCalledWith({
- current: {year: 2016, month: 8},
- next: {year: 2015, month: 6},
- preventDefault: jasmine.any(Function)
- });
- });
-
- it('should prevent navigation when calling preventDefault()', () => {
- const fixture = createTestComponent(
- `
- `);
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
- expect(getDay(fixture.nativeElement, 0).innerText).toBe('1');
-
- const button = fixture.nativeElement.querySelector('button#btn');
- button.click();
- fixture.detectChanges();
-
- expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
- expect(getDay(fixture.nativeElement, 0).innerText).toBe('1');
- });
-
- it('should not focus day initially', () => {
- const fixture = createTestComponent(' ');
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1), false);
- });
-
- it('should remove focus day on blur', () => {
- const fixture =
- createTestComponent(' ');
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- // focus in
- focusDay();
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1), true);
-
- // focus out
- (document.querySelector('#focusout') as HTMLElement).focus();
-
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1), false);
- expectSelectedDate(datepicker, null);
-
- });
-
- it('should emit select event when select date', () => {
- const fixture =
- createTestComponent(` `);
-
- spyOn(fixture.componentInstance, 'onSelect');
- let dates = getDates(fixture.nativeElement);
- dates[11].click();
-
- fixture.detectChanges();
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledTimes(1);
- });
-
- it('should emit select event twice when select same date twice', () => {
- const fixture =
- createTestComponent(` `);
-
- spyOn(fixture.componentInstance, 'onSelect');
- let dates = getDates(fixture.nativeElement);
-
- dates[11].click();
- fixture.detectChanges();
-
- dates[11].click();
- fixture.detectChanges();
-
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledTimes(2);
- });
-
- it('should emit select event twice when press enter key twice', () => {
- const fixture =
- createTestComponent(` `);
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- spyOn(fixture.componentInstance, 'onSelect');
-
- focusDay();
- fixture.detectChanges();
-
- triggerKeyDown(getMonthContainer(datepicker), 13 /* enter */);
- fixture.detectChanges();
-
- triggerKeyDown(getMonthContainer(datepicker), 13 /* enter */);
- fixture.detectChanges();
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledTimes(2);
- });
-
- it('should emit select event twice when press space key twice', () => {
- const fixture =
- createTestComponent(` `);
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- spyOn(fixture.componentInstance, 'onSelect');
-
- focusDay();
- fixture.detectChanges();
-
- triggerKeyDown(getMonthContainer(datepicker), 32 /* space */);
- fixture.detectChanges();
-
- triggerKeyDown(getMonthContainer(datepicker), 32 /* space */);
- fixture.detectChanges();
- expect(fixture.componentInstance.onSelect).toHaveBeenCalledTimes(2);
- });
-
- it('should insert an embedded view for footer when `footerTemplate` provided', () => {
- const fixture = createTestComponent(`
- `);
-
- fixture.detectChanges();
-
- expect(fixture.nativeElement.querySelector('#myDatepickerFooter')).not.toBeNull();
- });
-
- describe('ngModel', () => {
-
- it('should update model based on calendar clicks', async(() => {
- const fixture = createTestComponent(
- ` `);
-
- const dates = getDates(fixture.nativeElement);
- dates[0].click(); // 1 AUG 2016
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 8, day: 1});
-
- dates[1].click();
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 8, day: 2});
- }));
-
- it('should not update model based on calendar clicks when disabled', async(() => {
- const fixture = createTestComponent(
- `
- `);
-
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
-
- const dates = getDates(fixture.nativeElement);
- dates[0].click(); // 1 AUG 2016
- expect(fixture.componentInstance.model).toBeFalsy();
-
- dates[1].click();
- expect(fixture.componentInstance.model).toBeFalsy();
- });
- }));
-
- it('select calendar date based on model updates', async(() => {
- const fixture = createTestComponent(
- ` `);
-
- fixture.componentInstance.model = {year: 2016, month: 8, day: 1};
-
- fixture.detectChanges();
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- expect(getDay(fixture.nativeElement, 0)).toHaveCssClass('bg-primary');
-
- fixture.componentInstance.model = {year: 2016, month: 8, day: 2};
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- expect(getDay(fixture.nativeElement, 0)).not.toHaveCssClass('bg-primary');
- expect(getDay(fixture.nativeElement, 1)).toHaveCssClass('bg-primary');
- });
- }));
-
- it('should switch month when clicked on the date outside of current month', async(() => {
- const fixture = createTestComponent(
- ` `);
- fixture.detectChanges();
- fixture.whenStable().then(() => {
-
- let dates = getDates(fixture.nativeElement);
-
- dates[31].click(); // 1 SEP 2016
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 9, day: 1});
-
- // month changes to SEP
- fixture.detectChanges();
- expect(getDay(fixture.nativeElement, 0).innerText).toBe('29'); // 29 AUG 2016
- expect(getDay(fixture.nativeElement, 3)).toHaveCssClass('bg-primary'); // 1 SEP still selected
- });
- }));
-
- it('should switch month on prev/next navigation click', async(() => {
- const fixture = createTestComponent(
- ` `);
-
- let dates = getDates(fixture.nativeElement);
- const navigation = getNavigationLinks(fixture.nativeElement);
-
- dates[0].click(); // 1 AUG 2016
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 8, day: 1});
-
- // PREV
- navigation[0].click();
- fixture.detectChanges();
- dates = getDates(fixture.nativeElement);
- dates[4].click(); // 1 JUL 2016
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 7, day: 1});
-
- // NEXT
- navigation[1].click();
- fixture.detectChanges();
- dates = getDates(fixture.nativeElement);
- dates[0].click(); // 1 AUG 2016
- expect(fixture.componentInstance.model).toEqual({year: 2016, month: 8, day: 1});
- }));
-
- it('should switch month using navigateTo({date})', async(() => {
- const fixture = createTestComponent(
- `
- `);
-
- const button = fixture.nativeElement.querySelector('button#btn');
- button.click();
-
- fixture.detectChanges();
- expect(getMonthSelect(fixture.nativeElement).value).toBe('6');
- expect(getYearSelect(fixture.nativeElement).value).toBe('2015');
-
- const dates = getDates(fixture.nativeElement);
- dates[0].click(); // 1 JUN 2015
- expect(fixture.componentInstance.model).toEqual({year: 2015, month: 6, day: 1});
- }));
-
- it('should switch to current month using navigateTo() without arguments', () => {
- const fixture = createTestComponent(
- `
- `);
-
- const button = fixture.nativeElement.querySelector('button#btn');
- button.click();
-
- fixture.detectChanges();
- const today = new Date();
- expect(getMonthSelect(fixture.nativeElement).value).toBe(`${today.getMonth() + 1}`);
- expect(getYearSelect(fixture.nativeElement).value).toBe(`${today.getFullYear()}`);
- });
-
- it('should support disabling all dates and navigation via the disabled attribute', async(() => {
- const fixture = createTestComponent(
- ` `);
- fixture.detectChanges();
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- for (let index = 0; index < 31; index++) {
- expect(getDay(fixture.nativeElement, index)).toHaveCssClass('text-muted');
- }
-
- const links = getNavigationLinks(fixture.nativeElement);
- expect(links[0].hasAttribute('disabled')).toBeTruthy();
- expect(links[1].hasAttribute('disabled')).toBeTruthy();
- expect(getYearSelect(fixture.nativeElement).disabled).toBeTruthy();
- expect(getMonthSelect(fixture.nativeElement).disabled).toBeTruthy();
- });
- }));
- });
-
- describe('aria attributes', () => {
- const template = `
- `;
-
- it('should contains aria-label on the days', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
- const dates = getDates(fixture.nativeElement);
-
- dates.forEach(function(date) {
- expect(date.getAttribute('aria-label')).toBeDefined('Missing aria-label attribute on a day');
- });
- });
- });
-
- describe('keyboard navigation', () => {
-
- const template = `
-
- `;
-
- it('should move focus with arrow keys', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- // focus in
- focusDay();
-
- triggerKeyDown(getMonthContainer(datepicker), 40 /* down arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 8));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 39 /* right arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 9));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 38 /* up arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 2));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 37 /* left arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1));
- expectSelectedDate(datepicker, null);
- });
-
- it('should select focused date with enter or space', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- focusDay();
-
- triggerKeyDown(getMonthContainer(datepicker), 32 /* space */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1));
- expectSelectedDate(datepicker, new NgbDate(2016, 8, 1));
-
- triggerKeyDown(getMonthContainer(datepicker), 40 /* down arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 8));
- expectSelectedDate(datepicker, new NgbDate(2016, 8, 1));
-
- triggerKeyDown(getMonthContainer(datepicker), 13 /* enter */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 8));
- expectSelectedDate(datepicker, new NgbDate(2016, 8, 8));
- });
-
- it('should select first and last dates of the view with home/end', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- focusDay();
-
- triggerKeyDown(getMonthContainer(datepicker), 35 /* end */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 9, 30));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 36 /* home */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1));
- expectSelectedDate(datepicker, null);
- });
-
- it('should select min and max dates with shift+home/end', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- focusDay();
-
- triggerKeyDown(getMonthContainer(datepicker), 35 /* end */, true /* shift */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2020, 12, 31));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 40 /* down arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2020, 12, 31));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 36 /* home */, true /* shift */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2010, 1, 1));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 38 /* up arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2010, 1, 1));
- expectSelectedDate(datepicker, null);
- });
-
- it('should navigate between months with pageUp/Down', () => {
- const fixture = createTestComponent(template);
-
- let datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- focusDay();
-
- triggerKeyDown(getMonthContainer(datepicker), 39 /* right arrow */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 2));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 33 /* page up */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 7, 1));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 34 /* page down */);
- fixture.detectChanges();
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 34 /* page down */);
- fixture.detectChanges();
-
- expectFocusedDate(datepicker, new NgbDate(2016, 9, 1));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 34 /* page down */);
- fixture.detectChanges();
- datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
- expectFocusedDate(datepicker, new NgbDate(2016, 10, 1));
- expectSelectedDate(datepicker, null);
- });
-
- it('should navigate between years with shift+pageUp/Down', () => {
- const fixture = createTestComponent(template);
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
- focusDay();
-
- getMonthContainer(datepicker).triggerEventHandler('focus', {});
- fixture.detectChanges();
-
- expectFocusedDate(datepicker, new NgbDate(2016, 8, 1));
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 33 /* page up */, true /* shift */);
- fixture.detectChanges();
-
- expectFocusedDate(datepicker, new NgbDate(2015, 1, 1), true);
- expectSelectedDate(datepicker, null);
-
- triggerKeyDown(getMonthContainer(datepicker), 34 /* page down */, true /* shift */);
- fixture.detectChanges();
-
- expectFocusedDate(datepicker, new NgbDate(2016, 1, 1));
- expectSelectedDate(datepicker, null);
- });
-
- it(`shouldn't be focusable when disabled`, fakeAsync(() => {
- const fixture =
- createTestComponent(` `);
- tick();
- fixture.detectChanges();
-
- const datepicker = fixture.debugElement.query(By.directive(NgbDatepicker));
-
- const days = getFocusableDays(datepicker);
-
- expect(days.length).toEqual(0, 'A focusable day has been found');
-
- }));
-
- });
-
- describe('forms', () => {
-
- it('should work with template-driven form validation', async(() => {
- const fixture = createTestComponent(`
-
- `);
-
- const compiled = fixture.nativeElement;
- fixture.detectChanges();
- fixture.whenStable()
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- expect(getDatepicker(compiled)).toHaveCssClass('ng-invalid');
- expect(getDatepicker(compiled)).not.toHaveCssClass('ng-valid');
-
- fixture.componentInstance.model = {year: 2016, month: 8, day: 1};
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- expect(getDatepicker(compiled)).toHaveCssClass('ng-valid');
- expect(getDatepicker(compiled)).not.toHaveCssClass('ng-invalid');
- });
- }));
-
- it('should work with model-driven form validation', async(() => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- fixture.detectChanges();
- fixture.whenStable()
- .then(() => {
- const dates = getDates(fixture.nativeElement);
-
- expect(getDatepicker(compiled)).toHaveCssClass('ng-invalid');
- expect(getDatepicker(compiled)).not.toHaveCssClass('ng-valid');
-
- dates[0].click();
- fixture.detectChanges();
- return fixture.whenStable();
- })
- .then(() => {
- expect(getDatepicker(compiled)).toHaveCssClass('ng-valid');
- expect(getDatepicker(compiled)).not.toHaveCssClass('ng-invalid');
- });
- }));
-
- it('should be disabled with reactive forms', async(() => {
- const html = ``;
-
- const fixture = createTestComponent(html);
- fixture.detectChanges();
- const dates = getDates(fixture.nativeElement);
- dates[0].click(); // 1 AUG 2016
- expect(fixture.componentInstance.disabledForm.controls['control'].value).toBeFalsy();
- for (let index = 0; index < 31; index++) {
- expect(getDay(fixture.nativeElement, index)).toHaveCssClass('text-muted');
- }
- expect(fixture.nativeElement.querySelector('ngb-datepicker').getAttribute('tabindex')).toBeFalsy();
- }));
-
- it('should not change again the value in the model on a change coming from the model (template-driven form)',
- async(() => {
- const html = ``;
-
- const fixture = createTestComponent(html);
- fixture.detectChanges();
-
- const value = new NgbDate(2018, 7, 28);
- fixture.componentInstance.model = value;
-
- fixture.detectChanges();
- fixture.whenStable().then(() => { expect(fixture.componentInstance.model).toBe(value); });
- }));
-
- it('should not change again the value in the model on a change coming from the model (reactive form)', async(() => {
- const html = ``;
-
- const fixture = createTestComponent(html);
- fixture.detectChanges();
-
- const formChangeSpy = jasmine.createSpy('form change');
- const form = fixture.componentInstance.form;
- form.valueChanges.subscribe(formChangeSpy);
- const controlValue = new NgbDate(2018, 7, 28);
- form.setValue({control: controlValue});
-
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- expect(formChangeSpy).toHaveBeenCalledTimes(1);
- expect(form.value.control).toBe(controlValue);
- });
- }));
-
- });
-
- describe('Custom config', () => {
- let config: NgbDatepickerConfig;
-
- beforeEach(() => { TestBed.configureTestingModule({imports: [NgbDatepickerModule]}); });
-
- beforeEach(inject([NgbDatepickerConfig], (c: NgbDatepickerConfig) => {
- config = c;
- customizeConfig(config);
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(NgbDatepicker);
-
- const datepicker = fixture.componentInstance;
- expectSameValues(datepicker, config);
- });
- });
-
- describe('Custom config as provider', () => {
- const config = new NgbDatepickerConfig();
- customizeConfig(config);
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [NgbDatepickerModule], providers: [{provide: NgbDatepickerConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = TestBed.createComponent(NgbDatepicker);
-
- const datepicker = fixture.componentInstance;
- expectSameValues(datepicker, config);
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- date = {year: 2016, month: 8};
- displayMonths = 1;
- navigation = 'select';
- minDate: NgbDateStruct = {year: 2010, month: 1, day: 1};
- maxDate: NgbDateStruct = {year: 2020, month: 12, day: 31};
- form = new FormGroup({control: new FormControl('', Validators.required)});
- disabledForm = new FormGroup({control: new FormControl({value: null, disabled: true})});
- model;
- showWeekdays = true;
- dayTemplateData = () => '!';
- markDisabled = (date: NgbDateStruct) => { return NgbDate.from(date).equals(new NgbDate(2016, 8, 22)); };
- onNavigate = () => {};
- onSelect = () => {};
- getDate = () => ({year: 2016, month: 8});
- onPreventableNavigate = (event: NgbDatepickerNavigateEvent) => event.preventDefault();
-}
diff --git a/backup/src/datepicker/datepicker.ts b/backup/src/datepicker/datepicker.ts
deleted file mode 100644
index a17e658..0000000
--- a/backup/src/datepicker/datepicker.ts
+++ /dev/null
@@ -1,395 +0,0 @@
-import {fromEvent, merge, Subject} from 'rxjs';
-import {filter, take, takeUntil} from 'rxjs/operators';
-import {
- AfterViewInit,
- ChangeDetectionStrategy,
- ChangeDetectorRef,
- Component,
- ElementRef,
- EventEmitter,
- forwardRef,
- Input,
- NgZone,
- OnChanges,
- OnDestroy,
- OnInit,
- Output,
- SimpleChanges,
- TemplateRef,
- ViewChild,
- ViewEncapsulation
-} from '@angular/core';
-import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
-import {NgbCalendar} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-import {NgbDatepickerService} from './datepicker-service';
-import {NgbDatepickerKeyMapService} from './datepicker-keymap-service';
-import {DatepickerViewModel, NavigationEvent} from './datepicker-view-model';
-import {DayTemplateContext} from './datepicker-day-template-context';
-import {NgbDatepickerConfig} from './datepicker-config';
-import {NgbDateAdapter} from './adapters/ngb-date-adapter';
-import {NgbDateStruct} from './ngb-date-struct';
-import {NgbDatepickerI18n} from './datepicker-i18n';
-import {isChangedDate, isChangedMonth} from './datepicker-tools';
-import {hasClassName} from '../util/util';
-
-const NGB_DATEPICKER_VALUE_ACCESSOR = {
- provide: NG_VALUE_ACCESSOR,
- useExisting: forwardRef(() => NgbDatepicker),
- multi: true
-};
-
-/**
- * An event emitted right before the navigation happens and the month displayed by the datepicker changes.
- */
-export interface NgbDatepickerNavigateEvent {
- /**
- * The currently displayed month.
- */
- current: {year: number, month: number};
-
- /**
- * The month we're navigating to.
- */
- next: {year: number, month: number};
-
- /**
- * Calling this function will prevent navigation from happening.
- *
- * @since 4.1.0
- */
- preventDefault: () => void;
-}
-
-/**
- * A highly configurable component that helps you with selecting calendar dates.
- *
- * `NgbDatepicker` is meant to be displayed inline on a page or put inside a popup.
- */
-@Component({
- exportAs: 'ngbDatepicker',
- selector: 'ngb-datepicker',
- changeDetection: ChangeDetectionStrategy.OnPush,
- encapsulation: ViewEncapsulation.None,
- styleUrls: ['./datepicker.scss'],
- template: `
-
-
-
-
-
-
-
-
-
-
-
1 && navigation === 'select')"
- class="ngb-dp-month-name">
- {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}
-
-
-
-
-
-
-
-
- `,
- providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NgbDatepickerService, NgbDatepickerKeyMapService]
-})
-export class NgbDatepicker implements OnDestroy,
- OnChanges, OnInit, AfterViewInit, ControlValueAccessor {
- model: DatepickerViewModel;
-
- @ViewChild('months', {static: true}) private _monthsEl: ElementRef;
- private _controlValue: NgbDate;
- private _destroyed$ = new Subject();
-
- /**
- * The reference to a custom template for the day.
- *
- * Allows to completely override the way a day 'cell' in the calendar is displayed.
- *
- * See [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext) for the data you get inside.
- */
- @Input() dayTemplate: TemplateRef;
-
- /**
- * The callback to pass any arbitrary data to the template cell via the
- * [`DayTemplateContext`](#/components/datepicker/api#DayTemplateContext)'s `data` parameter.
- *
- * `current` is the month that is currently displayed by the datepicker.
- *
- * @since 3.3.0
- */
- @Input() dayTemplateData: (date: NgbDate, current: {year: number, month: number}) => any;
-
- /**
- * The number of months to display.
- */
- @Input() displayMonths: number;
-
- /**
- * The first day of the week.
- *
- * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.
- */
- @Input() firstDayOfWeek: number;
-
- /**
- * The reference to the custom template for the datepicker footer.
- *
- * @since 3.3.0
- */
- @Input() footerTemplate: TemplateRef;
-
- /**
- * The callback to mark some dates as disabled.
- *
- * It is called for each new date when navigating to a different month.
- *
- * `current` is the month that is currently displayed by the datepicker.
- */
- @Input() markDisabled: (date: NgbDate, current: {year: number, month: number}) => boolean;
-
- /**
- * The latest date that can be displayed or selected.
- *
- * If not provided, 'year' select box will display 10 years after the current month.
- */
- @Input() maxDate: NgbDateStruct;
-
- /**
- * The earliest date that can be displayed or selected.
- *
- * If not provided, 'year' select box will display 10 years before the current month.
- */
- @Input() minDate: NgbDateStruct;
-
- /**
- * Navigation type.
- *
- * * `"select"` - select boxes for month and navigation arrows
- * * `"arrows"` - only navigation arrows
- * * `"none"` - no navigation visible at all
- */
- @Input() navigation: 'select' | 'arrows' | 'none';
-
- /**
- * The way of displaying days that don't belong to the current month.
- *
- * * `"visible"` - days are visible
- * * `"hidden"` - days are hidden, white space preserved
- * * `"collapsed"` - days are collapsed, so the datepicker height might change between months
- *
- * For the 2+ months view, days in between months are never shown.
- */
- @Input() outsideDays: 'visible' | 'collapsed' | 'hidden';
-
- /**
- * If `true`, weekdays will be displayed.
- */
- @Input() showWeekdays: boolean;
-
- /**
- * If `true`, week numbers will be displayed.
- */
- @Input() showWeekNumbers: boolean;
-
- /**
- * The date to open calendar with.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date is provided, calendar will open with current month.
- *
- * You could use `navigateTo(date)` method as an alternative.
- */
- @Input() startDate: {year: number, month: number, day?: number};
-
- /**
- * An event emitted right before the navigation happens and displayed month changes.
- *
- * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
- */
- @Output() navigate = new EventEmitter();
-
- /**
- * An event emitted when user selects a date using keyboard or mouse.
- *
- * The payload of the event is currently selected `NgbDate`.
- */
- @Output() select = new EventEmitter();
-
- onChange = (_: any) => {};
- onTouched = () => {};
-
- constructor(
- private _keyMapService: NgbDatepickerKeyMapService, public _service: NgbDatepickerService,
- private _calendar: NgbCalendar, public i18n: NgbDatepickerI18n, config: NgbDatepickerConfig,
- private _cd: ChangeDetectorRef, private _elementRef: ElementRef,
- private _ngbDateAdapter: NgbDateAdapter, private _ngZone: NgZone) {
- ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
- 'maxDate', 'navigation', 'outsideDays', 'showWeekdays', 'showWeekNumbers', 'startDate']
- .forEach(input => this[input] = config[input]);
-
- _service.select$.pipe(takeUntil(this._destroyed$)).subscribe(date => { this.select.emit(date); });
-
- _service.model$.pipe(takeUntil(this._destroyed$)).subscribe(model => {
- const newDate = model.firstDate;
- const oldDate = this.model ? this.model.firstDate : null;
-
- let navigationPrevented = false;
- // emitting navigation event if the first month changes
- if (!newDate.equals(oldDate)) {
- this.navigate.emit({
- current: oldDate ? {year: oldDate.year, month: oldDate.month} : null,
- next: {year: newDate.year, month: newDate.month},
- preventDefault: () => navigationPrevented = true
- });
-
- // can't prevent the very first navigation
- if (navigationPrevented && oldDate !== null) {
- this._service.open(oldDate);
- return;
- }
- }
-
- const newSelectedDate = model.selectedDate;
- const newFocusedDate = model.focusDate;
- const oldFocusedDate = this.model ? this.model.focusDate : null;
-
- this.model = model;
-
- // handling selection change
- if (isChangedDate(newSelectedDate, this._controlValue)) {
- this._controlValue = newSelectedDate;
- this.onTouched();
- this.onChange(this._ngbDateAdapter.toModel(newSelectedDate));
- }
-
- // handling focus change
- if (isChangedDate(newFocusedDate, oldFocusedDate) && oldFocusedDate && model.focusVisible) {
- this.focus();
- }
-
- _cd.markForCheck();
- });
- }
-
- focus() {
- this._ngZone.onStable.asObservable().pipe(take(1)).subscribe(() => {
- const elementToFocus =
- this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');
- if (elementToFocus) {
- elementToFocus.focus();
- }
- });
- }
-
- /**
- * Navigates to the provided date.
- *
- * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
- * If nothing or invalid date provided calendar will open current month.
- *
- * Use the `[startDate]` input as an alternative.
- */
- navigateTo(date?: {year: number, month: number, day?: number}) {
- this._service.open(NgbDate.from(date ? date.day ? date as NgbDateStruct : {...date, day: 1} : null));
- }
-
- ngAfterViewInit() {
- this._ngZone.runOutsideAngular(() => {
- const focusIns$ = fromEvent(this._monthsEl.nativeElement, 'focusin');
- const focusOuts$ = fromEvent(this._monthsEl.nativeElement, 'focusout');
-
- // we're changing 'focusVisible' only when entering or leaving months view
- // and ignoring all focus events where both 'target' and 'related' target are day cells
- merge(focusIns$, focusOuts$)
- .pipe(
- filter(
- ({target, relatedTarget}) =>
- !(hasClassName(target, 'ngb-dp-day') && hasClassName(relatedTarget, 'ngb-dp-day'))),
- takeUntil(this._destroyed$))
- .subscribe(({type}) => this._ngZone.run(() => this._service.focusVisible = type === 'focusin'));
- });
- }
-
- ngOnDestroy() { this._destroyed$.next(); }
-
- ngOnInit() {
- if (this.model === undefined) {
- ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
- 'outsideDays']
- .forEach(input => this._service[input] = this[input]);
- this.navigateTo(this.startDate);
- }
- }
-
- ngOnChanges(changes: SimpleChanges) {
- ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
- 'outsideDays']
- .filter(input => input in changes)
- .forEach(input => this._service[input] = this[input]);
-
- if ('startDate' in changes) {
- const {currentValue, previousValue} = changes.startDate;
- if (isChangedMonth(previousValue, currentValue)) {
- this.navigateTo(this.startDate);
- }
- }
- }
-
- onDateSelect(date: NgbDate) {
- this._service.focus(date);
- this._service.select(date, {emitEvent: true});
- }
-
- onKeyDown(event: KeyboardEvent) { this._keyMapService.processKey(event); }
-
- onNavigateDateSelect(date: NgbDate) { this._service.open(date); }
-
- onNavigateEvent(event: NavigationEvent) {
- switch (event) {
- case NavigationEvent.PREV:
- this._service.open(this._calendar.getPrev(this.model.firstDate, 'm', 1));
- break;
- case NavigationEvent.NEXT:
- this._service.open(this._calendar.getNext(this.model.firstDate, 'm', 1));
- break;
- }
- }
-
- registerOnChange(fn: (value: any) => any): void { this.onChange = fn; }
-
- registerOnTouched(fn: () => any): void { this.onTouched = fn; }
-
- setDisabledState(isDisabled: boolean) { this._service.disabled = isDisabled; }
-
- writeValue(value) {
- this._controlValue = NgbDate.from(this._ngbDateAdapter.fromModel(value));
- this._service.select(this._controlValue);
- }
-}
diff --git a/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.spec.ts b/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.spec.ts
deleted file mode 100644
index e8c6bf6..0000000
--- a/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.spec.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-import {TestBed} from '@angular/core/testing';
-import {NgbDate} from '../ngb-date';
-import {NgbDatepickerI18nHebrew} from './datepicker-i18n-hebrew';
-
-describe('datepicker-i18n-hebrew', () => {
-
- let i18n: NgbDatepickerI18nHebrew;
-
- beforeEach(() => {
- TestBed.configureTestingModule({providers: [NgbDatepickerI18nHebrew]});
- i18n = TestBed.get(NgbDatepickerI18nHebrew);
- });
-
- it('should return abbreviated month name', () => {
- expect(i18n.getMonthShortName(0, 5778)).toBe(undefined);
- expect(i18n.getMonthShortName(1, 5778)).toBe('תשרי');
- expect(i18n.getMonthShortName(6, 5778)).toBe('אדר');
- expect(i18n.getMonthShortName(7, 5778)).toBe('ניסן');
- expect(i18n.getMonthShortName(12, 5778)).toBe('אלול');
- expect(i18n.getMonthShortName(13, 5778)).toBe(undefined);
- });
-
- it('should return abbreviated month name (leap year)', () => {
- expect(i18n.getMonthShortName(0, 5779)).toBe(undefined);
- expect(i18n.getMonthShortName(1, 5779)).toBe('תשרי');
- expect(i18n.getMonthShortName(6, 5779)).toBe('אדר א׳');
- expect(i18n.getMonthShortName(7, 5779)).toBe('אדר ב׳');
- expect(i18n.getMonthShortName(12, 5779)).toBe('אב');
- expect(i18n.getMonthShortName(13, 5779)).toBe('אלול');
- expect(i18n.getMonthShortName(14, 5779)).toBe(undefined);
- });
-
- it('should return wide month name', () => {
- expect(i18n.getMonthFullName(0, 5778)).toBe(undefined);
- expect(i18n.getMonthFullName(1, 5778)).toBe('תשרי');
- expect(i18n.getMonthFullName(6, 5778)).toBe('אדר');
- expect(i18n.getMonthFullName(7, 5778)).toBe('ניסן');
- expect(i18n.getMonthFullName(12, 5778)).toBe('אלול');
- expect(i18n.getMonthFullName(13, 5778)).toBe(undefined);
- });
-
- it('should return wide month name (leap year)', () => {
- expect(i18n.getMonthFullName(0, 5779)).toBe(undefined);
- expect(i18n.getMonthFullName(1, 5779)).toBe('תשרי');
- expect(i18n.getMonthFullName(6, 5779)).toBe('אדר א׳');
- expect(i18n.getMonthFullName(7, 5779)).toBe('אדר ב׳');
- expect(i18n.getMonthFullName(12, 5779)).toBe('אב');
- expect(i18n.getMonthFullName(13, 5779)).toBe('אלול');
- expect(i18n.getMonthFullName(14, 5779)).toBe(undefined);
- });
-
- it('should return weekday name', () => {
- expect(i18n.getWeekdayShortName(0)).toBe(undefined);
- expect(i18n.getWeekdayShortName(1)).toBe('שני');
- expect(i18n.getWeekdayShortName(7)).toBe('ראשון');
- expect(i18n.getWeekdayShortName(8)).toBe(undefined);
- });
-
- it('should generate aria label for a date',
- () => { expect(i18n.getDayAriaLabel(new NgbDate(5778, 10, 8))).toBe('ח׳ תמוז תשע״ח'); });
-
- it('should generate week number numerals', () => {
- expect(i18n.getWeekNumerals(1)).toBe('א׳');
- expect(i18n.getWeekNumerals(50)).toBe('נ׳');
- });
-
- it('should generate day numerals', () => {
- expect(i18n.getDayNumerals(new NgbDate(5778, 10, 1))).toBe('א׳');
- expect(i18n.getDayNumerals(new NgbDate(5778, 10, 29))).toBe('כ״ט');
- });
-
- it('should generate year numerals', () => {
- expect(i18n.getYearNumerals(0)).toBe('');
- expect(i18n.getYearNumerals(5778)).toBe('תשע״ח');
- });
-});
diff --git a/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.ts b/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.ts
deleted file mode 100644
index 7267fe7..0000000
--- a/backup/src/datepicker/hebrew/datepicker-i18n-hebrew.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import {NgbDatepickerI18n} from '../datepicker-i18n';
-import {NgbDateStruct} from '../../index';
-import {hebrewNumerals, isHebrewLeapYear} from './hebrew';
-import {Injectable} from '@angular/core';
-
-
-const WEEKDAYS = ['שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת', 'ראשון'];
-const MONTHS = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
-const MONTHS_LEAP =
- ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר א׳', 'אדר ב׳', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
-
-/**
- * @since 3.2.0
- */
-@Injectable()
-export class NgbDatepickerI18nHebrew extends NgbDatepickerI18n {
- getMonthShortName(month: number, year?: number): string { return this.getMonthFullName(month, year); }
-
- getMonthFullName(month: number, year?: number): string {
- return isHebrewLeapYear(year) ? MONTHS_LEAP[month - 1] : MONTHS[month - 1];
- }
-
- getWeekdayShortName(weekday: number): string { return WEEKDAYS[weekday - 1]; }
-
- getDayAriaLabel(date: NgbDateStruct): string {
- return `${hebrewNumerals(date.day)} ${this.getMonthFullName(date.month, date.year)} ${hebrewNumerals(date.year)}`;
- }
-
- getDayNumerals(date: NgbDateStruct): string { return hebrewNumerals(date.day); }
-
- getWeekNumerals(weekNumber: number): string { return hebrewNumerals(weekNumber); }
-
- getYearNumerals(year: number): string { return hebrewNumerals(year); }
-}
diff --git a/backup/src/datepicker/hebrew/hebrew.spec.ts b/backup/src/datepicker/hebrew/hebrew.spec.ts
deleted file mode 100644
index e793423..0000000
--- a/backup/src/datepicker/hebrew/hebrew.spec.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import {NgbDate} from '../ngb-date';
-import {fromGregorian, hebrewNumerals, toGregorian} from './hebrew';
-
-const DATE_TABLE = [
- [5760, 3, 16, 1999, 11, 25], [5760, 7, 27, 2000, 4, 3], [5760, 12, 14, 2000, 8, 15], [5761, 1, 30, 2000, 10, 29],
- [5761, 8, 1, 2001, 4, 24], [5761, 10, 17, 2001, 7, 8], [5762, 2, 29, 2001, 11, 15], [5762, 7, 2, 2002, 3, 15],
- [5762, 9, 10, 2002, 5, 21], [5763, 5, 22, 2003, 1, 25], [5763, 7, 28, 2003, 4, 1], [5763, 13, 29, 2003, 9, 26],
- [5764, 11, 14, 2004, 8, 1], [5764, 5, 13, 2004, 2, 5], [5764, 1, 1, 2003, 9, 27], [5765, 6, 3, 2005, 2, 12],
- [5765, 3, 19, 2004, 12, 2], [5765, 12, 9, 2005, 8, 14], [5766, 4, 11, 2006, 1, 11], [5766, 5, 2, 2006, 1, 31],
- [5766, 10, 22, 2006, 7, 18], [5767, 6, 27, 2007, 3, 17], [5767, 8, 4, 2007, 4, 22], [5767, 2, 30, 2006, 11, 21],
- [5768, 13, 28, 2008, 9, 28], [5768, 6, 23, 2008, 2, 29], [5768, 3, 17, 2007, 11, 27], [5769, 2, 27, 2008, 11, 25],
- [5769, 10, 5, 2009, 6, 27], [5769, 9, 9, 2009, 6, 1], [5770, 1, 18, 2009, 10, 6], [5770, 12, 2, 2010, 8, 12],
- [5770, 7, 30, 2010, 4, 14], [5771, 7, 15, 2011, 3, 21], [5771, 6, 2, 2011, 2, 6], [5771, 12, 1, 2011, 8, 1],
- [5772, 3, 30, 2011, 12, 26], [5772, 9, 26, 2012, 6, 16], [5772, 12, 29, 2012, 9, 16], [5773, 11, 1, 2013, 7, 8],
- [5773, 4, 20, 2013, 1, 2], [5773, 2, 11, 2012, 10, 27], [5774, 1, 21, 2013, 9, 25], [5774, 11, 2, 2014, 6, 30],
- [5774, 6, 30, 2014, 3, 2], [5775, 10, 27, 2015, 7, 14], [5775, 4, 2, 2014, 12, 24], [5775, 5, 23, 2015, 2, 12],
- [5776, 12, 20, 2016, 8, 24], [5776, 10, 10, 2016, 6, 16], [5776, 5, 4, 2016, 1, 14], [5777, 3, 17, 2016, 12, 17],
- [5777, 8, 29, 2017, 5, 25], [5777, 10, 7, 2017, 7, 1], [5778, 12, 11, 2018, 8, 22], [5778, 10, 19, 2018, 7, 2],
- [5778, 6, 25, 2018, 3, 12], [5779, 2, 3, 2018, 10, 12], [5779, 13, 15, 2019, 9, 15], [5779, 8, 30, 2019, 5, 5],
- [5780, 5, 14, 2020, 2, 9], [5780, 11, 12, 2020, 8, 2], [5780, 3, 30, 2019, 12, 28], [5781, 4, 20, 2021, 1, 4],
- [5781, 9, 19, 2021, 5, 30], [5781, 10, 29, 2021, 7, 9], [5782, 12, 24, 2022, 8, 21], [5782, 1, 2, 2021, 9, 8],
- [5782, 7, 26, 2022, 3, 29], [5783, 2, 16, 2022, 11, 10], [5783, 10, 19, 2023, 7, 8], [5783, 5, 5, 2023, 1, 27],
- [5784, 7, 1, 2024, 3, 11], [5784, 13, 29, 2024, 10, 2], [5784, 3, 14, 2023, 11, 27], [5785, 3, 30, 2024, 12, 31],
- [5785, 7, 4, 2025, 4, 2], [5785, 11, 11, 2025, 8, 5], [5786, 10, 1, 2026, 6, 16], [5786, 5, 28, 2026, 2, 15],
- [5786, 2, 17, 2025, 11, 8], [5787, 10, 18, 2027, 6, 23], [5787, 6, 29, 2027, 3, 8], [5787, 5, 3, 2027, 1, 11],
- [5788, 1, 30, 2027, 10, 31], [5788, 7, 15, 2028, 4, 11], [5788, 9, 2, 2028, 5, 27], [5789, 12, 16, 2029, 8, 27],
- [5789, 2, 3, 2028, 10, 23], [5789, 8, 17, 2029, 5, 2], [5790, 3, 6, 2029, 11, 13], [5790, 10, 27, 2030, 6, 28],
- [5790, 12, 15, 2030, 8, 14]
-];
-
-describe('hebrew', () => {
-
- describe('toGregorian', () => {
- DATE_TABLE.forEach(element => {
- let hDate = new NgbDate(element[0], element[1], element[2]);
- let gDate = toGregorian(hDate);
- it('should convert correctly from Hebrew to Gregorian', () => {
- expect(
- new NgbDate(gDate.getFullYear(), gDate.getMonth() + 1, gDate.getDate())
- .equals(new NgbDate(element[3], element[4], element[5])))
- .toBeTruthy();
- });
- });
- });
-
- describe('fromGregorian', () => {
- DATE_TABLE.forEach(element => {
- const gDate = new Date(element[3], element[4] - 1, element[5]);
- let hDate = fromGregorian(gDate);
- it('should convert correctly from Gregorian to Hebrew',
- () => { expect(new NgbDate(element[0], element[1], element[2]).equals(hDate)).toBeTruthy(); });
- });
- });
-
- describe('hebrewNumerals', () => {
- it('should return Hebrew numerals', () => {
- expect(hebrewNumerals(3)).toEqual('ג׳');
- expect(hebrewNumerals(11)).toEqual('י״א');
- expect(hebrewNumerals(15)).toEqual('ט״ו');
- expect(hebrewNumerals(19)).toEqual('י״ט');
- expect(hebrewNumerals(5777)).toEqual('תשע״ז');
- });
- });
-});
diff --git a/backup/src/datepicker/hebrew/hebrew.ts b/backup/src/datepicker/hebrew/hebrew.ts
deleted file mode 100644
index 05b37e0..0000000
--- a/backup/src/datepicker/hebrew/hebrew.ts
+++ /dev/null
@@ -1,295 +0,0 @@
-import {NgbDate} from '../ngb-date';
-import {NgbDateStruct} from '../ngb-date-struct';
-
-const PARTS_PER_HOUR = 1080;
-const PARTS_PER_DAY = 24 * PARTS_PER_HOUR;
-const PARTS_FRACTIONAL_MONTH = 12 * PARTS_PER_HOUR + 793;
-const PARTS_PER_MONTH = 29 * PARTS_PER_DAY + PARTS_FRACTIONAL_MONTH;
-const BAHARAD = 11 * PARTS_PER_HOUR + 204;
-const HEBREW_DAY_ON_JAN_1_1970 = 2092591;
-const GREGORIAN_EPOCH = 1721425.5;
-
-function isGregorianLeapYear(year: number): boolean {
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
-}
-
-function numberOfFirstDayInYear(year: number): number {
- let monthsBeforeYear = Math.floor((235 * year - 234) / 19);
- let fractionalMonthsBeforeYear = monthsBeforeYear * PARTS_FRACTIONAL_MONTH + BAHARAD;
- let dayNumber = monthsBeforeYear * 29 + Math.floor(fractionalMonthsBeforeYear / PARTS_PER_DAY);
- let timeOfDay = fractionalMonthsBeforeYear % PARTS_PER_DAY;
-
- let dayOfWeek = dayNumber % 7; // 0 == Monday
-
- if (dayOfWeek === 2 || dayOfWeek === 4 || dayOfWeek === 6) {
- dayNumber++;
- dayOfWeek = dayNumber % 7;
- }
- if (dayOfWeek === 1 && timeOfDay > 15 * PARTS_PER_HOUR + 204 && !isHebrewLeapYear(year)) {
- dayNumber += 2;
- } else if (dayOfWeek === 0 && timeOfDay > 21 * PARTS_PER_HOUR + 589 && isHebrewLeapYear(year - 1)) {
- dayNumber++;
- }
- return dayNumber;
-}
-
-function getDaysInGregorianMonth(month: number, year: number): number {
- let days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if (isGregorianLeapYear(year)) {
- days[1]++;
- }
- return days[month - 1];
-}
-
-function getHebrewMonths(year: number): number {
- return isHebrewLeapYear(year) ? 13 : 12;
-}
-
-/**
- * Returns the number of days in a specific Hebrew year.
- * `year` is any Hebrew year.
- */
-function getDaysInHebrewYear(year: number): number {
- return numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
-}
-
-export function isHebrewLeapYear(year: number): boolean {
- let b = (year * 12 + 17) % 19;
- return b >= ((b < 0) ? -7 : 12);
-}
-
-/**
- * Returns the number of days in a specific Hebrew month.
- * `month` is 1 for Nisan, 2 for Iyar etc. Note: Hebrew leap year contains 13 months.
- * `year` is any Hebrew year.
- */
-export function getDaysInHebrewMonth(month: number, year: number): number {
- let yearLength = numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
- let yearType = (yearLength <= 380 ? yearLength : (yearLength - 30)) - 353;
- let leapYear = isHebrewLeapYear(year);
- let daysInMonth = leapYear ? [30, 29, 29, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29] :
- [30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 30, 29];
- if (yearType > 0) {
- daysInMonth[2]++; // Kislev gets an extra day in normal or complete years.
- }
- if (yearType > 1) {
- daysInMonth[1]++; // Heshvan gets an extra day in complete years only.
- }
- return daysInMonth[month - 1];
-}
-
-export function getDayNumberInHebrewYear(date: NgbDate): number {
- let numberOfDay = 0;
- for (let i = 1; i < date.month; i++) {
- numberOfDay += getDaysInHebrewMonth(i, date.year);
- }
- return numberOfDay + date.day;
-}
-
-export function setHebrewMonth(date: NgbDate, val: number): NgbDate {
- let after = val >= 0;
- if (!after) {
- val = -val;
- }
- while (val > 0) {
- if (after) {
- if (val > getHebrewMonths(date.year) - date.month) {
- val -= getHebrewMonths(date.year) - date.month + 1;
- date.year++;
- date.month = 1;
- } else {
- date.month += val;
- val = 0;
- }
- } else {
- if (val >= date.month) {
- date.year--;
- val -= date.month;
- date.month = getHebrewMonths(date.year);
- } else {
- date.month -= val;
- val = 0;
- }
- }
- }
- return date;
-}
-
-export function setHebrewDay(date: NgbDate, val: number): NgbDate {
- let after = val >= 0;
- if (!after) {
- val = -val;
- }
- while (val > 0) {
- if (after) {
- if (val > getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date)) {
- val -= getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date) + 1;
- date.year++;
- date.month = 1;
- date.day = 1;
- } else if (val > getDaysInHebrewMonth(date.month, date.year) - date.day) {
- val -= getDaysInHebrewMonth(date.month, date.year) - date.day + 1;
- date.month++;
- date.day = 1;
- } else {
- date.day += val;
- val = 0;
- }
- } else {
- if (val >= date.day) {
- val -= date.day;
- date.month--;
- if (date.month === 0) {
- date.year--;
- date.month = getHebrewMonths(date.year);
- }
- date.day = getDaysInHebrewMonth(date.month, date.year);
- } else {
- date.day -= val;
- val = 0;
- }
- }
- }
- return date;
-}
-
-/**
- * Returns the equivalent Hebrew date value for a give input Gregorian date.
- * `gdate` is a JS Date to be converted to Hebrew date.
- */
-export function fromGregorian(gdate: Date): NgbDate {
- const date = new Date(gdate);
- const gYear = date.getFullYear(), gMonth = date.getMonth(), gDay = date.getDate();
- let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) -
- Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
- Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gYear) ? -1 : -2) + gDay);
- julianDay = Math.floor(julianDay + 0.5);
- let daysSinceHebEpoch = julianDay - 347997;
- let monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);
- let hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;
- let firstDayOfThisYear = numberOfFirstDayInYear(hYear);
- let dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
- while (dayOfYear < 1) {
- hYear--;
- firstDayOfThisYear = numberOfFirstDayInYear(hYear);
- dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
- }
- let hMonth = 1;
- let hDay = dayOfYear;
- while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {
- hDay -= getDaysInHebrewMonth(hMonth, hYear);
- hMonth++;
- }
- return new NgbDate(hYear, hMonth, hDay);
-}
-
-/**
- * Returns the equivalent JS date value for a given Hebrew date.
- * `hebrewDate` is an Hebrew date to be converted to Gregorian.
- */
-export function toGregorian(hebrewDate: NgbDateStruct | NgbDate): Date {
- const hYear = hebrewDate.year;
- const hMonth = hebrewDate.month;
- const hDay = hebrewDate.day;
- let days = numberOfFirstDayInYear(hYear);
- for (let i = 1; i < hMonth; i++) {
- days += getDaysInHebrewMonth(i, hYear);
- }
- days += hDay;
- let diffDays = days - HEBREW_DAY_ON_JAN_1_1970;
- let after = diffDays >= 0;
- if (!after) {
- diffDays = -diffDays;
- }
- let gYear = 1970;
- let gMonth = 1;
- let gDay = 1;
- while (diffDays > 0) {
- if (after) {
- if (diffDays >= (isGregorianLeapYear(gYear) ? 366 : 365)) {
- diffDays -= isGregorianLeapYear(gYear) ? 366 : 365;
- gYear++;
- } else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
- diffDays -= getDaysInGregorianMonth(gMonth, gYear);
- gMonth++;
- } else {
- gDay += diffDays;
- diffDays = 0;
- }
- } else {
- if (diffDays >= (isGregorianLeapYear(gYear - 1) ? 366 : 365)) {
- diffDays -= isGregorianLeapYear(gYear - 1) ? 366 : 365;
- gYear--;
- } else {
- if (gMonth > 1) {
- gMonth--;
- } else {
- gMonth = 12;
- gYear--;
- }
- if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
- diffDays -= getDaysInGregorianMonth(gMonth, gYear);
- } else {
- gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;
- diffDays = 0;
- }
- }
- }
- }
- return new Date(gYear, gMonth - 1, gDay);
-}
-
-export function hebrewNumerals(numerals: number): string {
- if (!numerals) {
- return '';
- }
- const hArray0_9 = ['', '\u05d0', '\u05d1', '\u05d2', '\u05d3', '\u05d4', '\u05d5', '\u05d6', '\u05d7', '\u05d8'];
- const hArray10_19 = [
- '\u05d9', '\u05d9\u05d0', '\u05d9\u05d1', '\u05d9\u05d2', '\u05d9\u05d3', '\u05d8\u05d5', '\u05d8\u05d6',
- '\u05d9\u05d6', '\u05d9\u05d7', '\u05d9\u05d8'
- ];
- const hArray20_90 = ['', '', '\u05db', '\u05dc', '\u05de', '\u05e0', '\u05e1', '\u05e2', '\u05e4', '\u05e6'];
- const hArray100_900 = [
- '', '\u05e7', '\u05e8', '\u05e9', '\u05ea', '\u05ea\u05e7', '\u05ea\u05e8', '\u05ea\u05e9', '\u05ea\u05ea',
- '\u05ea\u05ea\u05e7'
- ];
- const hArray1000_9000 = [
- '', '\u05d0', '\u05d1', '\u05d1\u05d0', '\u05d1\u05d1', '\u05d4', '\u05d4\u05d0', '\u05d4\u05d1',
- '\u05d4\u05d1\u05d0', '\u05d4\u05d1\u05d1'
- ];
- const geresh = '\u05f3', gershaim = '\u05f4';
- let mem = 0;
- let result = [];
- let step = 0;
- while (numerals > 0) {
- let m = numerals % 10;
- if (step === 0) {
- mem = m;
- } else if (step === 1) {
- if (m !== 1) {
- result.unshift(hArray20_90[m], hArray0_9[mem]);
- } else {
- result.unshift(hArray10_19[mem]);
- }
- } else if (step === 2) {
- result.unshift(hArray100_900[m]);
- } else {
- if (m !== 5) {
- result.unshift(hArray1000_9000[m], geresh, ' ');
- }
- break;
- }
- numerals = Math.floor(numerals / 10);
- if (step === 0 && numerals === 0) {
- result.unshift(hArray0_9[m]);
- }
- step++;
- }
- result = result.join('').split('');
- if (result.length === 1) {
- result.push(geresh);
- } else if (result.length > 1) {
- result.splice(result.length - 1, 0, gershaim);
- }
- return result.join('');
-}
diff --git a/backup/src/datepicker/hebrew/ngb-calendar-hebrew.spec.ts b/backup/src/datepicker/hebrew/ngb-calendar-hebrew.spec.ts
deleted file mode 100644
index a25bb8b..0000000
--- a/backup/src/datepicker/hebrew/ngb-calendar-hebrew.spec.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import {NgbCalendarHebrew} from './ngb-calendar-hebrew';
-import {NgbDate} from '../ngb-date';
-
-describe('ngb-calendar-hebrew', () => {
-
- let calendar: NgbCalendarHebrew;
-
- beforeEach(() => { calendar = new NgbCalendarHebrew(); });
-
- it('should return number of days per week', () => { expect(calendar.getDaysPerWeek()).toBe(7); });
-
- it('should return number of weeks per month', () => { expect(calendar.getWeeksPerMonth()).toBe(6); });
-
- it('should return months of a year', () => {
- expect(calendar.getMonths(5770)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5771)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- expect(calendar.getMonths(5772)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5773)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5774)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- expect(calendar.getMonths(5775)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5776)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- expect(calendar.getMonths(5777)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5778)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- expect(calendar.getMonths(5779)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
- expect(calendar.getMonths(5780)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it('should return day of week', () => {
- expect(calendar.getWeekday(new NgbDate(5777, 10, 8))).toEqual(7);
- expect(calendar.getWeekday(new NgbDate(5771, 4, 6))).toEqual(1);
- expect(calendar.getWeekday(new NgbDate(5779, 1, 30))).toEqual(2);
- expect(calendar.getWeekday(new NgbDate(5774, 7, 17))).toEqual(3);
- expect(calendar.getWeekday(new NgbDate(5778, 12, 5))).toEqual(4);
- expect(calendar.getWeekday(new NgbDate(5775, 3, 27))).toEqual(5);
- expect(calendar.getWeekday(new NgbDate(5774, 13, 18))).toEqual(6);
- });
-
- it('should add days to date', () => {
- expect(calendar.getNext(new NgbDate(5776, 2, 29))).toEqual(new NgbDate(5776, 2, 30));
- expect(calendar.getNext(new NgbDate(5777, 3, 29))).toEqual(new NgbDate(5777, 4, 1));
- expect(calendar.getNext(new NgbDate(5779, 12, 30))).toEqual(new NgbDate(5779, 13, 1));
- });
-
- it('should subtract days from date', () => {
- expect(calendar.getPrev(new NgbDate(5766, 1, 1))).toEqual(new NgbDate(5765, 13, 29));
- expect(calendar.getPrev(new NgbDate(5781, 4, 1))).toEqual(new NgbDate(5781, 3, 29));
- expect(calendar.getPrev(new NgbDate(5780, 3, 1))).toEqual(new NgbDate(5780, 2, 30));
- });
-
- it('should add months to date', () => {
- expect(calendar.getNext(new NgbDate(5778, 12, 18), 'm')).toEqual(new NgbDate(5779, 1, 1));
- expect(calendar.getNext(new NgbDate(5771, 12, 2), 'm')).toEqual(new NgbDate(5771, 13, 1));
- expect(calendar.getNext(new NgbDate(5765, 5, 26), 'm')).toEqual(new NgbDate(5765, 6, 1));
- });
-
- it('should subtract months from date', () => {
- expect(calendar.getPrev(new NgbDate(5779, 1, 14), 'm')).toEqual(new NgbDate(5778, 12, 1));
- expect(calendar.getPrev(new NgbDate(5772, 1, 25), 'm')).toEqual(new NgbDate(5771, 13, 1));
- expect(calendar.getPrev(new NgbDate(5765, 6, 8), 'm')).toEqual(new NgbDate(5765, 5, 1));
- });
-
- it('should add years to date', () => {
- expect(calendar.getNext(new NgbDate(5770, 12, 24), 'y')).toEqual(new NgbDate(5771, 1, 1));
- expect(calendar.getNext(new NgbDate(5771, 4, 11), 'y')).toEqual(new NgbDate(5772, 1, 1));
- });
-
- it('should subtract years from date', () => {
- expect(calendar.getPrev(new NgbDate(5777, 12, 1), 'y')).toEqual(new NgbDate(5776, 1, 1));
- expect(calendar.getPrev(new NgbDate(5779, 2, 18), 'y')).toEqual(new NgbDate(5778, 1, 1));
- });
-
- it('should return week number', () => {
- let week = [
- new NgbDate(5776, 13, 29), new NgbDate(5777, 1, 1), new NgbDate(5777, 1, 2), new NgbDate(5777, 1, 3),
- new NgbDate(5777, 1, 4), new NgbDate(5777, 1, 5), new NgbDate(5777, 1, 6)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(1);
- week = [
- new NgbDate(5777, 7, 13), new NgbDate(5777, 7, 14), new NgbDate(5777, 7, 15), new NgbDate(5777, 7, 16),
- new NgbDate(5777, 7, 17), new NgbDate(5777, 7, 18), new NgbDate(5777, 7, 19)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(28);
- week = [
- new NgbDate(5777, 12, 26), new NgbDate(5777, 12, 27), new NgbDate(5777, 12, 28), new NgbDate(5777, 12, 29),
- new NgbDate(5778, 1, 1), new NgbDate(5778, 1, 2), new NgbDate(5778, 1, 3)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(1);
- });
-
-});
diff --git a/backup/src/datepicker/hebrew/ngb-calendar-hebrew.ts b/backup/src/datepicker/hebrew/ngb-calendar-hebrew.ts
deleted file mode 100644
index 608b960..0000000
--- a/backup/src/datepicker/hebrew/ngb-calendar-hebrew.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-import {NgbDate} from '../ngb-date';
-import {fromJSDate, NgbCalendar, NgbPeriod, toJSDate} from '../ngb-calendar';
-import {Injectable} from '@angular/core';
-import {isNumber} from '../../util/util';
-import {
- fromGregorian,
- getDayNumberInHebrewYear,
- getDaysInHebrewMonth,
- isHebrewLeapYear,
- toGregorian,
- setHebrewDay,
- setHebrewMonth
-} from './hebrew';
-
-/**
- * @since 3.2.0
- */
-@Injectable()
-export class NgbCalendarHebrew extends NgbCalendar {
- getDaysPerWeek() { return 7; }
-
- getMonths(year?: number) {
- if (year && isHebrewLeapYear(year)) {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
- } else {
- return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
- }
- }
-
- getWeeksPerMonth() { return 6; }
-
- isValid(date: NgbDate): boolean {
- let b = date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day);
- b = b && date.month > 0 && date.month <= (isHebrewLeapYear(date.year) ? 13 : 12);
- b = b && date.day > 0 && date.day <= getDaysInHebrewMonth(date.month, date.year);
- return b && !isNaN(toGregorian(date).getTime());
- }
-
- getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {
- date = new NgbDate(date.year, date.month, date.day);
-
- switch (period) {
- case 'y':
- date.year += number;
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = setHebrewMonth(date, number);
- date.day = 1;
- return date;
- case 'd':
- return setHebrewDay(date, number);
- default:
- return date;
- }
- }
-
- getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }
-
- getWeekday(date: NgbDate) {
- const day = toGregorian(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- }
-
- getWeekNumber(week: NgbDate[], firstDayOfWeek: number) {
- const date = week[week.length - 1];
- return Math.ceil(getDayNumberInHebrewYear(date) / 7);
- }
-
- getToday(): NgbDate { return fromGregorian(new Date()); }
-
- /**
- * @since 3.4.0
- */
- toGregorian(date: NgbDate): NgbDate { return fromJSDate(toGregorian(date)); }
-
- /**
- * @since 3.4.0
- */
- fromGregorian(date: NgbDate): NgbDate { return fromGregorian(toJSDate(date)); }
-}
diff --git a/backup/src/datepicker/hijri/ngb-calendar-hijri.ts b/backup/src/datepicker/hijri/ngb-calendar-hijri.ts
deleted file mode 100644
index b365f03..0000000
--- a/backup/src/datepicker/hijri/ngb-calendar-hijri.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-import {NgbDate} from '../ngb-date';
-import {NgbPeriod, NgbCalendar} from '../ngb-calendar';
-import {Injectable} from '@angular/core';
-import {isNumber} from '../../util/util';
-
-@Injectable()
-export abstract class NgbCalendarHijri extends NgbCalendar {
- /**
- * Returns the number of days in a specific Hijri month.
- * `month` is 1 for Muharram, 2 for Safar, etc.
- * `year` is any Hijri year.
- */
- abstract getDaysPerMonth(month: number, year: number): number;
-
- /**
- * Returns the equivalent Hijri date value for a give input Gregorian date.
- * `gDate` is s JS Date to be converted to Hijri.
- */
- abstract fromGregorian(gDate: Date): NgbDate;
-
- /**
- * Converts the current Hijri date to Gregorian.
- */
- abstract toGregorian(hDate: NgbDate): Date;
-
- getDaysPerWeek() { return 7; }
-
- getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }
-
- getWeeksPerMonth() { return 6; }
-
- getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {
- date = new NgbDate(date.year, date.month, date.day);
-
- switch (period) {
- case 'y':
- date = this._setYear(date, date.year + number);
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = this._setMonth(date, date.month + number);
- date.day = 1;
- return date;
- case 'd':
- return this._setDay(date, date.day + number);
- default:
- return date;
- }
- }
-
- getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }
-
- getWeekday(date: NgbDate) {
- const day = this.toGregorian(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- }
-
- getWeekNumber(week: NgbDate[], firstDayOfWeek: number) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
-
- const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- const date = week[thursdayIndex];
-
- const jsDate = this.toGregorian(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- const time = jsDate.getTime();
- const MuhDate = this.toGregorian(new NgbDate(date.year, 1, 1)); // Compare with Muharram 1
- return Math.floor(Math.round((time - MuhDate.getTime()) / 86400000) / 7) + 1;
- }
-
- getToday(): NgbDate { return this.fromGregorian(new Date()); }
-
-
- isValid(date: NgbDate): boolean {
- return date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day) &&
- !isNaN(this.toGregorian(date).getTime());
- }
-
- private _setDay(date: NgbDate, day: number): NgbDate {
- day = +day;
- let mDays = this.getDaysPerMonth(date.month, date.year);
- if (day <= 0) {
- while (day <= 0) {
- date = this._setMonth(date, date.month - 1);
- mDays = this.getDaysPerMonth(date.month, date.year);
- day += mDays;
- }
- } else if (day > mDays) {
- while (day > mDays) {
- day -= mDays;
- date = this._setMonth(date, date.month + 1);
- mDays = this.getDaysPerMonth(date.month, date.year);
- }
- }
- date.day = day;
- return date;
- }
-
- private _setMonth(date: NgbDate, month: number): NgbDate {
- month = +month;
- date.year = date.year + Math.floor((month - 1) / 12);
- date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
- return date;
- }
-
- private _setYear(date: NgbDate, year: number): NgbDate {
- date.year = +year;
- return date;
- }
-}
diff --git a/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.spec.ts b/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.spec.ts
deleted file mode 100644
index cdf1990..0000000
--- a/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.spec.ts
+++ /dev/null
@@ -1,434 +0,0 @@
-import {NgbCalendarIslamicCivil} from './ngb-calendar-islamic-civil';
-import {NgbDate} from '../ngb-date';
-
-describe('ngb-calendar-islamic-civil', () => {
- const DATE_TABLE = [
- [1420, 1, 1, 1999, 3, 17], [1420, 1, 12, 1999, 3, 28], [1420, 1, 23, 1999, 4, 9],
- [1420, 2, 4, 1999, 4, 20], [1420, 2, 15, 1999, 4, 31], [1420, 2, 26, 1999, 5, 11],
- [1420, 3, 8, 1999, 5, 22], [1420, 3, 19, 1999, 6, 3], [1420, 3, 30, 1999, 6, 14],
- [1420, 4, 11, 1999, 6, 25], [1420, 4, 22, 1999, 7, 5], [1420, 5, 4, 1999, 7, 16],
- [1420, 5, 15, 1999, 7, 27], [1420, 5, 26, 1999, 8, 7], [1420, 6, 7, 1999, 8, 18],
- [1420, 6, 18, 1999, 8, 29], [1420, 6, 29, 1999, 9, 10], [1420, 7, 11, 1999, 9, 21],
- [1420, 7, 22, 1999, 10, 1], [1420, 8, 3, 1999, 10, 12], [1420, 8, 14, 1999, 10, 23],
- [1420, 9, 29, 2000, 0, 6], [1420, 10, 10, 2000, 0, 17], [1420, 10, 21, 2000, 0, 28],
- [1420, 11, 3, 2000, 1, 8], [1420, 11, 14, 2000, 1, 19], [1420, 11, 25, 2000, 2, 1],
- [1420, 12, 6, 2000, 2, 12], [1420, 12, 17, 2000, 2, 23], [1420, 12, 28, 2000, 3, 3],
- [1421, 1, 9, 2000, 3, 14], [1421, 1, 20, 2000, 3, 25], [1421, 2, 1, 2000, 4, 6],
- [1421, 2, 12, 2000, 4, 17], [1421, 2, 23, 2000, 4, 28], [1421, 3, 5, 2000, 5, 8],
- [1421, 3, 16, 2000, 5, 19], [1421, 3, 27, 2000, 5, 30], [1421, 4, 8, 2000, 6, 11],
- [1421, 4, 19, 2000, 6, 22], [1421, 5, 1, 2000, 7, 2], [1421, 5, 12, 2000, 7, 13],
- [1421, 5, 23, 2000, 7, 24], [1421, 6, 4, 2000, 8, 4], [1421, 6, 15, 2000, 8, 15],
- [1421, 6, 26, 2000, 8, 26], [1421, 7, 8, 2000, 9, 7], [1421, 7, 19, 2000, 9, 18],
- [1421, 7, 30, 2000, 9, 29], [1421, 8, 11, 2000, 10, 9], [1421, 8, 22, 2000, 10, 20],
- [1421, 10, 7, 2001, 0, 3], [1421, 10, 18, 2001, 0, 14], [1421, 10, 7, 2001, 0, 3],
- [1421, 10, 18, 2001, 0, 14], [1421, 10, 29, 2001, 0, 25], [1421, 11, 11, 2001, 1, 5],
- [1421, 11, 22, 2001, 1, 16], [1421, 12, 3, 2001, 1, 27], [1421, 12, 14, 2001, 2, 10],
- [1421, 12, 25, 2001, 2, 21], [1422, 1, 7, 2001, 3, 1], [1422, 1, 18, 2001, 3, 12],
- [1422, 1, 29, 2001, 3, 23], [1422, 2, 10, 2001, 4, 4], [1422, 2, 21, 2001, 4, 15],
- [1422, 3, 3, 2001, 4, 26], [1422, 3, 14, 2001, 5, 6], [1422, 3, 25, 2001, 5, 17],
- [1422, 4, 6, 2001, 5, 28], [1422, 4, 17, 2001, 6, 9], [1422, 4, 28, 2001, 6, 20],
- [1422, 5, 10, 2001, 6, 31], [1422, 5, 21, 2001, 7, 11], [1422, 6, 2, 2001, 7, 22],
- [1422, 6, 13, 2001, 8, 2], [1422, 6, 24, 2001, 8, 13], [1422, 7, 6, 2001, 8, 24],
- [1422, 7, 17, 2001, 9, 5], [1422, 7, 28, 2001, 9, 16], [1422, 8, 9, 2001, 9, 27],
- [1422, 8, 20, 2001, 10, 7], [1422, 9, 2, 2001, 10, 18], [1422, 9, 13, 2001, 10, 29],
- [1422, 9, 24, 2001, 11, 10], [1422, 10, 5, 2001, 11, 21], [1422, 10, 16, 2002, 0, 1],
- [1422, 10, 27, 2002, 0, 12], [1422, 11, 9, 2002, 0, 23], [1422, 11, 20, 2002, 1, 3],
- [1422, 12, 1, 2002, 1, 14], [1422, 12, 12, 2002, 1, 25], [1422, 12, 23, 2002, 2, 8],
- [1423, 1, 5, 2002, 2, 19], [1423, 1, 16, 2002, 2, 30], [1423, 1, 27, 2002, 3, 10],
- [1423, 2, 8, 2002, 3, 21], [1423, 2, 19, 2002, 4, 2], [1423, 3, 1, 2002, 4, 13],
- [1423, 3, 12, 2002, 4, 24], [1423, 3, 23, 2002, 5, 4], [1423, 4, 4, 2002, 5, 15],
- [1423, 4, 15, 2002, 5, 26], [1423, 4, 26, 2002, 6, 7], [1423, 5, 8, 2002, 6, 18],
- [1423, 5, 19, 2002, 6, 29], [1423, 5, 30, 2002, 7, 9], [1423, 6, 11, 2002, 7, 20],
- [1423, 6, 22, 2002, 7, 31], [1423, 7, 4, 2002, 8, 11], [1423, 7, 15, 2002, 8, 22],
- [1423, 7, 26, 2002, 9, 3], [1423, 8, 7, 2002, 9, 14], [1423, 8, 18, 2002, 9, 25],
- [1423, 8, 29, 2002, 10, 5], [1423, 9, 11, 2002, 10, 16], [1423, 9, 22, 2002, 10, 27],
- [1423, 10, 3, 2002, 11, 8], [1423, 10, 14, 2002, 11, 19], [1423, 10, 25, 2002, 11, 30],
- [1423, 11, 7, 2003, 0, 10], [1423, 11, 18, 2003, 0, 21], [1423, 11, 29, 2003, 1, 1],
- [1423, 12, 10, 2003, 1, 12], [1423, 12, 21, 2003, 1, 23], [1424, 1, 2, 2003, 2, 6],
- [1424, 1, 13, 2003, 2, 17], [1424, 1, 24, 2003, 2, 28], [1424, 2, 5, 2003, 3, 8],
- [1424, 2, 16, 2003, 3, 19], [1424, 2, 27, 2003, 3, 30], [1424, 3, 9, 2003, 4, 11],
- [1424, 3, 20, 2003, 4, 22], [1424, 4, 1, 2003, 5, 2], [1424, 4, 12, 2003, 5, 13],
- [1424, 4, 23, 2003, 5, 24], [1424, 5, 5, 2003, 6, 5], [1424, 5, 16, 2003, 6, 16],
- [1424, 5, 27, 2003, 6, 27], [1424, 6, 8, 2003, 7, 7], [1424, 6, 19, 2003, 7, 18],
- [1424, 7, 1, 2003, 7, 29], [1424, 7, 12, 2003, 8, 9], [1424, 7, 23, 2003, 8, 20],
- [1424, 8, 4, 2003, 9, 1], [1424, 8, 15, 2003, 9, 12], [1424, 8, 26, 2003, 9, 23],
- [1424, 9, 8, 2003, 10, 3], [1424, 9, 19, 2003, 10, 14], [1424, 9, 30, 2003, 10, 25],
- [1424, 11, 15, 2004, 0, 8], [1424, 11, 26, 2004, 0, 19], [1424, 12, 7, 2004, 0, 30],
- [1424, 12, 18, 2004, 1, 10], [1424, 12, 29, 2004, 1, 21], [1425, 1, 11, 2004, 2, 3],
- [1425, 1, 22, 2004, 2, 14], [1425, 2, 3, 2004, 2, 25], [1425, 2, 14, 2004, 3, 5],
- [1425, 2, 25, 2004, 3, 16], [1425, 3, 7, 2004, 3, 27], [1425, 3, 18, 2004, 4, 8],
- [1425, 3, 29, 2004, 4, 19], [1425, 4, 10, 2004, 4, 30], [1425, 4, 21, 2004, 5, 10],
- [1425, 5, 3, 2004, 5, 21], [1425, 5, 14, 2004, 6, 2], [1425, 5, 25, 2004, 6, 13],
- [1425, 6, 6, 2004, 6, 24], [1425, 6, 17, 2004, 7, 4], [1425, 6, 28, 2004, 7, 15],
- [1425, 7, 10, 2004, 7, 26], [1425, 7, 21, 2004, 8, 6], [1425, 8, 2, 2004, 8, 17],
- [1425, 8, 13, 2004, 8, 28], [1425, 8, 24, 2004, 9, 9], [1425, 9, 6, 2004, 9, 20],
- [1425, 9, 17, 2004, 9, 31], [1425, 9, 28, 2004, 10, 11], [1425, 10, 9, 2004, 10, 22],
- [1425, 11, 24, 2005, 0, 5], [1425, 12, 5, 2005, 0, 16], [1425, 12, 16, 2005, 0, 27],
- [1425, 12, 27, 2005, 1, 7], [1426, 1, 9, 2005, 1, 18], [1426, 1, 20, 2005, 2, 1],
- [1426, 2, 1, 2005, 2, 12], [1426, 2, 12, 2005, 2, 23], [1426, 2, 23, 2005, 3, 3],
- [1426, 3, 5, 2005, 3, 14], [1426, 3, 16, 2005, 3, 25], [1426, 3, 27, 2005, 4, 6],
- [1426, 4, 8, 2005, 4, 17], [1426, 4, 19, 2005, 4, 28], [1426, 5, 1, 2005, 5, 8],
- [1426, 5, 12, 2005, 5, 19], [1426, 5, 23, 2005, 5, 30], [1426, 6, 4, 2005, 6, 11],
- [1426, 6, 15, 2005, 6, 22], [1426, 6, 26, 2005, 7, 2], [1426, 7, 8, 2005, 7, 13],
- [1426, 7, 19, 2005, 7, 24], [1426, 7, 30, 2005, 8, 4], [1426, 8, 11, 2005, 8, 15],
- [1426, 8, 22, 2005, 8, 26], [1426, 9, 4, 2005, 9, 7], [1426, 9, 15, 2005, 9, 18],
- [1426, 9, 26, 2005, 9, 29], [1426, 10, 7, 2005, 10, 9], [1426, 10, 18, 2005, 10, 20],
- [1426, 10, 29, 2005, 11, 1], [1426, 11, 11, 2005, 11, 12], [1426, 11, 22, 2005, 11, 23],
- [1426, 12, 3, 2006, 0, 3], [1426, 12, 14, 2006, 0, 14], [1426, 12, 25, 2006, 0, 25],
- [1427, 1, 6, 2006, 1, 5], [1427, 1, 17, 2006, 1, 16], [1427, 1, 28, 2006, 1, 27],
- [1427, 2, 9, 2006, 2, 10], [1427, 2, 20, 2006, 2, 21], [1427, 3, 2, 2006, 3, 1],
- [1427, 3, 13, 2006, 3, 12], [1427, 3, 24, 2006, 3, 23], [1427, 4, 5, 2006, 4, 4],
- [1427, 4, 16, 2006, 4, 15], [1427, 4, 27, 2006, 4, 26], [1427, 5, 9, 2006, 5, 6],
- [1427, 5, 20, 2006, 5, 17], [1427, 6, 1, 2006, 5, 28], [1427, 6, 12, 2006, 6, 9],
- [1427, 6, 23, 2006, 6, 20], [1427, 7, 5, 2006, 6, 31], [1427, 7, 16, 2006, 7, 11],
- [1427, 7, 27, 2006, 7, 22], [1427, 8, 8, 2006, 8, 2], [1427, 8, 19, 2006, 8, 13],
- [1427, 9, 1, 2006, 8, 24], [1427, 9, 12, 2006, 9, 5], [1427, 9, 23, 2006, 9, 16],
- [1427, 10, 4, 2006, 9, 27], [1427, 10, 15, 2006, 10, 7], [1427, 10, 26, 2006, 10, 18],
- [1427, 11, 8, 2006, 10, 29], [1427, 11, 19, 2006, 11, 10], [1427, 11, 30, 2006, 11, 21],
- [1427, 12, 11, 2007, 0, 1], [1427, 12, 22, 2007, 0, 12], [1428, 1, 4, 2007, 0, 23],
- [1428, 1, 15, 2007, 1, 3], [1428, 1, 26, 2007, 1, 14], [1428, 2, 7, 2007, 1, 25],
- [1428, 2, 18, 2007, 2, 8], [1428, 2, 29, 2007, 2, 19], [1428, 3, 11, 2007, 2, 30],
- [1428, 3, 22, 2007, 3, 10], [1428, 4, 3, 2007, 3, 21], [1428, 4, 14, 2007, 4, 2],
- [1428, 4, 25, 2007, 4, 13], [1428, 5, 7, 2007, 4, 24], [1428, 5, 18, 2007, 5, 4],
- [1428, 5, 29, 2007, 5, 15], [1428, 6, 10, 2007, 5, 26], [1428, 6, 21, 2007, 6, 7],
- [1428, 7, 3, 2007, 6, 18], [1428, 7, 14, 2007, 6, 29], [1428, 7, 25, 2007, 7, 9],
- [1428, 8, 6, 2007, 7, 20], [1428, 8, 17, 2007, 7, 31], [1428, 8, 28, 2007, 8, 11],
- [1428, 9, 10, 2007, 8, 22], [1428, 9, 21, 2007, 9, 3], [1428, 10, 2, 2007, 9, 14],
- [1428, 10, 13, 2007, 9, 25], [1428, 10, 24, 2007, 10, 5], [1428, 11, 6, 2007, 10, 16],
- [1428, 11, 17, 2007, 10, 27], [1429, 1, 1, 2008, 0, 10], [1429, 1, 12, 2008, 0, 21],
- [1429, 1, 23, 2008, 1, 1], [1429, 2, 4, 2008, 1, 12], [1429, 2, 15, 2008, 1, 23],
- [1429, 2, 26, 2008, 2, 5], [1429, 3, 8, 2008, 2, 16], [1429, 3, 19, 2008, 2, 27],
- [1429, 3, 30, 2008, 3, 7], [1429, 4, 11, 2008, 3, 18], [1429, 4, 22, 2008, 3, 29],
- [1429, 5, 4, 2008, 4, 10], [1429, 5, 15, 2008, 4, 21], [1429, 5, 26, 2008, 5, 1],
- [1429, 6, 7, 2008, 5, 12], [1429, 6, 18, 2008, 5, 23], [1429, 6, 29, 2008, 6, 4],
- [1429, 7, 11, 2008, 6, 15], [1429, 7, 22, 2008, 6, 26], [1429, 8, 3, 2008, 7, 6],
- [1429, 8, 14, 2008, 7, 17], [1429, 8, 25, 2008, 7, 28], [1429, 9, 7, 2008, 8, 8],
- [1429, 9, 18, 2008, 8, 19], [1429, 9, 29, 2008, 8, 30], [1429, 10, 10, 2008, 9, 11],
- [1429, 10, 21, 2008, 9, 22], [1429, 11, 3, 2008, 10, 2], [1429, 11, 14, 2008, 10, 13],
- [1429, 11, 25, 2008, 10, 24], [1430, 1, 10, 2009, 0, 7], [1430, 1, 21, 2009, 0, 18],
- [1430, 2, 2, 2009, 0, 29], [1430, 2, 13, 2009, 1, 9], [1430, 2, 24, 2009, 1, 20],
- [1430, 3, 6, 2009, 2, 3], [1430, 3, 17, 2009, 2, 14], [1430, 3, 28, 2009, 2, 25],
- [1430, 4, 9, 2009, 3, 5], [1430, 4, 20, 2009, 3, 16], [1430, 5, 2, 2009, 3, 27],
- [1430, 5, 13, 2009, 4, 8], [1430, 5, 24, 2009, 4, 19], [1430, 6, 5, 2009, 4, 30],
- [1430, 6, 16, 2009, 5, 10], [1430, 6, 27, 2009, 5, 21], [1430, 7, 9, 2009, 6, 2],
- [1430, 7, 20, 2009, 6, 13], [1430, 8, 1, 2009, 6, 24], [1430, 8, 12, 2009, 7, 4],
- [1430, 8, 23, 2009, 7, 15], [1430, 9, 5, 2009, 7, 26], [1430, 9, 16, 2009, 8, 6],
- [1430, 9, 27, 2009, 8, 17], [1430, 10, 8, 2009, 8, 28], [1430, 10, 19, 2009, 9, 9],
- [1430, 11, 1, 2009, 9, 20], [1430, 11, 12, 2009, 9, 31], [1430, 11, 23, 2009, 10, 11],
- [1430, 12, 4, 2009, 10, 22], [1430, 12, 15, 2009, 11, 3], [1430, 12, 26, 2009, 11, 14],
- [1431, 1, 8, 2009, 11, 25], [1431, 1, 19, 2010, 0, 5], [1431, 1, 30, 2010, 0, 16],
- [1431, 2, 11, 2010, 0, 27], [1431, 2, 22, 2010, 1, 7], [1431, 3, 4, 2010, 1, 18],
- [1431, 3, 15, 2010, 2, 1], [1431, 3, 26, 2010, 2, 12], [1431, 4, 7, 2010, 2, 23],
- [1431, 4, 18, 2010, 3, 3], [1431, 4, 29, 2010, 3, 14], [1431, 5, 11, 2010, 3, 25],
- [1431, 5, 22, 2010, 4, 6], [1431, 6, 3, 2010, 4, 17], [1431, 6, 14, 2010, 4, 28],
- [1431, 6, 25, 2010, 5, 8], [1431, 7, 7, 2010, 5, 19], [1431, 7, 18, 2010, 5, 30],
- [1431, 7, 29, 2010, 6, 11], [1431, 8, 10, 2010, 6, 22], [1431, 8, 21, 2010, 7, 2],
- [1431, 9, 3, 2010, 7, 13], [1431, 9, 14, 2010, 7, 24], [1431, 9, 25, 2010, 8, 4],
- [1431, 10, 6, 2010, 8, 15], [1431, 10, 17, 2010, 8, 26], [1431, 10, 28, 2010, 9, 7],
- [1431, 11, 10, 2010, 9, 18], [1431, 11, 21, 2010, 9, 29], [1431, 12, 2, 2010, 10, 9],
- [1431, 12, 13, 2010, 10, 20], [1431, 12, 24, 2010, 11, 1], [1432, 1, 5, 2010, 11, 12],
- [1432, 1, 16, 2010, 11, 23], [1432, 1, 27, 2011, 0, 3], [1432, 2, 8, 2011, 0, 14],
- [1432, 2, 19, 2011, 0, 25], [1432, 3, 1, 2011, 1, 5], [1432, 3, 12, 2011, 1, 16],
- [1432, 3, 23, 2011, 1, 27], [1432, 4, 4, 2011, 2, 10], [1432, 4, 15, 2011, 2, 21],
- [1432, 4, 26, 2011, 3, 1], [1432, 5, 8, 2011, 3, 12], [1432, 5, 19, 2011, 3, 23],
- [1432, 5, 30, 2011, 4, 4], [1432, 6, 11, 2011, 4, 15], [1432, 6, 22, 2011, 4, 26],
- [1432, 7, 4, 2011, 5, 6], [1432, 7, 15, 2011, 5, 17], [1432, 7, 26, 2011, 5, 28],
- [1432, 8, 7, 2011, 6, 9], [1432, 8, 18, 2011, 6, 20], [1432, 8, 29, 2011, 6, 31],
- [1432, 9, 11, 2011, 7, 11], [1432, 9, 22, 2011, 7, 22], [1432, 10, 3, 2011, 8, 2],
- [1432, 10, 14, 2011, 8, 13], [1432, 10, 25, 2011, 8, 24], [1432, 11, 7, 2011, 9, 5],
- [1432, 11, 18, 2011, 9, 16], [1432, 11, 29, 2011, 9, 27], [1432, 12, 10, 2011, 10, 7],
- [1432, 12, 21, 2011, 10, 18], [1433, 1, 3, 2011, 10, 29], [1433, 2, 6, 2012, 0, 1],
- [1433, 2, 17, 2012, 0, 12], [1433, 2, 28, 2012, 0, 23], [1433, 3, 10, 2012, 1, 3],
- [1433, 3, 21, 2012, 1, 14], [1433, 4, 2, 2012, 1, 25], [1433, 4, 13, 2012, 2, 7],
- [1433, 4, 24, 2012, 2, 18], [1433, 5, 6, 2012, 2, 29], [1433, 5, 17, 2012, 3, 9],
- [1433, 5, 28, 2012, 3, 20], [1433, 6, 9, 2012, 4, 1], [1433, 6, 20, 2012, 4, 12],
- [1433, 7, 2, 2012, 4, 23], [1433, 7, 13, 2012, 5, 3], [1433, 7, 24, 2012, 5, 14],
- [1433, 8, 5, 2012, 5, 25], [1433, 8, 16, 2012, 6, 6], [1433, 8, 27, 2012, 6, 17],
- [1433, 9, 9, 2012, 6, 28], [1433, 9, 20, 2012, 7, 8], [1433, 10, 1, 2012, 7, 19],
- [1433, 10, 12, 2012, 7, 30], [1433, 10, 23, 2012, 8, 10], [1433, 11, 5, 2012, 8, 21],
- [1433, 11, 16, 2012, 9, 2], [1433, 11, 27, 2012, 9, 13], [1433, 12, 8, 2012, 9, 24],
- [1433, 12, 19, 2012, 10, 4], [1434, 1, 1, 2012, 10, 15], [1434, 1, 12, 2012, 10, 26],
- [1434, 2, 26, 2013, 0, 9], [1434, 3, 8, 2013, 0, 20], [1434, 3, 19, 2013, 0, 31],
- [1434, 3, 30, 2013, 1, 11], [1434, 4, 11, 2013, 1, 22], [1434, 4, 22, 2013, 2, 5],
- [1434, 5, 4, 2013, 2, 16], [1434, 5, 15, 2013, 2, 27], [1434, 5, 26, 2013, 3, 7],
- [1434, 6, 7, 2013, 3, 18], [1434, 6, 18, 2013, 3, 29], [1434, 6, 29, 2013, 4, 10],
- [1434, 7, 11, 2013, 4, 21], [1434, 7, 22, 2013, 5, 1], [1434, 8, 3, 2013, 5, 12],
- [1434, 8, 14, 2013, 5, 23], [1434, 8, 25, 2013, 6, 4], [1434, 9, 7, 2013, 6, 15],
- [1434, 9, 18, 2013, 6, 26], [1434, 9, 29, 2013, 7, 6], [1434, 10, 10, 2013, 7, 17],
- [1434, 10, 21, 2013, 7, 28], [1434, 11, 3, 2013, 8, 8], [1434, 11, 14, 2013, 8, 19],
- [1434, 11, 25, 2013, 8, 30], [1434, 12, 6, 2013, 9, 11], [1434, 12, 17, 2013, 9, 22],
- [1434, 12, 28, 2013, 10, 2], [1435, 1, 9, 2013, 10, 13], [1435, 1, 20, 2013, 10, 24],
- [1435, 2, 1, 2013, 11, 5], [1435, 2, 12, 2013, 11, 16], [1435, 2, 23, 2013, 11, 27],
- [1435, 3, 5, 2014, 0, 7], [1435, 3, 16, 2014, 0, 18], [1435, 3, 27, 2014, 0, 29],
- [1435, 4, 8, 2014, 1, 9], [1435, 4, 19, 2014, 1, 20], [1435, 5, 1, 2014, 2, 3],
- [1435, 5, 12, 2014, 2, 14], [1435, 5, 23, 2014, 2, 25], [1435, 6, 4, 2014, 3, 5],
- [1435, 6, 15, 2014, 3, 16], [1435, 6, 26, 2014, 3, 27], [1435, 7, 8, 2014, 4, 8],
- [1435, 7, 19, 2014, 4, 19], [1435, 7, 30, 2014, 4, 30], [1435, 8, 11, 2014, 5, 10],
- [1435, 8, 22, 2014, 5, 21], [1435, 9, 4, 2014, 6, 2], [1435, 9, 15, 2014, 6, 13],
- [1435, 9, 26, 2014, 6, 24], [1435, 10, 7, 2014, 7, 4], [1435, 10, 18, 2014, 7, 15],
- [1435, 10, 29, 2014, 7, 26], [1435, 11, 11, 2014, 8, 6], [1435, 11, 22, 2014, 8, 17],
- [1435, 12, 3, 2014, 8, 28], [1435, 12, 14, 2014, 9, 9], [1435, 12, 25, 2014, 9, 20],
- [1436, 1, 7, 2014, 9, 31], [1436, 1, 18, 2014, 10, 11], [1436, 1, 29, 2014, 10, 22],
- [1436, 2, 10, 2014, 11, 3], [1436, 2, 21, 2014, 11, 14], [1436, 3, 3, 2014, 11, 25],
- [1436, 3, 14, 2015, 0, 5], [1436, 3, 25, 2015, 0, 16], [1436, 4, 6, 2015, 0, 27],
- [1436, 4, 17, 2015, 1, 7], [1436, 4, 28, 2015, 1, 18], [1436, 5, 10, 2015, 2, 1],
- [1436, 5, 21, 2015, 2, 12], [1436, 6, 2, 2015, 2, 23], [1436, 6, 13, 2015, 3, 3],
- [1436, 6, 24, 2015, 3, 14], [1436, 7, 6, 2015, 3, 25], [1436, 7, 17, 2015, 4, 6],
- [1436, 7, 28, 2015, 4, 17], [1436, 8, 9, 2015, 4, 28], [1436, 8, 20, 2015, 5, 8],
- [1436, 9, 2, 2015, 5, 19], [1436, 9, 13, 2015, 5, 30], [1436, 9, 24, 2015, 6, 11],
- [1436, 10, 5, 2015, 6, 22], [1436, 10, 16, 2015, 7, 2], [1436, 10, 27, 2015, 7, 13],
- [1436, 11, 9, 2015, 7, 24], [1436, 11, 20, 2015, 8, 4], [1436, 12, 1, 2015, 8, 15],
- [1436, 12, 12, 2015, 8, 26], [1436, 12, 23, 2015, 9, 7], [1437, 1, 4, 2015, 9, 18],
- [1437, 1, 15, 2015, 9, 29], [1437, 1, 26, 2015, 10, 9], [1437, 2, 7, 2015, 10, 20],
- [1437, 3, 22, 2016, 0, 3], [1437, 4, 3, 2016, 0, 14], [1437, 4, 14, 2016, 0, 25],
- [1437, 4, 25, 2016, 1, 5], [1437, 5, 7, 2016, 1, 16], [1437, 5, 18, 2016, 1, 27],
- [1437, 5, 29, 2016, 2, 9], [1437, 6, 10, 2016, 2, 20], [1437, 6, 21, 2016, 2, 31],
- [1437, 7, 3, 2016, 3, 11], [1437, 7, 14, 2016, 3, 22], [1437, 7, 25, 2016, 4, 3],
- [1437, 8, 6, 2016, 4, 14], [1437, 8, 17, 2016, 4, 25], [1437, 8, 28, 2016, 5, 5],
- [1437, 9, 10, 2016, 5, 16], [1437, 9, 21, 2016, 5, 27], [1437, 10, 2, 2016, 6, 8],
- [1437, 10, 13, 2016, 6, 19], [1437, 10, 24, 2016, 6, 30], [1437, 11, 6, 2016, 7, 10],
- [1437, 11, 17, 2016, 7, 21], [1437, 11, 28, 2016, 8, 1], [1437, 12, 9, 2016, 8, 12],
- [1437, 12, 20, 2016, 8, 23], [1438, 1, 2, 2016, 9, 4], [1438, 1, 13, 2016, 9, 15],
- [1438, 1, 24, 2016, 9, 26], [1438, 2, 5, 2016, 10, 6], [1438, 2, 16, 2016, 10, 17],
- [1438, 2, 27, 2016, 10, 28], [1438, 4, 12, 2017, 0, 11], [1438, 4, 23, 2017, 0, 22],
- [1438, 5, 5, 2017, 1, 2], [1438, 5, 16, 2017, 1, 13], [1438, 5, 27, 2017, 1, 24],
- [1438, 6, 8, 2017, 2, 7], [1438, 6, 19, 2017, 2, 18], [1438, 7, 1, 2017, 2, 29],
- [1438, 7, 12, 2017, 3, 9], [1438, 7, 23, 2017, 3, 20], [1438, 8, 4, 2017, 4, 1],
- [1438, 8, 15, 2017, 4, 12], [1438, 8, 26, 2017, 4, 23], [1438, 9, 8, 2017, 5, 3],
- [1438, 9, 19, 2017, 5, 14], [1438, 9, 30, 2017, 5, 25], [1438, 10, 11, 2017, 6, 6],
- [1438, 10, 22, 2017, 6, 17], [1438, 11, 4, 2017, 6, 28], [1438, 11, 15, 2017, 7, 8],
- [1438, 11, 26, 2017, 7, 19], [1438, 12, 7, 2017, 7, 30], [1438, 12, 18, 2017, 8, 10],
- [1438, 12, 29, 2017, 8, 21], [1439, 1, 11, 2017, 9, 2], [1439, 1, 22, 2017, 9, 13],
- [1439, 2, 3, 2017, 9, 24], [1439, 2, 14, 2017, 10, 4], [1439, 2, 25, 2017, 10, 15],
- [1439, 3, 7, 2017, 10, 26], [1439, 3, 18, 2017, 11, 7], [1439, 3, 29, 2017, 11, 18],
- [1439, 4, 10, 2017, 11, 29], [1439, 4, 21, 2018, 0, 9], [1439, 5, 3, 2018, 0, 20],
- [1439, 5, 14, 2018, 0, 31], [1439, 5, 25, 2018, 1, 11], [1439, 6, 6, 2018, 1, 22],
- [1439, 6, 17, 2018, 2, 5], [1439, 6, 28, 2018, 2, 16], [1439, 7, 10, 2018, 2, 27],
- [1439, 7, 21, 2018, 3, 7], [1439, 8, 2, 2018, 3, 18], [1439, 8, 13, 2018, 3, 29],
- [1439, 8, 24, 2018, 4, 10], [1439, 9, 6, 2018, 4, 21], [1439, 9, 17, 2018, 5, 1],
- [1439, 9, 28, 2018, 5, 12], [1439, 10, 9, 2018, 5, 23], [1439, 10, 20, 2018, 6, 4],
- [1439, 11, 2, 2018, 6, 15], [1439, 11, 13, 2018, 6, 26], [1439, 11, 24, 2018, 7, 6],
- [1439, 12, 5, 2018, 7, 17], [1439, 12, 16, 2018, 7, 28], [1439, 12, 27, 2018, 8, 8],
- [1440, 1, 8, 2018, 8, 19], [1440, 1, 19, 2018, 8, 30], [1440, 1, 30, 2018, 9, 11],
- [1440, 2, 11, 2018, 9, 22], [1440, 2, 22, 2018, 10, 2], [1440, 3, 4, 2018, 10, 13],
- [1440, 3, 15, 2018, 10, 24], [1440, 3, 26, 2018, 11, 5], [1440, 4, 7, 2018, 11, 16],
- [1440, 4, 18, 2018, 11, 27], [1440, 4, 29, 2019, 0, 7], [1440, 5, 11, 2019, 0, 18],
- [1440, 5, 22, 2019, 0, 29], [1440, 6, 3, 2019, 1, 9], [1440, 6, 14, 2019, 1, 20],
- [1440, 6, 25, 2019, 2, 3], [1440, 7, 7, 2019, 2, 14], [1440, 7, 18, 2019, 2, 25],
- [1440, 7, 29, 2019, 3, 5], [1440, 8, 10, 2019, 3, 16], [1440, 8, 21, 2019, 3, 27],
- [1440, 9, 3, 2019, 4, 8], [1440, 9, 14, 2019, 4, 19], [1440, 9, 25, 2019, 4, 30],
- [1440, 10, 6, 2019, 5, 10], [1440, 10, 17, 2019, 5, 21], [1440, 10, 28, 2019, 6, 2],
- [1440, 11, 10, 2019, 6, 13], [1440, 11, 21, 2019, 6, 24], [1440, 12, 2, 2019, 7, 4],
- [1440, 12, 13, 2019, 7, 15], [1440, 12, 24, 2019, 7, 26], [1441, 1, 6, 2019, 8, 6],
- [1441, 1, 17, 2019, 8, 17], [1441, 1, 28, 2019, 8, 28], [1441, 2, 9, 2019, 9, 9],
- [1441, 2, 20, 2019, 9, 20], [1441, 3, 2, 2019, 9, 31], [1441, 3, 13, 2019, 10, 11],
- [1441, 3, 24, 2019, 10, 22], [1441, 5, 9, 2020, 0, 5], [1441, 5, 20, 2020, 0, 16],
- [1441, 6, 1, 2020, 0, 27], [1441, 6, 12, 2020, 1, 7], [1441, 6, 23, 2020, 1, 18],
- [1441, 7, 5, 2020, 1, 29], [1441, 7, 16, 2020, 2, 11], [1441, 7, 27, 2020, 2, 22],
- [1441, 8, 8, 2020, 3, 2], [1441, 8, 19, 2020, 3, 13], [1441, 9, 1, 2020, 3, 24],
- [1441, 9, 12, 2020, 4, 5], [1441, 9, 23, 2020, 4, 16], [1441, 10, 4, 2020, 4, 27],
- [1441, 10, 15, 2020, 5, 7], [1441, 10, 26, 2020, 5, 18], [1441, 11, 8, 2020, 5, 29],
- [1441, 11, 19, 2020, 6, 10], [1441, 11, 30, 2020, 6, 21], [1441, 12, 11, 2020, 7, 1],
- [1441, 12, 22, 2020, 7, 12], [1442, 1, 4, 2020, 7, 23], [1442, 1, 15, 2020, 8, 3],
- [1442, 1, 26, 2020, 8, 14], [1442, 2, 7, 2020, 8, 25], [1442, 2, 18, 2020, 9, 6],
- [1442, 2, 29, 2020, 9, 17], [1442, 3, 11, 2020, 9, 28], [1442, 3, 22, 2020, 10, 8],
- [1442, 4, 3, 2020, 10, 19], [1442, 4, 14, 2020, 10, 30], [1442, 5, 18, 2021, 0, 2],
- [1442, 5, 29, 2021, 0, 13], [1442, 6, 10, 2021, 0, 24], [1442, 6, 21, 2021, 1, 4],
- [1442, 7, 3, 2021, 1, 15], [1442, 7, 14, 2021, 1, 26], [1442, 7, 25, 2021, 2, 9],
- [1442, 8, 6, 2021, 2, 20], [1442, 8, 17, 2021, 2, 31], [1442, 8, 28, 2021, 3, 11],
- [1442, 9, 10, 2021, 3, 22], [1442, 9, 21, 2021, 4, 3], [1442, 10, 2, 2021, 4, 14],
- [1442, 10, 13, 2021, 4, 25], [1442, 10, 24, 2021, 5, 5], [1442, 11, 6, 2021, 5, 16],
- [1442, 11, 17, 2021, 5, 27], [1442, 11, 28, 2021, 6, 8], [1442, 12, 9, 2021, 6, 19],
- [1442, 12, 20, 2021, 6, 30], [1443, 1, 1, 2021, 7, 10], [1443, 1, 12, 2021, 7, 21],
- [1443, 1, 23, 2021, 8, 1], [1443, 2, 4, 2021, 8, 12], [1443, 2, 15, 2021, 8, 23],
- [1443, 2, 26, 2021, 9, 4], [1443, 3, 8, 2021, 9, 15], [1443, 3, 19, 2021, 9, 26],
- [1443, 3, 30, 2021, 10, 6], [1443, 4, 11, 2021, 10, 17], [1443, 4, 22, 2021, 10, 28],
- [1443, 6, 7, 2022, 0, 11], [1443, 6, 18, 2022, 0, 22], [1443, 6, 29, 2022, 1, 2],
- [1443, 7, 11, 2022, 1, 13], [1443, 7, 22, 2022, 1, 24], [1443, 8, 3, 2022, 2, 7],
- [1443, 8, 14, 2022, 2, 18], [1443, 8, 25, 2022, 2, 29], [1443, 9, 7, 2022, 3, 9],
- [1443, 9, 18, 2022, 3, 20], [1443, 9, 29, 2022, 4, 1], [1443, 10, 10, 2022, 4, 12],
- [1443, 10, 21, 2022, 4, 23], [1443, 11, 3, 2022, 5, 3], [1443, 11, 14, 2022, 5, 14],
- [1443, 11, 25, 2022, 5, 25], [1443, 12, 6, 2022, 6, 6], [1443, 12, 17, 2022, 6, 17],
- [1443, 12, 28, 2022, 6, 28], [1444, 1, 10, 2022, 7, 8], [1444, 1, 21, 2022, 7, 19],
- [1444, 2, 2, 2022, 7, 30], [1444, 2, 13, 2022, 8, 10], [1444, 2, 24, 2022, 8, 21],
- [1444, 3, 6, 2022, 9, 2], [1444, 3, 17, 2022, 9, 13], [1444, 3, 28, 2022, 9, 24],
- [1444, 4, 9, 2022, 10, 4], [1444, 4, 20, 2022, 10, 15], [1444, 5, 2, 2022, 10, 26],
- [1444, 6, 16, 2023, 0, 9], [1444, 6, 27, 2023, 0, 20], [1444, 7, 9, 2023, 0, 31],
- [1444, 7, 20, 2023, 1, 11], [1444, 8, 1, 2023, 1, 22], [1444, 8, 12, 2023, 2, 5],
- [1444, 8, 23, 2023, 2, 16], [1444, 9, 5, 2023, 2, 27], [1444, 9, 16, 2023, 3, 7],
- [1444, 9, 27, 2023, 3, 18], [1444, 10, 8, 2023, 3, 29], [1444, 10, 19, 2023, 4, 10],
- [1444, 11, 1, 2023, 4, 21], [1444, 11, 12, 2023, 5, 1], [1444, 11, 23, 2023, 5, 12],
- [1444, 12, 4, 2023, 5, 23], [1444, 12, 15, 2023, 6, 4], [1444, 12, 26, 2023, 6, 15],
- [1445, 1, 8, 2023, 6, 26], [1445, 1, 19, 2023, 7, 6], [1445, 1, 30, 2023, 7, 17],
- [1445, 2, 11, 2023, 7, 28], [1445, 2, 22, 2023, 8, 8], [1445, 3, 4, 2023, 8, 19],
- [1445, 3, 15, 2023, 8, 30], [1445, 3, 26, 2023, 9, 11], [1445, 4, 7, 2023, 9, 22],
- [1445, 4, 18, 2023, 10, 2], [1445, 4, 29, 2023, 10, 13], [1445, 5, 11, 2023, 10, 24],
- [1445, 6, 25, 2024, 0, 7], [1445, 7, 7, 2024, 0, 18], [1445, 7, 18, 2024, 0, 29],
- [1445, 7, 29, 2024, 1, 9], [1445, 8, 10, 2024, 1, 20], [1445, 8, 21, 2024, 2, 2],
- [1445, 9, 3, 2024, 2, 13], [1445, 9, 14, 2024, 2, 24], [1445, 9, 25, 2024, 3, 4],
- [1445, 10, 6, 2024, 3, 15], [1445, 10, 17, 2024, 3, 26], [1445, 10, 28, 2024, 4, 7],
- [1445, 11, 10, 2024, 4, 18], [1445, 11, 21, 2024, 4, 29], [1445, 12, 2, 2024, 5, 9],
- [1445, 12, 13, 2024, 5, 20], [1445, 12, 24, 2024, 6, 1], [1446, 1, 5, 2024, 6, 12],
- [1446, 1, 16, 2024, 6, 23], [1446, 1, 27, 2024, 7, 3], [1446, 2, 8, 2024, 7, 14],
- [1446, 2, 19, 2024, 7, 25], [1446, 3, 1, 2024, 8, 5], [1446, 3, 12, 2024, 8, 16],
- [1446, 3, 23, 2024, 8, 27], [1446, 4, 4, 2024, 9, 8], [1446, 4, 15, 2024, 9, 19],
- [1446, 4, 26, 2024, 9, 30], [1446, 5, 8, 2024, 10, 10], [1446, 5, 19, 2024, 10, 21],
- [1446, 7, 4, 2025, 0, 4], [1446, 7, 15, 2025, 0, 15], [1446, 7, 26, 2025, 0, 26],
- [1446, 8, 7, 2025, 1, 6], [1446, 8, 18, 2025, 1, 17], [1446, 8, 29, 2025, 1, 28],
- [1446, 9, 11, 2025, 2, 11], [1446, 9, 22, 2025, 2, 22], [1446, 10, 3, 2025, 3, 2],
- [1446, 10, 14, 2025, 3, 13], [1446, 10, 25, 2025, 3, 24], [1446, 11, 7, 2025, 4, 5],
- [1446, 11, 18, 2025, 4, 16], [1446, 11, 29, 2025, 4, 27], [1446, 12, 10, 2025, 5, 7],
- [1446, 12, 21, 2025, 5, 18], [1447, 1, 3, 2025, 5, 29], [1447, 1, 14, 2025, 6, 10],
- [1447, 1, 25, 2025, 6, 21], [1447, 2, 6, 2025, 7, 1], [1447, 2, 17, 2025, 7, 12],
- [1447, 2, 28, 2025, 7, 23], [1447, 3, 10, 2025, 8, 3], [1447, 3, 21, 2025, 8, 14],
- [1447, 4, 2, 2025, 8, 25], [1447, 4, 13, 2025, 9, 6], [1447, 4, 24, 2025, 9, 17],
- [1447, 5, 6, 2025, 9, 28], [1447, 5, 17, 2025, 10, 8], [1447, 5, 28, 2025, 10, 19],
- [1447, 6, 9, 2025, 10, 30], [1447, 7, 13, 2026, 0, 2], [1447, 7, 24, 2026, 0, 13],
- [1447, 8, 5, 2026, 0, 24], [1447, 8, 16, 2026, 1, 4], [1447, 8, 27, 2026, 1, 15],
- [1447, 9, 9, 2026, 1, 26], [1447, 9, 20, 2026, 2, 9], [1447, 10, 1, 2026, 2, 20],
- [1447, 10, 12, 2026, 2, 31], [1447, 10, 23, 2026, 3, 11], [1447, 11, 5, 2026, 3, 22],
- [1447, 11, 16, 2026, 4, 3], [1447, 11, 27, 2026, 4, 14], [1447, 12, 8, 2026, 4, 25],
- [1447, 12, 19, 2026, 5, 5], [1447, 12, 30, 2026, 5, 16], [1448, 1, 11, 2026, 5, 27],
- [1448, 1, 22, 2026, 6, 8], [1448, 2, 3, 2026, 6, 19], [1448, 2, 14, 2026, 6, 30],
- [1448, 2, 25, 2026, 7, 10], [1448, 3, 7, 2026, 7, 21], [1448, 3, 18, 2026, 8, 1],
- [1420, 8, 22, 1999, 11, 1], [1424, 10, 6, 2003, 11, 1], [1428, 11, 21, 2007, 11, 1],
- [1433, 1, 5, 2011, 11, 1]
- ];
-
- const calendar = new NgbCalendarIslamicCivil();
- describe('toGregorian', () => {
- it('should convert correctly from Hijri to Gregorian', () => {
- DATE_TABLE.forEach(element => {
- let iDate = new NgbDate(element[0], element[1], element[2]);
- let gDate = new Date(element[3], element[4], element[5]);
- expect(calendar.toGregorian(iDate).getTime())
- .toEqual(gDate.getTime(), `Hijri ${iDate.year}-${iDate.month}-${iDate.day} should be Gregorian ${gDate}`);
- });
- });
- });
-
- describe('fromGregorian', () => {
- it('should convert correctly from Gregorian to Hijri', () => {
- DATE_TABLE.forEach(element => {
- let iDate = new NgbDate(element[0], element[1], element[2]);
- const gDate = new Date(element[3], element[4], element[5]);
- let iDate2 = calendar.fromGregorian(gDate);
- expect(iDate2.equals(iDate))
- .toBeTruthy(`Gregorian ${gDate} should be Hijri ${iDate.year}-${iDate.month}-${iDate.day}`);
- });
- });
- });
-
- it('should return number of days per week', () => { expect(calendar.getDaysPerWeek()).toBe(7); });
-
- it('should return number of weeks per month', () => { expect(calendar.getWeeksPerMonth()).toBe(6); });
-
- it('should return months of a year', () => {
- expect(calendar.getMonths()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it('should return day of week', () => {
- expect(calendar.getWeekday(new NgbDate(1437, 12, 15))).toEqual(7);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 16))).toEqual(1);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 17))).toEqual(2);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 18))).toEqual(3);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 19))).toEqual(4);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 20))).toEqual(5);
- expect(calendar.getWeekday(new NgbDate(1437, 12, 21))).toEqual(6);
- expect(calendar.getWeekday(new NgbDate(1431, 1, 11))).toEqual(1);
- expect(calendar.getWeekday(new NgbDate(1431, 7, 22))).toEqual(7);
- expect(calendar.getWeekday(new NgbDate(1431, 2, 3))).toEqual(2);
- expect(calendar.getWeekday(new NgbDate(1431, 3, 10))).toEqual(3);
- expect(calendar.getWeekday(new NgbDate(1431, 4, 23))).toEqual(4);
- expect(calendar.getWeekday(new NgbDate(1202, 2, 19))).toEqual(5);
- expect(calendar.getWeekday(new NgbDate(1431, 7, 21))).toEqual(6);
- });
- it('should add days to date', () => {
- expect(calendar.getNext(new NgbDate(1431, 1, 30))).toEqual(new NgbDate(1431, 2, 1));
- expect(calendar.getNext(new NgbDate(1437, 2, 28))).toEqual(new NgbDate(1437, 2, 29));
- expect(calendar.getNext(new NgbDate(1437, 2, 29))).toEqual(new NgbDate(1437, 3, 1));
- });
-
- it('should subtract days from date', () => {
- expect(calendar.getPrev(new NgbDate(1431, 2, 1))).toEqual(new NgbDate(1431, 1, 30));
- expect(calendar.getPrev(new NgbDate(1431, 3, 1))).toEqual(new NgbDate(1431, 2, 29));
- expect(calendar.getPrev(new NgbDate(1437, 3, 5))).toEqual(new NgbDate(1437, 3, 4));
- });
-
- it('should add months to date', () => {
- expect(calendar.getNext(new NgbDate(1437, 8, 22), 'm')).toEqual(new NgbDate(1437, 9, 1));
- expect(calendar.getNext(new NgbDate(1437, 8, 1), 'm')).toEqual(new NgbDate(1437, 9, 1));
- expect(calendar.getNext(new NgbDate(1437, 12, 22), 'm')).toEqual(new NgbDate(1438, 1, 1));
- });
-
- it('should subtract months from date', () => {
- expect(calendar.getPrev(new NgbDate(1437, 8, 22), 'm')).toEqual(new NgbDate(1437, 7, 1));
- expect(calendar.getPrev(new NgbDate(1437, 9, 1), 'm')).toEqual(new NgbDate(1437, 8, 1));
- expect(calendar.getPrev(new NgbDate(1437, 1, 22), 'm')).toEqual(new NgbDate(1436, 12, 1));
- });
-
- it('should add years to date', () => {
- expect(calendar.getNext(new NgbDate(1437, 2, 22), 'y')).toEqual(new NgbDate(1438, 1, 1));
- expect(calendar.getNext(new NgbDate(1438, 12, 22), 'y')).toEqual(new NgbDate(1439, 1, 1));
- });
-
- it('should subtract years from date', () => {
- expect(calendar.getPrev(new NgbDate(1437, 12, 22), 'y')).toEqual(new NgbDate(1436, 1, 1));
- expect(calendar.getPrev(new NgbDate(1438, 2, 22), 'y')).toEqual(new NgbDate(1437, 1, 1));
- });
-
- it('should return week number', () => {
- let week = [
- new NgbDate(1437, 1, 4), new NgbDate(1437, 1, 5), new NgbDate(1437, 1, 6), new NgbDate(1437, 1, 7),
- new NgbDate(1437, 1, 8), new NgbDate(1437, 1, 9), new NgbDate(1437, 1, 10)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(2);
- week = [
- new NgbDate(1437, 12, 15), new NgbDate(1437, 12, 16), new NgbDate(1437, 12, 17), new NgbDate(1437, 12, 18),
- new NgbDate(1437, 12, 19), new NgbDate(1437, 12, 20), new NgbDate(1437, 12, 21)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(50);
- week = [
- new NgbDate(1437, 12, 22), new NgbDate(1437, 12, 23), new NgbDate(1437, 12, 24), new NgbDate(1437, 12, 25),
- new NgbDate(1437, 12, 26), new NgbDate(1437, 12, 27), new NgbDate(1437, 12, 28)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(51);
- });
-
- describe('setDay', () => {
- it('should return correct value of day', () => {
- expect(calendar.getNext(new NgbDate(1202, 9, 1), 'd', 18).day).toEqual(19);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 0).day).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 30).day).toEqual(1);
- expect(calendar.getNext(new NgbDate(1437, 1, 1), 'd', 60).day).toEqual(2);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -1).day).toEqual(30);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -2).day).toEqual(29);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -3).day).toEqual(28);
- });
- });
-
- describe('setMonth', () => {
- it('should return correct value of month', () => {
- expect(calendar.getNext(new NgbDate(1202, 9, 1), 'm', 0).month).toEqual(9);
- expect(calendar.getNext(new NgbDate(1431, 1, 30), 'm', 0).month).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 30).month).toEqual(2);
- expect(calendar.getNext(new NgbDate(1437, 1, 1), 'd', 60).month).toEqual(3);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -2).month).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -31).month).toEqual(12);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -1).month).toEqual(12);
- });
- });
-
- describe('setYear', () => {
- it('should return correct value of yar', () => {
- expect(calendar.getNext(new NgbDate(1200, 1, 1), 'y', 2).year).toEqual(1202);
- expect(calendar.getNext(new NgbDate(1430, 11, 30), 'y', 1).year).toEqual(1431);
- expect(calendar.getNext(new NgbDate(1431, 12, 1), 'd', 30).year).toEqual(1432);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', 12).year).toEqual(1432);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', 24).year).toEqual(1433);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', -2).year).toEqual(1430);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -1).year).toEqual(1430);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -14).year).toEqual(1429);
- });
- });
-});
diff --git a/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.ts b/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.ts
deleted file mode 100644
index 39e71a4..0000000
--- a/backup/src/datepicker/hijri/ngb-calendar-islamic-civil.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-import {NgbCalendarHijri} from './ngb-calendar-hijri';
-import {NgbDate} from '../ngb-date';
-import {Injectable} from '@angular/core';
-
-/**
- * Checks if islamic year is a leap year
- */
-function isIslamicLeapYear(hYear: number): boolean {
- return (14 + 11 * hYear) % 30 < 11;
-}
-
-/**
- * Checks if gregorian years is a leap year
- */
-function isGregorianLeapYear(gDate: Date): boolean {
- const year = gDate.getFullYear();
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
-}
-
-/**
- * Returns the start of Hijri Month.
- * `hMonth` is 0 for Muharram, 1 for Safar, etc.
- * `hYear` is any Hijri hYear.
- */
-function getIslamicMonthStart(hYear: number, hMonth: number): number {
- return Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30.0);
-}
-
-/**
- * Returns the start of Hijri year.
- * `year` is any Hijri year.
- */
-function getIslamicYearStart(year: number): number {
- return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);
-}
-
-function mod(a: number, b: number): number {
- return a - b * Math.floor(a / b);
-}
-
-/**
- * The civil calendar is one type of Hijri calendars used in islamic countries.
- * Uses a fixed cycle of alternating 29- and 30-day months,
- * with a leap day added to the last month of 11 out of every 30 years.
- * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
- * All the calculations here are based on the equations from "Calendrical Calculations" By Edward M. Reingold, Nachum
- * Dershowitz.
- */
-
-const GREGORIAN_EPOCH = 1721425.5;
-const ISLAMIC_EPOCH = 1948439.5;
-
-@Injectable()
-export class NgbCalendarIslamicCivil extends NgbCalendarHijri {
- /**
- * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
- * `gDate` is a JS Date to be converted to Hijri.
- */
- fromGregorian(gDate: Date): NgbDate {
- const gYear = gDate.getFullYear(), gMonth = gDate.getMonth(), gDay = gDate.getDate();
-
- let julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +
- -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
- Math.floor(
- (367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gDate) ? -1 : -2) + gDay);
- julianDay = Math.floor(julianDay) + 0.5;
-
- const days = julianDay - ISLAMIC_EPOCH;
- const hYear = Math.floor((30 * days + 10646) / 10631.0);
- let hMonth = Math.ceil((days - 29 - getIslamicYearStart(hYear)) / 29.5);
- hMonth = Math.min(hMonth, 11);
- const hDay = Math.ceil(days - getIslamicMonthStart(hYear, hMonth)) + 1;
- return new NgbDate(hYear, hMonth + 1, hDay);
- }
-
- /**
- * Returns the equivalent JS date value for a give input islamic(civil) date.
- * `hDate` is an islamic(civil) date to be converted to Gregorian.
- */
- toGregorian(hDate: NgbDate): Date {
- const hYear = hDate.year;
- const hMonth = hDate.month - 1;
- const hDay = hDate.day;
- const julianDay =
- hDay + Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30) + ISLAMIC_EPOCH - 1;
-
- const wjd = Math.floor(julianDay - 0.5) + 0.5, depoch = wjd - GREGORIAN_EPOCH,
- quadricent = Math.floor(depoch / 146097), dqc = mod(depoch, 146097), cent = Math.floor(dqc / 36524),
- dcent = mod(dqc, 36524), quad = Math.floor(dcent / 1461), dquad = mod(dcent, 1461),
- yindex = Math.floor(dquad / 365);
- let year = quadricent * 400 + cent * 100 + quad * 4 + yindex;
- if (!(cent === 4 || yindex === 4)) {
- year++;
- }
-
- const gYearStart = GREGORIAN_EPOCH + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400);
-
- const yearday = wjd - gYearStart;
-
- const tjd = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400) + Math.floor(739 / 12 + (isGregorianLeapYear(new Date(year, 3, 1)) ? -1 : -2) + 1);
-
- const leapadj = wjd < tjd ? 0 : isGregorianLeapYear(new Date(year, 3, 1)) ? 1 : 2;
-
- const month = Math.floor(((yearday + leapadj) * 12 + 373) / 367);
- const tjd2 = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
- Math.floor((year - 1) / 400) +
- Math.floor(
- (367 * month - 362) / 12 + (month <= 2 ? 0 : isGregorianLeapYear(new Date(year, month - 1, 1)) ? -1 : -2) +
- 1);
-
- const day = wjd - tjd2 + 1;
-
- return new Date(year, month - 1, day);
- }
-
- /**
- * Returns the number of days in a specific Hijri month.
- * `month` is 1 for Muharram, 2 for Safar, etc.
- * `year` is any Hijri year.
- */
- getDaysPerMonth(month: number, year: number): number {
- year = year + Math.floor(month / 13);
- month = ((month - 1) % 12) + 1;
- let length = 29 + month % 2;
- if (month === 12 && isIslamicLeapYear(year)) {
- length++;
- }
- return length;
- }
-}
diff --git a/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.spec.ts b/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.spec.ts
deleted file mode 100644
index c989832..0000000
--- a/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.spec.ts
+++ /dev/null
@@ -1,1007 +0,0 @@
-import {NgbCalendarIslamicUmalqura} from './ngb-calendar-islamic-umalqura';
-import {NgbDate} from '../ngb-date';
-
-describe('ngb-calendar-islamic-umalqura', () => {
- const DATE_TABLE = [
- [1882, 10, 12, 1300, 1, 1], [1882, 10, 14, 1300, 1, 3], [1883, 5, 20, 1300, 8, 14],
- [1883, 5, 22, 1300, 8, 16], [1884, 0, 26, 1301, 3, 27], [1884, 0, 28, 1301, 3, 29],
- [1884, 8, 2, 1301, 11, 11], [1884, 8, 4, 1301, 11, 13], [1885, 3, 10, 1302, 6, 24],
- [1885, 3, 12, 1302, 6, 26], [1885, 10, 16, 1303, 2, 9], [1885, 10, 18, 1303, 2, 11],
- [1886, 5, 24, 1303, 9, 21], [1886, 5, 26, 1303, 9, 23], [1887, 0, 30, 1304, 5, 6],
- [1887, 1, 1, 1304, 5, 8], [1887, 8, 7, 1304, 12, 18], [1887, 8, 9, 1304, 12, 20],
- [1888, 3, 14, 1305, 8, 2], [1888, 3, 16, 1305, 8, 4], [1888, 10, 20, 1306, 3, 16],
- [1888, 10, 22, 1306, 3, 18], [1889, 5, 28, 1306, 10, 29], [1889, 5, 30, 1306, 11, 1],
- [1890, 1, 3, 1307, 6, 13], [1890, 1, 5, 1307, 6, 15], [1890, 8, 11, 1308, 1, 26],
- [1890, 8, 13, 1308, 1, 28], [1891, 3, 19, 1308, 9, 10], [1891, 3, 21, 1308, 9, 12],
- [1891, 10, 25, 1309, 4, 23], [1891, 10, 27, 1309, 4, 25], [1892, 6, 2, 1309, 12, 7],
- [1892, 6, 4, 1309, 12, 9], [1893, 1, 7, 1310, 7, 20], [1893, 1, 9, 1310, 7, 22],
- [1893, 8, 15, 1311, 3, 4], [1893, 8, 17, 1311, 3, 6], [1894, 3, 23, 1311, 10, 17],
- [1894, 3, 25, 1311, 10, 19], [1894, 10, 29, 1312, 6, 1], [1894, 11, 1, 1312, 6, 3],
- [1895, 6, 7, 1313, 1, 14], [1895, 6, 9, 1313, 1, 16], [1896, 1, 12, 1313, 8, 28],
- [1896, 1, 14, 1313, 8, 30], [1896, 8, 19, 1314, 4, 11], [1896, 8, 21, 1314, 4, 13],
- [1897, 3, 27, 1314, 11, 24], [1897, 3, 29, 1314, 11, 26], [1897, 11, 3, 1315, 7, 8],
- [1897, 11, 5, 1315, 7, 10], [1898, 6, 11, 1316, 2, 22], [1898, 6, 13, 1316, 2, 24],
- [1899, 1, 16, 1316, 10, 5], [1899, 1, 18, 1316, 10, 7], [1899, 8, 24, 1317, 5, 18],
- [1899, 8, 26, 1317, 5, 20], [1900, 4, 2, 1318, 1, 3], [1900, 4, 4, 1318, 1, 5],
- [1900, 11, 8, 1318, 8, 15], [1900, 11, 10, 1318, 8, 17], [1901, 6, 16, 1319, 3, 29],
- [1901, 6, 18, 1319, 4, 2], [1902, 1, 21, 1319, 11, 12], [1902, 1, 23, 1319, 11, 14],
- [1902, 8, 29, 1320, 6, 26], [1902, 9, 1, 1320, 6, 28], [1903, 4, 7, 1321, 2, 9],
- [1903, 4, 9, 1321, 2, 11], [1903, 11, 13, 1321, 9, 24], [1903, 11, 15, 1321, 9, 26],
- [1904, 6, 20, 1322, 5, 6], [1904, 6, 22, 1322, 5, 8], [1905, 1, 25, 1322, 12, 20],
- [1905, 1, 27, 1322, 12, 22], [1905, 9, 3, 1323, 8, 4], [1905, 9, 5, 1323, 8, 6],
- [1906, 4, 11, 1324, 3, 17], [1906, 4, 13, 1324, 3, 19], [1906, 11, 17, 1324, 11, 1],
- [1906, 11, 19, 1324, 11, 3], [1907, 6, 25, 1325, 6, 14], [1907, 6, 27, 1325, 6, 16],
- [1908, 2, 1, 1326, 1, 27], [1908, 2, 3, 1326, 1, 29], [1908, 9, 7, 1326, 9, 11],
- [1908, 9, 9, 1326, 9, 13], [1909, 4, 15, 1327, 4, 25], [1909, 4, 17, 1327, 4, 27],
- [1909, 11, 21, 1327, 12, 8], [1909, 11, 23, 1327, 12, 10], [1910, 6, 29, 1328, 7, 22],
- [1910, 6, 31, 1328, 7, 24], [1911, 2, 6, 1329, 3, 5], [1911, 2, 8, 1329, 3, 7],
- [1911, 9, 12, 1329, 10, 19], [1911, 9, 14, 1329, 10, 21], [1912, 4, 19, 1330, 6, 2],
- [1912, 4, 21, 1330, 6, 4], [1912, 11, 25, 1331, 1, 16], [1912, 11, 27, 1331, 1, 18],
- [1913, 7, 2, 1331, 8, 29], [1913, 7, 4, 1331, 9, 1], [1914, 2, 10, 1332, 4, 13],
- [1914, 2, 12, 1332, 4, 15], [1914, 9, 16, 1332, 11, 25], [1914, 9, 18, 1332, 11, 27],
- [1915, 4, 24, 1333, 7, 10], [1915, 4, 26, 1333, 7, 12], [1915, 11, 30, 1334, 2, 23],
- [1916, 0, 1, 1334, 2, 25], [1916, 7, 6, 1334, 10, 6], [1916, 7, 8, 1334, 10, 8],
- [1917, 2, 14, 1335, 5, 20], [1917, 2, 16, 1335, 5, 22], [1917, 9, 20, 1336, 1, 3],
- [1917, 9, 22, 1336, 1, 5], [1918, 4, 28, 1336, 8, 17], [1918, 4, 30, 1336, 8, 19],
- [1919, 0, 3, 1337, 3, 30], [1919, 0, 5, 1337, 4, 2], [1919, 7, 11, 1337, 11, 14],
- [1919, 7, 13, 1337, 11, 16], [1920, 2, 18, 1338, 6, 27], [1920, 2, 20, 1338, 6, 29],
- [1920, 9, 24, 1339, 2, 11], [1920, 9, 26, 1339, 2, 13], [1921, 5, 1, 1339, 9, 24],
- [1921, 5, 3, 1339, 9, 26], [1922, 0, 7, 1340, 5, 9], [1922, 0, 9, 1340, 5, 11],
- [1922, 7, 15, 1340, 12, 21], [1922, 7, 17, 1340, 12, 23], [1923, 2, 23, 1341, 8, 5],
- [1923, 2, 25, 1341, 8, 7], [1923, 9, 29, 1342, 3, 19], [1923, 9, 31, 1342, 3, 21],
- [1924, 5, 5, 1342, 11, 2], [1924, 5, 7, 1342, 11, 4], [1925, 0, 11, 1343, 6, 16],
- [1925, 0, 13, 1343, 6, 18], [1925, 7, 19, 1344, 1, 29], [1925, 7, 21, 1344, 2, 1],
- [1926, 2, 27, 1344, 9, 13], [1926, 2, 29, 1344, 9, 15], [1926, 10, 2, 1345, 4, 26],
- [1926, 10, 4, 1345, 4, 28], [1927, 5, 10, 1345, 12, 10], [1927, 5, 12, 1345, 12, 12],
- [1928, 0, 16, 1346, 7, 22], [1928, 0, 18, 1346, 7, 24], [1928, 7, 23, 1347, 3, 7],
- [1928, 7, 25, 1347, 3, 9], [1929, 2, 31, 1347, 10, 19], [1929, 3, 2, 1347, 10, 21],
- [1929, 10, 6, 1348, 6, 4], [1929, 10, 8, 1348, 6, 6], [1930, 5, 14, 1349, 1, 17],
- [1930, 5, 16, 1349, 1, 19], [1931, 0, 20, 1349, 9, 1], [1931, 0, 22, 1349, 9, 3],
- [1931, 7, 28, 1350, 4, 14], [1931, 7, 30, 1350, 4, 16], [1932, 3, 4, 1350, 11, 27],
- [1932, 3, 6, 1350, 11, 29], [1932, 10, 10, 1351, 7, 11], [1932, 10, 12, 1351, 7, 13],
- [1933, 5, 18, 1352, 2, 24], [1933, 5, 20, 1352, 2, 26], [1934, 0, 24, 1352, 10, 8],
- [1934, 0, 26, 1352, 10, 10], [1934, 8, 1, 1353, 5, 21], [1934, 8, 3, 1353, 5, 23],
- [1935, 3, 9, 1354, 1, 5], [1935, 3, 11, 1354, 1, 7], [1935, 10, 15, 1354, 8, 18],
- [1935, 10, 17, 1354, 8, 20], [1936, 5, 22, 1355, 4, 3], [1936, 5, 24, 1355, 4, 5],
- [1937, 0, 28, 1355, 11, 15], [1937, 0, 30, 1355, 11, 17], [1937, 8, 5, 1356, 6, 29],
- [1937, 8, 7, 1356, 7, 1], [1938, 3, 13, 1357, 2, 12], [1938, 3, 15, 1357, 2, 14],
- [1938, 10, 19, 1357, 9, 26], [1938, 10, 21, 1357, 9, 28], [1939, 5, 27, 1358, 5, 9],
- [1939, 5, 29, 1358, 5, 11], [1940, 1, 2, 1358, 12, 23], [1940, 1, 4, 1358, 12, 25],
- [1940, 8, 9, 1359, 8, 6], [1940, 8, 11, 1359, 8, 8], [1941, 3, 17, 1360, 3, 20],
- [1941, 3, 19, 1360, 3, 22], [1941, 10, 23, 1360, 11, 4], [1941, 10, 25, 1360, 11, 6],
- [1942, 6, 1, 1361, 6, 17], [1942, 6, 3, 1361, 6, 19], [1943, 1, 6, 1362, 2, 1],
- [1943, 1, 8, 1362, 2, 3], [1943, 8, 14, 1362, 9, 14], [1943, 8, 16, 1362, 9, 16],
- [1944, 3, 21, 1363, 4, 27], [1944, 3, 23, 1363, 4, 29], [1944, 10, 27, 1363, 12, 11],
- [1944, 10, 29, 1363, 12, 13], [1945, 6, 5, 1364, 7, 25], [1945, 6, 7, 1364, 7, 27],
- [1946, 1, 10, 1365, 3, 7], [1946, 1, 12, 1365, 3, 9], [1946, 8, 18, 1365, 10, 22],
- [1946, 8, 20, 1365, 10, 24], [1947, 3, 26, 1366, 6, 5], [1947, 3, 28, 1366, 6, 7],
- [1947, 11, 2, 1367, 1, 19], [1947, 11, 4, 1367, 1, 21], [1948, 6, 9, 1367, 9, 2],
- [1948, 6, 11, 1367, 9, 4], [1949, 1, 14, 1368, 4, 16], [1949, 1, 16, 1368, 4, 18],
- [1949, 8, 22, 1368, 11, 29], [1949, 8, 24, 1368, 12, 1], [1950, 3, 30, 1369, 7, 12],
- [1950, 4, 2, 1369, 7, 14], [1950, 11, 6, 1370, 2, 25], [1950, 11, 8, 1370, 2, 27],
- [1951, 6, 14, 1370, 10, 10], [1951, 6, 16, 1370, 10, 12], [1952, 1, 19, 1371, 5, 23],
- [1952, 1, 21, 1371, 5, 25], [1952, 8, 26, 1372, 1, 6], [1952, 8, 28, 1372, 1, 8],
- [1953, 4, 4, 1372, 8, 20], [1953, 4, 6, 1372, 8, 22], [1953, 11, 10, 1373, 4, 3],
- [1953, 11, 12, 1373, 4, 5], [1954, 6, 18, 1373, 11, 17], [1954, 6, 20, 1373, 11, 19],
- [1955, 1, 23, 1374, 6, 30], [1955, 1, 25, 1374, 7, 2], [1955, 9, 1, 1375, 2, 14],
- [1955, 9, 3, 1375, 2, 16], [1956, 4, 8, 1375, 9, 27], [1956, 4, 10, 1375, 9, 29],
- [1956, 11, 14, 1376, 5, 11], [1956, 11, 16, 1376, 5, 13], [1957, 6, 22, 1376, 12, 24],
- [1957, 6, 24, 1376, 12, 26], [1958, 1, 27, 1377, 8, 8], [1958, 2, 1, 1377, 8, 10],
- [1958, 9, 5, 1378, 3, 21], [1958, 9, 7, 1378, 3, 23], [1959, 4, 13, 1378, 11, 5],
- [1959, 4, 15, 1378, 11, 7], [1959, 11, 19, 1379, 6, 19], [1959, 11, 21, 1379, 6, 21],
- [1960, 6, 26, 1380, 2, 2], [1960, 6, 28, 1380, 2, 4], [1961, 2, 3, 1380, 9, 15],
- [1961, 2, 5, 1380, 9, 17], [1961, 9, 9, 1381, 4, 29], [1961, 9, 11, 1381, 5, 1],
- [1962, 4, 17, 1381, 12, 13], [1962, 4, 19, 1381, 12, 15], [1962, 11, 23, 1382, 7, 26],
- [1962, 11, 25, 1382, 7, 28], [1963, 6, 31, 1383, 3, 10], [1963, 7, 2, 1383, 3, 12],
- [1964, 2, 7, 1383, 10, 22], [1964, 2, 9, 1383, 10, 24], [1964, 9, 13, 1384, 6, 7],
- [1964, 9, 15, 1384, 6, 9], [1965, 4, 21, 1385, 1, 19], [1965, 4, 23, 1385, 1, 21],
- [1965, 11, 27, 1385, 9, 4], [1965, 11, 29, 1385, 9, 6], [1966, 7, 4, 1386, 4, 17],
- [1966, 7, 6, 1386, 4, 19], [1967, 2, 12, 1386, 11, 30], [1967, 2, 14, 1386, 12, 2],
- [1967, 9, 18, 1387, 7, 14], [1967, 9, 20, 1387, 7, 16], [1968, 4, 25, 1388, 2, 27],
- [1968, 4, 27, 1388, 2, 29], [1968, 11, 31, 1388, 10, 11], [1969, 0, 2, 1388, 10, 13],
- [1969, 7, 8, 1389, 5, 24], [1969, 7, 10, 1389, 5, 26], [1970, 2, 16, 1390, 1, 8],
- [1970, 2, 18, 1390, 1, 10], [1970, 9, 22, 1390, 8, 21], [1970, 9, 24, 1390, 8, 23],
- [1971, 4, 30, 1391, 4, 5], [1971, 5, 1, 1391, 4, 7], [1972, 0, 5, 1391, 11, 18],
- [1972, 0, 7, 1391, 11, 20], [1972, 7, 12, 1392, 7, 2], [1972, 7, 14, 1392, 7, 4],
- [1973, 2, 20, 1393, 2, 15], [1973, 2, 22, 1393, 2, 17], [1973, 9, 26, 1393, 9, 29],
- [1973, 9, 28, 1393, 10, 1], [1974, 5, 3, 1394, 5, 12], [1974, 5, 5, 1394, 5, 14],
- [1975, 0, 9, 1394, 12, 26], [1975, 0, 11, 1394, 12, 28], [1975, 7, 17, 1395, 8, 9],
- [1975, 7, 19, 1395, 8, 11], [1976, 2, 24, 1396, 3, 23], [1976, 2, 26, 1396, 3, 25],
- [1976, 9, 30, 1396, 11, 6], [1976, 10, 1, 1396, 11, 8], [1977, 5, 7, 1397, 6, 20],
- [1977, 5, 9, 1397, 6, 22], [1978, 0, 13, 1398, 2, 4], [1978, 0, 15, 1398, 2, 6],
- [1978, 7, 21, 1398, 9, 16], [1978, 7, 23, 1398, 9, 18], [1979, 2, 29, 1399, 5, 1],
- [1979, 2, 31, 1399, 5, 3], [1979, 10, 4, 1399, 12, 14], [1979, 10, 6, 1399, 12, 16],
- [1980, 5, 11, 1400, 7, 27], [1980, 5, 13, 1400, 7, 29], [1981, 0, 17, 1401, 3, 10],
- [1981, 0, 19, 1401, 3, 12], [1981, 7, 25, 1401, 10, 25], [1981, 7, 27, 1401, 10, 27],
- [1982, 3, 2, 1402, 6, 7], [1982, 3, 4, 1402, 6, 9], [1982, 10, 8, 1403, 1, 22],
- [1982, 10, 10, 1403, 1, 24], [1983, 5, 16, 1403, 9, 5], [1983, 5, 18, 1403, 9, 7],
- [1984, 0, 22, 1404, 4, 18], [1984, 0, 24, 1404, 4, 20], [1984, 7, 29, 1404, 12, 2],
- [1984, 7, 31, 1404, 12, 4], [1985, 3, 6, 1405, 7, 15], [1985, 3, 8, 1405, 7, 17],
- [1985, 10, 12, 1406, 2, 28], [1985, 10, 14, 1406, 3, 1], [1986, 5, 20, 1406, 10, 12],
- [1986, 5, 22, 1406, 10, 14], [1987, 0, 26, 1407, 5, 26], [1987, 0, 28, 1407, 5, 28],
- [1987, 8, 3, 1408, 1, 9], [1987, 8, 5, 1408, 1, 11], [1988, 3, 10, 1408, 8, 23],
- [1988, 3, 12, 1408, 8, 25], [1988, 10, 16, 1409, 4, 6], [1988, 10, 18, 1409, 4, 8],
- [1989, 5, 24, 1409, 11, 20], [1989, 5, 26, 1409, 11, 22], [1990, 0, 30, 1410, 7, 3],
- [1990, 1, 1, 1410, 7, 5], [1990, 8, 7, 1411, 2, 17], [1990, 8, 9, 1411, 2, 19],
- [1991, 3, 15, 1411, 9, 29], [1991, 3, 17, 1411, 10, 2], [1991, 10, 21, 1412, 5, 14],
- [1991, 10, 23, 1412, 5, 16], [1992, 5, 28, 1412, 12, 27], [1992, 5, 30, 1412, 12, 29],
- [1993, 1, 3, 1413, 8, 11], [1993, 1, 5, 1413, 8, 13], [1993, 8, 11, 1414, 3, 24],
- [1993, 8, 13, 1414, 3, 26], [1994, 3, 19, 1414, 11, 8], [1994, 3, 21, 1414, 11, 10],
- [1994, 10, 25, 1415, 6, 21], [1994, 10, 27, 1415, 6, 23], [1995, 6, 3, 1416, 2, 4],
- [1995, 6, 5, 1416, 2, 6], [1996, 1, 8, 1416, 9, 18], [1996, 1, 10, 1416, 9, 20],
- [1996, 8, 15, 1417, 5, 1], [1996, 8, 17, 1417, 5, 3], [1997, 3, 23, 1417, 12, 15],
- [1997, 3, 25, 1417, 12, 17], [1997, 10, 29, 1418, 7, 28], [1997, 11, 1, 1418, 8, 1],
- [1998, 6, 7, 1419, 3, 12], [1998, 6, 9, 1419, 3, 14], [1999, 1, 12, 1419, 10, 25],
- [1999, 1, 14, 1419, 10, 27], [1999, 8, 20, 1420, 6, 10], [1999, 8, 22, 1420, 6, 12],
- [2000, 3, 27, 1421, 1, 22], [2000, 3, 29, 1421, 1, 24], [2000, 11, 3, 1421, 9, 7],
- [2000, 11, 5, 1421, 9, 9], [2001, 6, 11, 1422, 4, 20], [2001, 6, 13, 1422, 4, 22],
- [2002, 1, 16, 1422, 12, 4], [2002, 1, 18, 1422, 12, 6], [2002, 8, 24, 1423, 7, 17],
- [2002, 8, 26, 1423, 7, 19], [2003, 4, 2, 1424, 3, 1], [2003, 4, 4, 1424, 3, 3],
- [2003, 11, 8, 1424, 10, 14], [2003, 11, 10, 1424, 10, 16], [2004, 6, 15, 1425, 5, 27],
- [2004, 6, 17, 1425, 5, 29], [2005, 1, 20, 1426, 1, 11], [2005, 1, 22, 1426, 1, 13],
- [2005, 8, 28, 1426, 8, 24], [2005, 8, 30, 1426, 8, 26], [2006, 4, 6, 1427, 4, 8],
- [2006, 4, 8, 1427, 4, 10], [2006, 11, 12, 1427, 11, 21], [2006, 11, 14, 1427, 11, 23],
- [2007, 6, 20, 1428, 7, 6], [2007, 6, 22, 1428, 7, 8], [2008, 1, 25, 1429, 2, 18],
- [2008, 1, 27, 1429, 2, 20], [2008, 9, 2, 1429, 10, 2], [2008, 9, 4, 1429, 10, 4],
- [2009, 4, 10, 1430, 5, 15], [2009, 4, 12, 1430, 5, 17], [2009, 11, 16, 1430, 12, 29],
- [2009, 11, 18, 1431, 1, 1], [2010, 6, 24, 1431, 8, 12], [2010, 6, 26, 1431, 8, 14],
- [2011, 2, 1, 1432, 3, 26], [2011, 2, 3, 1432, 3, 28], [2011, 9, 7, 1432, 11, 9],
- [2011, 9, 9, 1432, 11, 11], [2012, 4, 14, 1433, 6, 23], [2012, 4, 16, 1433, 6, 25],
- [2012, 11, 20, 1434, 2, 7], [2012, 11, 22, 1434, 2, 9], [2013, 6, 28, 1434, 9, 20],
- [2013, 6, 30, 1434, 9, 22], [2014, 2, 5, 1435, 5, 4], [2014, 2, 7, 1435, 5, 6],
- [2014, 9, 11, 1435, 12, 17], [2014, 9, 13, 1435, 12, 19], [2015, 4, 19, 1436, 8, 1],
- [2015, 4, 21, 1436, 8, 3], [2015, 11, 25, 1437, 3, 14], [2015, 11, 27, 1437, 3, 16],
- [2016, 7, 1, 1437, 10, 27], [2016, 7, 3, 1437, 10, 29], [2017, 2, 9, 1438, 6, 10],
- [2017, 2, 11, 1438, 6, 12], [2017, 9, 15, 1439, 1, 25], [2017, 9, 17, 1439, 1, 27],
- [2018, 4, 23, 1439, 9, 8], [2018, 4, 25, 1439, 9, 10], [2018, 11, 29, 1440, 4, 22],
- [2018, 11, 31, 1440, 4, 24], [2019, 7, 6, 1440, 12, 5], [2019, 7, 8, 1440, 12, 7],
- [2020, 2, 13, 1441, 7, 18], [2020, 2, 15, 1441, 7, 20], [2020, 9, 19, 1442, 3, 2],
- [2020, 9, 21, 1442, 3, 4], [2021, 4, 27, 1442, 10, 15], [2021, 4, 29, 1442, 10, 17],
- [2022, 0, 2, 1443, 5, 29], [2022, 0, 4, 1443, 6, 1], [2022, 7, 10, 1444, 1, 12],
- [2022, 7, 12, 1444, 1, 14], [2023, 2, 18, 1444, 8, 26], [2023, 2, 20, 1444, 8, 28],
- [2023, 9, 24, 1445, 4, 9], [2023, 9, 26, 1445, 4, 11], [2024, 4, 31, 1445, 11, 23],
- [2024, 5, 2, 1445, 11, 25], [2025, 0, 6, 1446, 7, 6], [2025, 0, 8, 1446, 7, 8],
- [2025, 7, 14, 1447, 2, 20], [2025, 7, 16, 1447, 2, 22], [2026, 2, 22, 1447, 10, 3],
- [2026, 2, 24, 1447, 10, 5], [2026, 9, 28, 1448, 5, 17], [2026, 9, 30, 1448, 5, 19],
- [2027, 5, 5, 1448, 12, 30], [2027, 5, 7, 1449, 1, 2], [2028, 0, 11, 1449, 8, 14],
- [2028, 0, 13, 1449, 8, 16], [2028, 7, 18, 1450, 3, 27], [2028, 7, 20, 1450, 3, 29],
- [2029, 2, 26, 1450, 11, 11], [2029, 2, 28, 1450, 11, 13], [2029, 10, 1, 1451, 6, 24],
- [2029, 10, 3, 1451, 6, 26], [2030, 5, 9, 1452, 2, 7], [2030, 5, 11, 1452, 2, 9],
- [2031, 0, 15, 1452, 9, 21], [2031, 0, 17, 1452, 9, 23], [2031, 7, 23, 1453, 5, 4],
- [2031, 7, 25, 1453, 5, 6], [2032, 2, 30, 1453, 12, 18], [2032, 3, 1, 1453, 12, 20],
- [2032, 10, 5, 1454, 8, 1], [2032, 10, 7, 1454, 8, 3], [2033, 5, 13, 1455, 3, 15],
- [2033, 5, 15, 1455, 3, 17], [2034, 0, 19, 1455, 10, 28], [2034, 0, 21, 1455, 10, 30],
- [2034, 7, 27, 1456, 6, 12], [2034, 7, 29, 1456, 6, 14], [2035, 3, 4, 1457, 1, 25],
- [2035, 3, 6, 1457, 1, 27], [2035, 10, 10, 1457, 9, 10], [2035, 10, 12, 1457, 9, 12],
- [2036, 5, 17, 1458, 4, 22], [2036, 5, 19, 1458, 4, 24], [2037, 0, 23, 1458, 12, 6],
- [2037, 0, 25, 1458, 12, 8], [2037, 7, 31, 1459, 7, 19], [2037, 8, 2, 1459, 7, 21],
- [2038, 3, 8, 1460, 3, 3], [2038, 3, 10, 1460, 3, 5], [2038, 10, 14, 1460, 10, 17],
- [2038, 10, 16, 1460, 10, 19], [2039, 5, 22, 1461, 5, 30], [2039, 5, 24, 1461, 6, 2],
- [2040, 0, 28, 1462, 1, 14], [2040, 0, 30, 1462, 1, 16], [2040, 8, 4, 1462, 8, 27],
- [2040, 8, 6, 1462, 8, 29], [2041, 3, 12, 1463, 4, 11], [2041, 3, 14, 1463, 4, 13],
- [2041, 10, 18, 1463, 11, 23], [2041, 10, 20, 1463, 11, 25], [2042, 5, 26, 1464, 7, 8],
- [2042, 5, 28, 1464, 7, 10], [2043, 1, 1, 1465, 2, 20], [2043, 1, 3, 1465, 2, 22],
- [2043, 8, 9, 1465, 10, 5], [2043, 8, 11, 1465, 10, 7], [2044, 3, 16, 1466, 5, 17],
- [2044, 3, 18, 1466, 5, 19], [2044, 10, 22, 1467, 1, 2], [2044, 10, 24, 1467, 1, 4],
- [2045, 5, 30, 1467, 8, 15], [2045, 6, 2, 1467, 8, 17], [2046, 1, 5, 1468, 3, 28],
- [2046, 1, 7, 1468, 4, 1], [2046, 8, 13, 1468, 11, 12], [2046, 8, 15, 1468, 11, 14],
- [2047, 3, 21, 1469, 6, 25], [2047, 3, 23, 1469, 6, 27], [2047, 10, 27, 1470, 2, 9],
- [2047, 10, 29, 1470, 2, 11], [2048, 6, 4, 1470, 9, 22], [2048, 6, 6, 1470, 9, 24],
- [2049, 1, 9, 1471, 5, 6], [2049, 1, 11, 1471, 5, 8], [2049, 8, 17, 1471, 12, 19],
- [2049, 8, 19, 1471, 12, 21], [2050, 3, 25, 1472, 8, 3], [2050, 3, 27, 1472, 8, 5],
- [2050, 11, 1, 1473, 3, 16], [2050, 11, 3, 1473, 3, 18], [2051, 6, 9, 1473, 10, 30],
- [2051, 6, 11, 1473, 11, 2], [2052, 1, 14, 1474, 6, 13], [2052, 1, 16, 1474, 6, 15],
- [2052, 8, 21, 1475, 1, 27], [2052, 8, 23, 1475, 1, 29], [2053, 3, 29, 1475, 9, 10],
- [2053, 4, 1, 1475, 9, 12], [2053, 11, 5, 1476, 4, 24], [2053, 11, 7, 1476, 4, 26],
- [2054, 6, 13, 1476, 12, 7], [2054, 6, 15, 1476, 12, 9], [2055, 1, 18, 1477, 7, 21],
- [2055, 1, 20, 1477, 7, 23], [2055, 8, 26, 1478, 3, 5], [2055, 8, 28, 1478, 3, 7],
- [2056, 4, 3, 1478, 10, 18], [2056, 4, 5, 1478, 10, 20], [2056, 11, 9, 1479, 6, 2],
- [2056, 11, 11, 1479, 6, 4], [2057, 6, 17, 1480, 1, 15], [2057, 6, 19, 1480, 1, 17],
- [2058, 1, 22, 1480, 8, 28], [2058, 1, 24, 1480, 9, 1], [2058, 8, 30, 1481, 4, 12],
- [2058, 9, 2, 1481, 4, 14], [2059, 4, 8, 1481, 11, 25], [2059, 4, 10, 1481, 11, 27],
- [2059, 11, 14, 1482, 7, 8], [2059, 11, 16, 1482, 7, 10], [2060, 6, 21, 1483, 2, 23],
- [2060, 6, 23, 1483, 2, 25], [2061, 1, 26, 1483, 10, 5], [2061, 1, 28, 1483, 10, 7],
- [2061, 9, 4, 1484, 5, 20], [2061, 9, 6, 1484, 5, 22], [2062, 4, 12, 1485, 1, 3],
- [2062, 4, 14, 1485, 1, 5], [2062, 11, 18, 1485, 8, 16], [2062, 11, 20, 1485, 8, 18],
- [2063, 6, 26, 1486, 3, 29], [2063, 6, 28, 1486, 4, 2], [2064, 2, 2, 1486, 11, 13],
- [2064, 2, 4, 1486, 11, 15], [2064, 9, 8, 1487, 6, 26], [2064, 9, 10, 1487, 6, 28],
- [2065, 4, 16, 1488, 2, 10], [2065, 4, 18, 1488, 2, 12], [2065, 11, 22, 1488, 9, 24],
- [2065, 11, 24, 1488, 9, 26], [2066, 6, 30, 1489, 5, 7], [2066, 7, 1, 1489, 5, 9],
- [2067, 2, 7, 1489, 12, 21], [2067, 2, 9, 1489, 12, 23], [2067, 9, 13, 1490, 8, 4],
- [2067, 9, 15, 1490, 8, 6], [2068, 4, 20, 1491, 3, 18], [2068, 4, 22, 1491, 3, 20],
- [2068, 11, 26, 1491, 11, 1], [2068, 11, 28, 1491, 11, 3], [2069, 7, 3, 1492, 6, 15],
- [2069, 7, 5, 1492, 6, 17], [2070, 2, 11, 1493, 1, 28], [2070, 2, 13, 1493, 1, 30],
- [2070, 9, 17, 1493, 9, 12], [2070, 9, 19, 1493, 9, 14], [2071, 4, 25, 1494, 4, 25],
- [2071, 4, 27, 1494, 4, 27], [2071, 11, 31, 1494, 12, 9], [2072, 0, 2, 1494, 12, 11],
- [2072, 7, 7, 1495, 7, 22], [2072, 7, 9, 1495, 7, 24], [2073, 2, 15, 1496, 3, 6],
- [2073, 2, 17, 1496, 3, 8], [2073, 9, 21, 1496, 10, 19], [2073, 9, 23, 1496, 10, 21],
- [2074, 4, 29, 1497, 6, 3], [2074, 4, 31, 1497, 6, 5], [2075, 0, 4, 1498, 1, 16],
- [2075, 0, 6, 1498, 1, 18], [2075, 7, 12, 1498, 8, 29], [2075, 7, 14, 1498, 9, 2],
- [2076, 2, 19, 1499, 4, 13], [2076, 2, 21, 1499, 4, 15], [2076, 9, 25, 1499, 11, 27],
- [2076, 9, 27, 1499, 11, 29], [2077, 5, 2, 1500, 7, 11], [2077, 5, 4, 1500, 7, 13],
- [2078, 0, 8, 1501, 2, 23], [2078, 0, 10, 1501, 2, 25], [2078, 7, 16, 1501, 10, 8],
- [2078, 7, 18, 1501, 10, 10], [2079, 2, 24, 1502, 5, 20], [2079, 2, 26, 1502, 5, 22],
- [2079, 9, 30, 1503, 1, 5], [2079, 10, 1, 1503, 1, 7], [2080, 5, 6, 1503, 8, 17],
- [2080, 5, 8, 1503, 8, 19], [2081, 0, 12, 1504, 4, 2], [2081, 0, 14, 1504, 4, 4],
- [2081, 7, 20, 1504, 11, 15], [2081, 7, 22, 1504, 11, 17], [2082, 2, 28, 1505, 6, 28],
- [2082, 2, 30, 1505, 6, 30], [2082, 10, 3, 1506, 2, 12], [2082, 10, 5, 1506, 2, 14],
- [2083, 5, 11, 1506, 9, 25], [2083, 5, 13, 1506, 9, 27], [2084, 0, 17, 1507, 5, 9],
- [2084, 0, 19, 1507, 5, 11], [2084, 7, 24, 1507, 12, 22], [2084, 7, 26, 1507, 12, 24],
- [2085, 3, 1, 1508, 8, 6], [2085, 3, 3, 1508, 8, 8], [2085, 10, 7, 1509, 3, 19],
- [2085, 10, 9, 1509, 3, 21], [2086, 5, 15, 1509, 11, 3], [2086, 5, 17, 1509, 11, 5],
- [2087, 0, 21, 1510, 6, 16], [2087, 0, 23, 1510, 6, 18], [2087, 7, 29, 1511, 1, 30],
- [2087, 7, 31, 1511, 2, 2], [2088, 3, 5, 1511, 9, 13], [2088, 3, 7, 1511, 9, 15],
- [2088, 10, 11, 1512, 4, 27], [2088, 10, 13, 1512, 4, 29], [2089, 5, 19, 1512, 12, 10],
- [2089, 5, 21, 1512, 12, 12], [2090, 0, 25, 1513, 7, 24], [2090, 0, 27, 1513, 7, 26],
- [2090, 8, 2, 1514, 3, 7], [2090, 8, 4, 1514, 3, 9], [2091, 3, 10, 1514, 10, 21],
- [2091, 3, 12, 1514, 10, 23], [2091, 10, 16, 1515, 6, 5], [2091, 10, 18, 1515, 6, 7],
- [2092, 5, 23, 1516, 1, 17], [2092, 5, 25, 1516, 1, 19], [2093, 0, 29, 1516, 9, 2],
- [2093, 0, 31, 1516, 9, 4], [2093, 8, 6, 1517, 4, 15], [2093, 8, 8, 1517, 4, 17],
- [2094, 3, 14, 1517, 11, 28], [2094, 3, 16, 1517, 12, 1], [2094, 10, 20, 1518, 7, 12],
- [2094, 10, 22, 1518, 7, 14], [2095, 5, 28, 1519, 2, 25], [2095, 5, 30, 1519, 2, 27],
- [2096, 1, 3, 1519, 10, 8], [2096, 1, 5, 1519, 10, 10], [2096, 8, 10, 1520, 5, 23],
- [2096, 8, 12, 1520, 5, 25], [2097, 3, 18, 1521, 1, 5], [2097, 3, 20, 1521, 1, 7],
- [2097, 10, 24, 1521, 8, 19], [2097, 10, 26, 1521, 8, 21], [2098, 6, 2, 1522, 4, 3],
- [2098, 6, 4, 1522, 4, 5], [2099, 1, 7, 1522, 11, 16], [2099, 1, 9, 1522, 11, 18],
- [2099, 8, 15, 1523, 6, 29], [2099, 8, 17, 1523, 7, 2], [2100, 3, 23, 1524, 2, 13],
- [2100, 3, 25, 1524, 2, 15], [2100, 10, 29, 1524, 9, 26], [2100, 11, 1, 1524, 9, 28],
- [2101, 6, 7, 1525, 5, 10], [2101, 6, 9, 1525, 5, 12], [2102, 1, 12, 1525, 12, 24],
- [2102, 1, 14, 1525, 12, 26], [2102, 8, 20, 1526, 8, 7], [2102, 8, 22, 1526, 8, 9],
- [2103, 3, 28, 1527, 3, 21], [2103, 3, 30, 1527, 3, 23], [2103, 11, 4, 1527, 11, 4],
- [2103, 11, 6, 1527, 11, 6], [2104, 6, 11, 1528, 6, 18], [2104, 6, 13, 1528, 6, 20],
- [2105, 1, 16, 1529, 2, 1], [2105, 1, 18, 1529, 2, 3], [2105, 8, 24, 1529, 9, 15],
- [2105, 8, 26, 1529, 9, 17], [2106, 4, 2, 1530, 4, 27], [2106, 4, 4, 1530, 4, 29],
- [2106, 11, 8, 1530, 12, 12], [2106, 11, 10, 1530, 12, 14], [2107, 6, 16, 1531, 7, 25],
- [2107, 6, 18, 1531, 7, 27], [2108, 1, 21, 1532, 3, 9], [2108, 1, 23, 1532, 3, 11],
- [2108, 8, 28, 1532, 10, 22], [2108, 8, 30, 1532, 10, 24], [2109, 4, 6, 1533, 6, 5],
- [2109, 4, 8, 1533, 6, 7], [2109, 11, 12, 1534, 1, 19], [2109, 11, 14, 1534, 1, 21],
- [2110, 6, 20, 1534, 9, 2], [2110, 6, 22, 1534, 9, 4], [2111, 1, 25, 1535, 4, 16],
- [2111, 1, 27, 1535, 4, 18], [2111, 9, 3, 1535, 11, 29], [2111, 9, 5, 1535, 12, 2],
- [2112, 4, 10, 1536, 7, 13], [2112, 4, 12, 1536, 7, 15], [2112, 11, 16, 1537, 2, 26],
- [2112, 11, 18, 1537, 2, 28], [2113, 6, 24, 1537, 10, 11], [2113, 6, 26, 1537, 10, 13],
- [2114, 2, 1, 1538, 5, 23], [2114, 2, 3, 1538, 5, 25], [2114, 9, 7, 1539, 1, 8],
- [2114, 9, 9, 1539, 1, 10], [2115, 4, 15, 1539, 8, 20], [2115, 4, 17, 1539, 8, 22],
- [2115, 11, 21, 1540, 4, 4], [2115, 11, 23, 1540, 4, 6], [2116, 6, 28, 1540, 11, 18],
- [2116, 6, 30, 1540, 11, 20], [2117, 2, 5, 1541, 7, 1], [2117, 2, 7, 1541, 7, 3],
- [2117, 9, 11, 1542, 2, 15], [2117, 9, 13, 1542, 2, 17], [2118, 4, 19, 1542, 9, 28],
- [2118, 4, 21, 1542, 9, 30], [2118, 11, 25, 1543, 5, 12], [2118, 11, 27, 1543, 5, 14],
- [2119, 7, 2, 1543, 12, 25], [2119, 7, 4, 1543, 12, 27], [2120, 2, 9, 1544, 8, 9],
- [2120, 2, 11, 1544, 8, 11], [2120, 9, 15, 1545, 3, 21], [2120, 9, 17, 1545, 3, 23],
- [2121, 4, 23, 1545, 11, 6], [2121, 4, 25, 1545, 11, 8], [2121, 11, 29, 1546, 6, 19],
- [2121, 11, 31, 1546, 6, 21], [2122, 7, 6, 1547, 2, 3], [2122, 7, 8, 1547, 2, 5],
- [2123, 2, 14, 1547, 9, 16], [2123, 2, 16, 1547, 9, 18], [2123, 9, 20, 1548, 4, 30],
- [2123, 9, 22, 1548, 5, 2], [2124, 4, 27, 1548, 12, 13], [2124, 4, 29, 1548, 12, 15],
- [2125, 0, 2, 1549, 7, 27], [2125, 0, 4, 1549, 7, 29], [2125, 7, 10, 1550, 3, 10],
- [2125, 7, 12, 1550, 3, 12], [2126, 2, 18, 1550, 10, 23], [2126, 2, 20, 1550, 10, 25],
- [2126, 9, 24, 1551, 6, 7], [2126, 9, 26, 1551, 6, 9], [2127, 5, 1, 1552, 1, 20],
- [2127, 5, 3, 1552, 1, 22], [2128, 0, 7, 1552, 9, 5], [2128, 0, 9, 1552, 9, 7],
- [2128, 7, 14, 1553, 4, 17], [2128, 7, 16, 1553, 4, 19], [2129, 2, 22, 1553, 12, 1],
- [2129, 2, 24, 1553, 12, 3], [2129, 9, 28, 1554, 7, 14], [2129, 9, 30, 1554, 7, 16],
- [2130, 5, 5, 1555, 2, 28], [2130, 5, 7, 1555, 3, 1], [2131, 0, 11, 1555, 10, 11],
- [2131, 0, 13, 1555, 10, 13], [2131, 7, 19, 1556, 5, 25], [2131, 7, 21, 1556, 5, 27],
- [2132, 2, 26, 1557, 1, 8], [2132, 2, 28, 1557, 1, 10], [2132, 10, 1, 1557, 8, 23],
- [2132, 10, 3, 1557, 8, 25], [2133, 5, 9, 1558, 4, 5], [2133, 5, 11, 1558, 4, 7],
- [2134, 0, 15, 1558, 11, 19], [2134, 0, 17, 1558, 11, 21], [2134, 7, 23, 1559, 7, 3],
- [2134, 7, 25, 1559, 7, 5], [2135, 2, 31, 1560, 2, 16], [2135, 3, 2, 1560, 2, 18],
- [2135, 10, 6, 1560, 9, 29], [2135, 10, 8, 1560, 10, 2], [2136, 5, 13, 1561, 5, 13],
- [2136, 5, 15, 1561, 5, 15], [2137, 0, 19, 1561, 12, 26], [2137, 0, 21, 1561, 12, 28],
- [2137, 7, 27, 1562, 8, 10], [2137, 7, 29, 1562, 8, 12], [2138, 3, 4, 1563, 3, 23],
- [2138, 3, 6, 1563, 3, 25], [2138, 10, 10, 1563, 11, 7], [2138, 10, 12, 1563, 11, 9],
- [2139, 5, 18, 1564, 6, 21], [2139, 5, 20, 1564, 6, 23], [2140, 0, 24, 1565, 2, 4],
- [2140, 0, 26, 1565, 2, 6], [2140, 7, 31, 1565, 9, 18], [2140, 8, 2, 1565, 9, 20],
- [2141, 3, 8, 1566, 5, 1], [2141, 3, 10, 1566, 5, 3], [2141, 10, 14, 1566, 12, 15],
- [2141, 10, 16, 1566, 12, 17], [2142, 5, 22, 1567, 7, 27], [2142, 5, 24, 1567, 7, 29],
- [2143, 0, 28, 1568, 3, 12], [2143, 0, 30, 1568, 3, 14], [2143, 8, 5, 1568, 10, 24],
- [2143, 8, 7, 1568, 10, 26], [2144, 3, 12, 1569, 6, 8], [2144, 3, 14, 1569, 6, 10],
- [2144, 10, 18, 1570, 1, 22], [2144, 10, 20, 1570, 1, 24], [2145, 5, 26, 1570, 9, 5],
- [2145, 5, 28, 1570, 9, 7], [2146, 1, 1, 1571, 4, 19], [2146, 1, 3, 1571, 4, 21],
- [2146, 8, 9, 1571, 12, 2], [2146, 8, 11, 1571, 12, 4], [2147, 3, 17, 1572, 7, 16],
- [2147, 3, 19, 1572, 7, 18], [2147, 10, 23, 1573, 2, 29], [2147, 10, 25, 1573, 3, 2],
- [2148, 5, 30, 1573, 10, 13], [2148, 6, 2, 1573, 10, 15], [2149, 1, 5, 1574, 5, 26],
- [2149, 1, 7, 1574, 5, 28], [2149, 8, 13, 1575, 1, 11], [2149, 8, 15, 1575, 1, 13],
- [2150, 3, 21, 1575, 8, 23], [2150, 3, 23, 1575, 8, 25], [2150, 10, 27, 1576, 4, 7],
- [2150, 10, 29, 1576, 4, 9], [2151, 6, 5, 1576, 11, 20], [2151, 6, 7, 1576, 11, 22],
- [2152, 1, 10, 1577, 7, 4], [2152, 1, 12, 1577, 7, 6], [2152, 8, 17, 1578, 2, 18],
- [2152, 8, 19, 1578, 2, 20], [2153, 3, 25, 1578, 10, 1], [2153, 3, 27, 1578, 10, 3],
- [2153, 11, 1, 1579, 5, 14], [2153, 11, 3, 1579, 5, 16], [2154, 6, 9, 1579, 12, 28],
- [2154, 6, 11, 1579, 12, 30], [2155, 1, 14, 1580, 8, 12], [2155, 1, 16, 1580, 8, 14],
- [2155, 8, 22, 1581, 3, 24], [2155, 8, 24, 1581, 3, 26], [2156, 3, 29, 1581, 11, 9],
- [2156, 4, 1, 1581, 11, 11], [2156, 11, 5, 1582, 6, 21], [2156, 11, 7, 1582, 6, 23],
- [2157, 6, 13, 1583, 2, 6], [2157, 6, 15, 1583, 2, 8], [2158, 1, 18, 1583, 9, 18],
- [2158, 1, 20, 1583, 9, 20], [2158, 8, 26, 1584, 5, 3], [2158, 8, 28, 1584, 5, 5],
- [2159, 4, 4, 1584, 12, 15], [2159, 4, 6, 1584, 12, 17], [2159, 11, 10, 1585, 7, 29],
- [2159, 11, 12, 1585, 8, 2], [2160, 6, 17, 1586, 3, 13], [2160, 6, 19, 1586, 3, 15],
- [2161, 1, 22, 1586, 10, 26], [2161, 1, 24, 1586, 10, 28], [2161, 8, 30, 1587, 6, 10],
- [2161, 9, 2, 1587, 6, 12], [2162, 4, 8, 1588, 1, 23], [2162, 4, 10, 1588, 1, 25],
- [2162, 11, 14, 1588, 9, 7], [2162, 11, 16, 1588, 9, 9], [2163, 6, 22, 1589, 4, 20],
- [2163, 6, 24, 1589, 4, 22], [2164, 1, 27, 1589, 12, 4], [2164, 1, 29, 1589, 12, 6],
- [2164, 9, 4, 1590, 7, 17], [2164, 9, 6, 1590, 7, 19], [2165, 4, 12, 1591, 3, 1],
- [2165, 4, 14, 1591, 3, 3], [2165, 11, 18, 1591, 10, 14], [2165, 11, 20, 1591, 10, 16],
- [2166, 6, 26, 1592, 5, 28], [2166, 6, 28, 1592, 5, 30], [2167, 2, 3, 1593, 1, 11],
- [2167, 2, 5, 1593, 1, 13], [2167, 9, 9, 1593, 8, 25], [2167, 9, 11, 1593, 8, 27],
- [2168, 4, 16, 1594, 4, 8], [2168, 4, 18, 1594, 4, 10], [2168, 11, 22, 1594, 11, 22],
- [2168, 11, 24, 1594, 11, 24], [2169, 6, 30, 1595, 7, 6], [2169, 7, 1, 1595, 7, 8],
- [2170, 2, 7, 1596, 2, 19], [2170, 2, 9, 1596, 2, 21], [2170, 9, 13, 1596, 10, 3],
- [2170, 9, 15, 1596, 10, 5], [2171, 4, 21, 1597, 5, 16], [2171, 4, 23, 1597, 5, 18],
- [2171, 11, 27, 1597, 12, 29], [2171, 11, 29, 1598, 1, 2], [2172, 7, 3, 1598, 8, 13],
- [2172, 7, 5, 1598, 8, 15], [2173, 2, 11, 1599, 3, 26], [2173, 2, 13, 1599, 3, 28],
- [2173, 9, 17, 1599, 11, 9], [2173, 9, 19, 1599, 11, 11], [2174, 4, 25, 1600, 6, 23],
- [2174, 4, 27, 1600, 6, 25], [2175, 10, 25, 1602, 1, 11], [1881, 10, 12, 1298, 12, 19]
- ];
- const MONTH_LENGTH = [
- [1300, 1, 30], [1300, 2, 29], [1300, 3, 30], [1300, 4, 29], [1300, 5, 30], [1300, 6, 29], [1300, 7, 30],
- [1300, 8, 29], [1300, 9, 30], [1300, 10, 29], [1300, 11, 30], [1300, 12, 29], [1301, 1, 30], [1301, 2, 30],
- [1301, 3, 29], [1301, 4, 30], [1301, 5, 29], [1301, 6, 30], [1301, 7, 29], [1301, 8, 30], [1301, 9, 29],
- [1301, 10, 30], [1301, 11, 29], [1301, 12, 29], [1302, 1, 30], [1302, 2, 30], [1302, 3, 30], [1302, 4, 29],
- [1302, 5, 30], [1302, 6, 30], [1302, 7, 29], [1302, 8, 29], [1302, 9, 30], [1302, 10, 29], [1302, 11, 29],
- [1302, 12, 30], [1303, 1, 29], [1303, 2, 30], [1303, 3, 30], [1303, 4, 29], [1303, 5, 30], [1303, 6, 30],
- [1303, 7, 29], [1303, 8, 30], [1303, 9, 29], [1303, 10, 30], [1303, 11, 29], [1303, 12, 29], [1304, 1, 29],
- [1304, 2, 30], [1304, 3, 30], [1304, 4, 29], [1304, 5, 30], [1304, 6, 30], [1304, 7, 30], [1304, 8, 29],
- [1304, 9, 30], [1304, 10, 29], [1304, 11, 30], [1304, 12, 29], [1305, 1, 29], [1305, 2, 29], [1305, 3, 30],
- [1305, 4, 30], [1305, 5, 29], [1305, 6, 30], [1305, 7, 30], [1305, 8, 29], [1305, 9, 30], [1305, 10, 30],
- [1305, 11, 29], [1305, 12, 29], [1306, 1, 30], [1306, 2, 29], [1306, 3, 30], [1306, 4, 29], [1306, 5, 30],
- [1306, 6, 29], [1306, 7, 30], [1306, 8, 29], [1306, 9, 30], [1306, 10, 30], [1306, 11, 29], [1306, 12, 30],
- [1307, 1, 29], [1307, 2, 30], [1307, 3, 29], [1307, 4, 30], [1307, 5, 29], [1307, 6, 30], [1307, 7, 29],
- [1307, 8, 30], [1307, 9, 29], [1307, 10, 30], [1307, 11, 29], [1307, 12, 30], [1308, 1, 29], [1308, 2, 30],
- [1308, 3, 30], [1308, 4, 29], [1308, 5, 30], [1308, 6, 29], [1308, 7, 30], [1308, 8, 29], [1308, 9, 30],
- [1308, 10, 29], [1308, 11, 29], [1308, 12, 30], [1309, 1, 29], [1309, 2, 30], [1309, 3, 30], [1309, 4, 30],
- [1309, 5, 30], [1309, 6, 29], [1309, 7, 29], [1309, 8, 30], [1309, 9, 29], [1309, 10, 29], [1309, 11, 30],
- [1309, 12, 29], [1310, 1, 30], [1310, 2, 29], [1310, 3, 30], [1310, 4, 30], [1310, 5, 30], [1310, 6, 29],
- [1310, 7, 30], [1310, 8, 29], [1310, 9, 30], [1310, 10, 29], [1310, 11, 29], [1310, 12, 30], [1311, 1, 29],
- [1311, 2, 30], [1311, 3, 29], [1311, 4, 30], [1311, 5, 30], [1311, 6, 30], [1311, 7, 29], [1311, 8, 30],
- [1311, 9, 29], [1311, 10, 30], [1311, 11, 29], [1311, 12, 29], [1312, 1, 30], [1312, 2, 29], [1312, 3, 30],
- [1312, 4, 29], [1312, 5, 30], [1312, 6, 30], [1312, 7, 29], [1312, 8, 30], [1312, 9, 30], [1312, 10, 29],
- [1312, 11, 30], [1312, 12, 29], [1313, 1, 29], [1313, 2, 30], [1313, 3, 29], [1313, 4, 30], [1313, 5, 29],
- [1313, 6, 30], [1313, 7, 29], [1313, 8, 30], [1313, 9, 30], [1313, 10, 30], [1313, 11, 29], [1313, 12, 29],
- [1314, 1, 30], [1314, 2, 30], [1314, 3, 29], [1314, 4, 30], [1314, 5, 29], [1314, 6, 29], [1314, 7, 30],
- [1314, 8, 29], [1314, 9, 30], [1314, 10, 30], [1314, 11, 29], [1314, 12, 30], [1315, 1, 29], [1315, 2, 30],
- [1315, 3, 30], [1315, 4, 29], [1315, 5, 30], [1315, 6, 29], [1315, 7, 29], [1315, 8, 30], [1315, 9, 29],
- [1315, 10, 30], [1315, 11, 29], [1315, 12, 30], [1316, 1, 29], [1316, 2, 30], [1316, 3, 30], [1316, 4, 30],
- [1316, 5, 29], [1316, 6, 30], [1316, 7, 29], [1316, 8, 29], [1316, 9, 30], [1316, 10, 29], [1316, 11, 30],
- [1316, 12, 29], [1317, 1, 30], [1317, 2, 29], [1317, 3, 30], [1317, 4, 30], [1317, 5, 29], [1317, 6, 30],
- [1317, 7, 29], [1317, 8, 30], [1317, 9, 29], [1317, 10, 30], [1317, 11, 29], [1317, 12, 29], [1318, 1, 30],
- [1318, 2, 29], [1318, 3, 30], [1318, 4, 30], [1318, 5, 29], [1318, 6, 30], [1318, 7, 30], [1318, 8, 29],
- [1318, 9, 30], [1318, 10, 29], [1318, 11, 30], [1318, 12, 29], [1319, 1, 29], [1319, 2, 30], [1319, 3, 29],
- [1319, 4, 30], [1319, 5, 30], [1319, 6, 29], [1319, 7, 30], [1319, 8, 29], [1319, 9, 30], [1319, 10, 30],
- [1319, 11, 29], [1319, 12, 30], [1320, 1, 29], [1320, 2, 30], [1320, 3, 29], [1320, 4, 29], [1320, 5, 30],
- [1320, 6, 29], [1320, 7, 30], [1320, 8, 29], [1320, 9, 30], [1320, 10, 30], [1320, 11, 30], [1320, 12, 29],
- [1321, 1, 30], [1321, 2, 29], [1321, 3, 30], [1321, 4, 29], [1321, 5, 29], [1321, 6, 30], [1321, 7, 29],
- [1321, 8, 29], [1321, 9, 30], [1321, 10, 30], [1321, 11, 30], [1321, 12, 30], [1322, 1, 29], [1322, 2, 30],
- [1322, 3, 29], [1322, 4, 30], [1322, 5, 29], [1322, 6, 29], [1322, 7, 29], [1322, 8, 30], [1322, 9, 29],
- [1322, 10, 30], [1322, 11, 30], [1322, 12, 30], [1323, 1, 29], [1323, 2, 30], [1323, 3, 30], [1323, 4, 29],
- [1323, 5, 30], [1323, 6, 29], [1323, 7, 29], [1323, 8, 29], [1323, 9, 30], [1323, 10, 29], [1323, 11, 30],
- [1323, 12, 30], [1324, 1, 29], [1324, 2, 30], [1324, 3, 30], [1324, 4, 29], [1324, 5, 30], [1324, 6, 29],
- [1324, 7, 30], [1324, 8, 29], [1324, 9, 29], [1324, 10, 30], [1324, 11, 29], [1324, 12, 30], [1325, 1, 30],
- [1325, 2, 29], [1325, 3, 30], [1325, 4, 29], [1325, 5, 30], [1325, 6, 30], [1325, 7, 29], [1325, 8, 30],
- [1325, 9, 29], [1325, 10, 30], [1325, 11, 29], [1325, 12, 30], [1326, 1, 29], [1326, 2, 29], [1326, 3, 30],
- [1326, 4, 29], [1326, 5, 30], [1326, 6, 30], [1326, 7, 29], [1326, 8, 30], [1326, 9, 29], [1326, 10, 30],
- [1326, 11, 30], [1326, 12, 29], [1327, 1, 30], [1327, 2, 29], [1327, 3, 29], [1327, 4, 30], [1327, 5, 29],
- [1327, 6, 30], [1327, 7, 29], [1327, 8, 30], [1327, 9, 30], [1327, 10, 29], [1327, 11, 30], [1327, 12, 30],
- [1328, 1, 29], [1328, 2, 30], [1328, 3, 29], [1328, 4, 29], [1328, 5, 30], [1328, 6, 29], [1328, 7, 29],
- [1328, 8, 30], [1328, 9, 30], [1328, 10, 30], [1328, 11, 29], [1328, 12, 30], [1329, 1, 30], [1329, 2, 29],
- [1329, 3, 30], [1329, 4, 29], [1329, 5, 29], [1329, 6, 30], [1329, 7, 29], [1329, 8, 29], [1329, 9, 30],
- [1329, 10, 30], [1329, 11, 29], [1329, 12, 30], [1330, 1, 30], [1330, 2, 30], [1330, 3, 29], [1330, 4, 30],
- [1330, 5, 29], [1330, 6, 29], [1330, 7, 30], [1330, 8, 29], [1330, 9, 29], [1330, 10, 30], [1330, 11, 30],
- [1330, 12, 29], [1331, 1, 30], [1331, 2, 30], [1331, 3, 29], [1331, 4, 30], [1331, 5, 30], [1331, 6, 29],
- [1331, 7, 29], [1331, 8, 30], [1331, 9, 29], [1331, 10, 30], [1331, 11, 29], [1331, 12, 30], [1332, 1, 29],
- [1332, 2, 30], [1332, 3, 29], [1332, 4, 30], [1332, 5, 30], [1332, 6, 29], [1332, 7, 30], [1332, 8, 29],
- [1332, 9, 30], [1332, 10, 30], [1332, 11, 29], [1332, 12, 29], [1333, 1, 30], [1333, 2, 29], [1333, 3, 29],
- [1333, 4, 30], [1333, 5, 30], [1333, 6, 29], [1333, 7, 30], [1333, 8, 30], [1333, 9, 29], [1333, 10, 30],
- [1333, 11, 30], [1333, 12, 29], [1334, 1, 29], [1334, 2, 29], [1334, 3, 30], [1334, 4, 29], [1334, 5, 30],
- [1334, 6, 29], [1334, 7, 30], [1334, 8, 30], [1334, 9, 30], [1334, 10, 29], [1334, 11, 30], [1334, 12, 29],
- [1335, 1, 30], [1335, 2, 29], [1335, 3, 30], [1335, 4, 29], [1335, 5, 29], [1335, 6, 30], [1335, 7, 29],
- [1335, 8, 30], [1335, 9, 30], [1335, 10, 29], [1335, 11, 30], [1335, 12, 30], [1336, 1, 29], [1336, 2, 30],
- [1336, 3, 29], [1336, 4, 30], [1336, 5, 29], [1336, 6, 29], [1336, 7, 30], [1336, 8, 29], [1336, 9, 30],
- [1336, 10, 29], [1336, 11, 30], [1336, 12, 30], [1337, 1, 30], [1337, 2, 29], [1337, 3, 30], [1337, 4, 29],
- [1337, 5, 30], [1337, 6, 29], [1337, 7, 29], [1337, 8, 30], [1337, 9, 29], [1337, 10, 30], [1337, 11, 29],
- [1337, 12, 30], [1338, 1, 29], [1338, 2, 30], [1338, 3, 30], [1338, 4, 29], [1338, 5, 30], [1338, 6, 30],
- [1338, 7, 29], [1338, 8, 29], [1338, 9, 30], [1338, 10, 29], [1338, 11, 30], [1338, 12, 29], [1339, 1, 30],
- [1339, 2, 29], [1339, 3, 30], [1339, 4, 29], [1339, 5, 30], [1339, 6, 30], [1339, 7, 30], [1339, 8, 29],
- [1339, 9, 30], [1339, 10, 29], [1339, 11, 29], [1339, 12, 30], [1340, 1, 29], [1340, 2, 29], [1340, 3, 30],
- [1340, 4, 29], [1340, 5, 30], [1340, 6, 30], [1340, 7, 30], [1340, 8, 30], [1340, 9, 29], [1340, 10, 30],
- [1340, 11, 29], [1340, 12, 29], [1341, 1, 30], [1341, 2, 29], [1341, 3, 29], [1341, 4, 30], [1341, 5, 29],
- [1341, 6, 30], [1341, 7, 30], [1341, 8, 30], [1341, 9, 29], [1341, 10, 30], [1341, 11, 30], [1341, 12, 29],
- [1342, 1, 29], [1342, 2, 29], [1342, 3, 30], [1342, 4, 29], [1342, 5, 30], [1342, 6, 29], [1342, 7, 30],
- [1342, 8, 30], [1342, 9, 29], [1342, 10, 30], [1342, 11, 30], [1342, 12, 29], [1343, 1, 30], [1343, 2, 29],
- [1343, 3, 29], [1343, 4, 30], [1343, 5, 29], [1343, 6, 30], [1343, 7, 29], [1343, 8, 30], [1343, 9, 29],
- [1343, 10, 30], [1343, 11, 30], [1343, 12, 29], [1344, 1, 30], [1344, 2, 29], [1344, 3, 30], [1344, 4, 29],
- [1344, 5, 30], [1344, 6, 30], [1344, 7, 29], [1344, 8, 29], [1344, 9, 30], [1344, 10, 29], [1344, 11, 30],
- [1344, 12, 29], [1345, 1, 30], [1345, 2, 29], [1345, 3, 30], [1345, 4, 30], [1345, 5, 30], [1345, 6, 29],
- [1345, 7, 30], [1345, 8, 29], [1345, 9, 29], [1345, 10, 30], [1345, 11, 29], [1345, 12, 29], [1346, 1, 30],
- [1346, 2, 29], [1346, 3, 30], [1346, 4, 30], [1346, 5, 30], [1346, 6, 30], [1346, 7, 29], [1346, 8, 30],
- [1346, 9, 29], [1346, 10, 29], [1346, 11, 30], [1346, 12, 29], [1347, 1, 29], [1347, 2, 30], [1347, 3, 29],
- [1347, 4, 30], [1347, 5, 30], [1347, 6, 30], [1347, 7, 29], [1347, 8, 30], [1347, 9, 30], [1347, 10, 29],
- [1347, 11, 29], [1347, 12, 30], [1348, 1, 29], [1348, 2, 29], [1348, 3, 30], [1348, 4, 29], [1348, 5, 30],
- [1348, 6, 30], [1348, 7, 29], [1348, 8, 30], [1348, 9, 30], [1348, 10, 30], [1348, 11, 29], [1348, 12, 29],
- [1349, 1, 30], [1349, 2, 29], [1349, 3, 29], [1349, 4, 30], [1349, 5, 29], [1349, 6, 30], [1349, 7, 30],
- [1349, 8, 29], [1349, 9, 30], [1349, 10, 30], [1349, 11, 29], [1349, 12, 30], [1350, 1, 29], [1350, 2, 30],
- [1350, 3, 29], [1350, 4, 30], [1350, 5, 29], [1350, 6, 30], [1350, 7, 29], [1350, 8, 29], [1350, 9, 30],
- [1350, 10, 30], [1350, 11, 29], [1350, 12, 30], [1351, 1, 30], [1351, 2, 29], [1351, 3, 30], [1351, 4, 29],
- [1351, 5, 30], [1351, 6, 29], [1351, 7, 30], [1351, 8, 29], [1351, 9, 29], [1351, 10, 30], [1351, 11, 29],
- [1351, 12, 30], [1352, 1, 30], [1352, 2, 29], [1352, 3, 30], [1352, 4, 30], [1352, 5, 29], [1352, 6, 30],
- [1352, 7, 29], [1352, 8, 30], [1352, 9, 29], [1352, 10, 29], [1352, 11, 30], [1352, 12, 29], [1353, 1, 30],
- [1353, 2, 29], [1353, 3, 30], [1353, 4, 30], [1353, 5, 30], [1353, 6, 29], [1353, 7, 30], [1353, 8, 29],
- [1353, 9, 29], [1353, 10, 30], [1353, 11, 29], [1353, 12, 30], [1354, 1, 29], [1354, 2, 30], [1354, 3, 29],
- [1354, 4, 30], [1354, 5, 30], [1354, 6, 29], [1354, 7, 30], [1354, 8, 30], [1354, 9, 29], [1354, 10, 30],
- [1354, 11, 29], [1354, 12, 29], [1355, 1, 30], [1355, 2, 29], [1355, 3, 29], [1355, 4, 30], [1355, 5, 30],
- [1355, 6, 29], [1355, 7, 30], [1355, 8, 30], [1355, 9, 29], [1355, 10, 30], [1355, 11, 30], [1355, 12, 29],
- [1356, 1, 29], [1356, 2, 30], [1356, 3, 29], [1356, 4, 30], [1356, 5, 29], [1356, 6, 30], [1356, 7, 29],
- [1356, 8, 30], [1356, 9, 29], [1356, 10, 30], [1356, 11, 30], [1356, 12, 30], [1357, 1, 29], [1357, 2, 29],
- [1357, 3, 30], [1357, 4, 29], [1357, 5, 30], [1357, 6, 29], [1357, 7, 29], [1357, 8, 30], [1357, 9, 29],
- [1357, 10, 30], [1357, 11, 30], [1357, 12, 30], [1358, 1, 29], [1358, 2, 30], [1358, 3, 29], [1358, 4, 30],
- [1358, 5, 29], [1358, 6, 30], [1358, 7, 29], [1358, 8, 29], [1358, 9, 30], [1358, 10, 29], [1358, 11, 30],
- [1358, 12, 30], [1359, 1, 29], [1359, 2, 30], [1359, 3, 30], [1359, 4, 29], [1359, 5, 30], [1359, 6, 29],
- [1359, 7, 30], [1359, 8, 29], [1359, 9, 29], [1359, 10, 29], [1359, 11, 30], [1359, 12, 30], [1360, 1, 29],
- [1360, 2, 30], [1360, 3, 30], [1360, 4, 30], [1360, 5, 29], [1360, 6, 30], [1360, 7, 29], [1360, 8, 30],
- [1360, 9, 29], [1360, 10, 29], [1360, 11, 30], [1360, 12, 29], [1361, 1, 30], [1361, 2, 29], [1361, 3, 30],
- [1361, 4, 30], [1361, 5, 29], [1361, 6, 30], [1361, 7, 30], [1361, 8, 29], [1361, 9, 29], [1361, 10, 30],
- [1361, 11, 29], [1361, 12, 30], [1362, 1, 29], [1362, 2, 30], [1362, 3, 29], [1362, 4, 30], [1362, 5, 29],
- [1362, 6, 30], [1362, 7, 30], [1362, 8, 29], [1362, 9, 30], [1362, 10, 29], [1362, 11, 30], [1362, 12, 29],
- [1363, 1, 30], [1363, 2, 29], [1363, 3, 30], [1363, 4, 29], [1363, 5, 30], [1363, 6, 29], [1363, 7, 30],
- [1363, 8, 29], [1363, 9, 30], [1363, 10, 29], [1363, 11, 30], [1363, 12, 30], [1364, 1, 29], [1364, 2, 30],
- [1364, 3, 29], [1364, 4, 30], [1364, 5, 29], [1364, 6, 29], [1364, 7, 30], [1364, 8, 29], [1364, 9, 30],
- [1364, 10, 29], [1364, 11, 30], [1364, 12, 30], [1365, 1, 30], [1365, 2, 30], [1365, 3, 29], [1365, 4, 29],
- [1365, 5, 30], [1365, 6, 29], [1365, 7, 29], [1365, 8, 30], [1365, 9, 29], [1365, 10, 30], [1365, 11, 29],
- [1365, 12, 30], [1366, 1, 30], [1366, 2, 30], [1366, 3, 29], [1366, 4, 30], [1366, 5, 29], [1366, 6, 30],
- [1366, 7, 29], [1366, 8, 29], [1366, 9, 30], [1366, 10, 29], [1366, 11, 30], [1366, 12, 29], [1367, 1, 30],
- [1367, 2, 30], [1367, 3, 29], [1367, 4, 30], [1367, 5, 30], [1367, 6, 29], [1367, 7, 30], [1367, 8, 29],
- [1367, 9, 29], [1367, 10, 30], [1367, 11, 29], [1367, 12, 30], [1368, 1, 29], [1368, 2, 30], [1368, 3, 29],
- [1368, 4, 30], [1368, 5, 30], [1368, 6, 30], [1368, 7, 29], [1368, 8, 29], [1368, 9, 30], [1368, 10, 29],
- [1368, 11, 30], [1368, 12, 29], [1369, 1, 30], [1369, 2, 29], [1369, 3, 30], [1369, 4, 29], [1369, 5, 30],
- [1369, 6, 30], [1369, 7, 29], [1369, 8, 30], [1369, 9, 29], [1369, 10, 30], [1369, 11, 30], [1369, 12, 29],
- [1370, 1, 30], [1370, 2, 29], [1370, 3, 29], [1370, 4, 30], [1370, 5, 29], [1370, 6, 30], [1370, 7, 29],
- [1370, 8, 30], [1370, 9, 29], [1370, 10, 30], [1370, 11, 30], [1370, 12, 30], [1371, 1, 29], [1371, 2, 30],
- [1371, 3, 29], [1371, 4, 29], [1371, 5, 30], [1371, 6, 29], [1371, 7, 30], [1371, 8, 29], [1371, 9, 30],
- [1371, 10, 29], [1371, 11, 30], [1371, 12, 30], [1372, 1, 30], [1372, 2, 29], [1372, 3, 29], [1372, 4, 30],
- [1372, 5, 29], [1372, 6, 30], [1372, 7, 29], [1372, 8, 29], [1372, 9, 30], [1372, 10, 29], [1372, 11, 30],
- [1372, 12, 30], [1373, 1, 30], [1373, 2, 29], [1373, 3, 30], [1373, 4, 29], [1373, 5, 30], [1373, 6, 29],
- [1373, 7, 30], [1373, 8, 29], [1373, 9, 29], [1373, 10, 30], [1373, 11, 29], [1373, 12, 30], [1374, 1, 30],
- [1374, 2, 29], [1374, 3, 30], [1374, 4, 30], [1374, 5, 29], [1374, 6, 30], [1374, 7, 29], [1374, 8, 30],
- [1374, 9, 29], [1374, 10, 29], [1374, 11, 30], [1374, 12, 29], [1375, 1, 30], [1375, 2, 29], [1375, 3, 30],
- [1375, 4, 30], [1375, 5, 29], [1375, 6, 30], [1375, 7, 30], [1375, 8, 29], [1375, 9, 30], [1375, 10, 29],
- [1375, 11, 30], [1375, 12, 29], [1376, 1, 29], [1376, 2, 30], [1376, 3, 29], [1376, 4, 30], [1376, 5, 29],
- [1376, 6, 30], [1376, 7, 30], [1376, 8, 30], [1376, 9, 29], [1376, 10, 30], [1376, 11, 29], [1376, 12, 30],
- [1377, 1, 29], [1377, 2, 29], [1377, 3, 30], [1377, 4, 29], [1377, 5, 29], [1377, 6, 30], [1377, 7, 30],
- [1377, 8, 30], [1377, 9, 29], [1377, 10, 30], [1377, 11, 30], [1377, 12, 29], [1378, 1, 30], [1378, 2, 29],
- [1378, 3, 29], [1378, 4, 29], [1378, 5, 30], [1378, 6, 29], [1378, 7, 30], [1378, 8, 30], [1378, 9, 29],
- [1378, 10, 30], [1378, 11, 30], [1378, 12, 30], [1379, 1, 29], [1379, 2, 30], [1379, 3, 29], [1379, 4, 29],
- [1379, 5, 29], [1379, 6, 30], [1379, 7, 29], [1379, 8, 30], [1379, 9, 30], [1379, 10, 29], [1379, 11, 30],
- [1379, 12, 30], [1380, 1, 29], [1380, 2, 30], [1380, 3, 29], [1380, 4, 30], [1380, 5, 29], [1380, 6, 30],
- [1380, 7, 29], [1380, 8, 30], [1380, 9, 29], [1380, 10, 30], [1380, 11, 29], [1380, 12, 30], [1381, 1, 29],
- [1381, 2, 30], [1381, 3, 29], [1381, 4, 30], [1381, 5, 30], [1381, 6, 29], [1381, 7, 30], [1381, 8, 29],
- [1381, 9, 30], [1381, 10, 29], [1381, 11, 29], [1381, 12, 30], [1382, 1, 29], [1382, 2, 30], [1382, 3, 29],
- [1382, 4, 30], [1382, 5, 30], [1382, 6, 29], [1382, 7, 30], [1382, 8, 30], [1382, 9, 29], [1382, 10, 30],
- [1382, 11, 29], [1382, 12, 29], [1383, 1, 30], [1383, 2, 29], [1383, 3, 29], [1383, 4, 30], [1383, 5, 30],
- [1383, 6, 30], [1383, 7, 29], [1383, 8, 30], [1383, 9, 30], [1383, 10, 29], [1383, 11, 30], [1383, 12, 29],
- [1384, 1, 29], [1384, 2, 30], [1384, 3, 29], [1384, 4, 29], [1384, 5, 30], [1384, 6, 30], [1384, 7, 29],
- [1384, 8, 30], [1384, 9, 30], [1384, 10, 30], [1384, 11, 29], [1384, 12, 30], [1385, 1, 29], [1385, 2, 29],
- [1385, 3, 30], [1385, 4, 29], [1385, 5, 29], [1385, 6, 30], [1385, 7, 30], [1385, 8, 29], [1385, 9, 30],
- [1385, 10, 30], [1385, 11, 30], [1385, 12, 29], [1386, 1, 30], [1386, 2, 29], [1386, 3, 29], [1386, 4, 30],
- [1386, 5, 29], [1386, 6, 29], [1386, 7, 30], [1386, 8, 30], [1386, 9, 29], [1386, 10, 30], [1386, 11, 30],
- [1386, 12, 29], [1387, 1, 30], [1387, 2, 29], [1387, 3, 30], [1387, 4, 29], [1387, 5, 30], [1387, 6, 29],
- [1387, 7, 30], [1387, 8, 29], [1387, 9, 30], [1387, 10, 29], [1387, 11, 30], [1387, 12, 29], [1388, 1, 30],
- [1388, 2, 30], [1388, 3, 29], [1388, 4, 30], [1388, 5, 29], [1388, 6, 30], [1388, 7, 29], [1388, 8, 30],
- [1388, 9, 29], [1388, 10, 30], [1388, 11, 29], [1388, 12, 29], [1389, 1, 30], [1389, 2, 30], [1389, 3, 29],
- [1389, 4, 30], [1389, 5, 30], [1389, 6, 29], [1389, 7, 30], [1389, 8, 30], [1389, 9, 29], [1389, 10, 29],
- [1389, 11, 30], [1389, 12, 29], [1390, 1, 29], [1390, 2, 30], [1390, 3, 29], [1390, 4, 30], [1390, 5, 30],
- [1390, 6, 30], [1390, 7, 29], [1390, 8, 30], [1390, 9, 29], [1390, 10, 30], [1390, 11, 29], [1390, 12, 30],
- [1391, 1, 29], [1391, 2, 29], [1391, 3, 30], [1391, 4, 29], [1391, 5, 30], [1391, 6, 30], [1391, 7, 29],
- [1391, 8, 30], [1391, 9, 30], [1391, 10, 29], [1391, 11, 30], [1391, 12, 29], [1392, 1, 30], [1392, 2, 29],
- [1392, 3, 29], [1392, 4, 30], [1392, 5, 29], [1392, 6, 30], [1392, 7, 29], [1392, 8, 30], [1392, 9, 30],
- [1392, 10, 29], [1392, 11, 30], [1392, 12, 30], [1393, 1, 29], [1393, 2, 30], [1393, 3, 29], [1393, 4, 29],
- [1393, 5, 30], [1393, 6, 29], [1393, 7, 30], [1393, 8, 29], [1393, 9, 30], [1393, 10, 29], [1393, 11, 30],
- [1393, 12, 30], [1394, 1, 30], [1394, 2, 29], [1394, 3, 30], [1394, 4, 29], [1394, 5, 29], [1394, 6, 30],
- [1394, 7, 29], [1394, 8, 30], [1394, 9, 29], [1394, 10, 30], [1394, 11, 29], [1394, 12, 30], [1395, 1, 30],
- [1395, 2, 29], [1395, 3, 30], [1395, 4, 30], [1395, 5, 29], [1395, 6, 30], [1395, 7, 29], [1395, 8, 29],
- [1395, 9, 30], [1395, 10, 29], [1395, 11, 29], [1395, 12, 30], [1396, 1, 30], [1396, 2, 29], [1396, 3, 30],
- [1396, 4, 30], [1396, 5, 29], [1396, 6, 30], [1396, 7, 30], [1396, 8, 29], [1396, 9, 29], [1396, 10, 30],
- [1396, 11, 29], [1396, 12, 29], [1397, 1, 30], [1397, 2, 29], [1397, 3, 30], [1397, 4, 30], [1397, 5, 29],
- [1397, 6, 30], [1397, 7, 30], [1397, 8, 30], [1397, 9, 29], [1397, 10, 29], [1397, 11, 29], [1397, 12, 30],
- [1398, 1, 29], [1398, 2, 30], [1398, 3, 29], [1398, 4, 30], [1398, 5, 30], [1398, 6, 29], [1398, 7, 30],
- [1398, 8, 30], [1398, 9, 29], [1398, 10, 30], [1398, 11, 29], [1398, 12, 29], [1399, 1, 30], [1399, 2, 29],
- [1399, 3, 30], [1399, 4, 29], [1399, 5, 30], [1399, 6, 29], [1399, 7, 30], [1399, 8, 30], [1399, 9, 29],
- [1399, 10, 30], [1399, 11, 29], [1399, 12, 30], [1400, 1, 30], [1400, 2, 29], [1400, 3, 30], [1400, 4, 29],
- [1400, 5, 29], [1400, 6, 30], [1400, 7, 29], [1400, 8, 30], [1400, 9, 29], [1400, 10, 30], [1400, 11, 29],
- [1400, 12, 30], [1401, 1, 30], [1401, 2, 30], [1401, 3, 29], [1401, 4, 30], [1401, 5, 29], [1401, 6, 29],
- [1401, 7, 30], [1401, 8, 29], [1401, 9, 29], [1401, 10, 30], [1401, 11, 29], [1401, 12, 30], [1402, 1, 30],
- [1402, 2, 30], [1402, 3, 30], [1402, 4, 29], [1402, 5, 30], [1402, 6, 29], [1402, 7, 29], [1402, 8, 30],
- [1402, 9, 29], [1402, 10, 29], [1402, 11, 30], [1402, 12, 29], [1403, 1, 30], [1403, 2, 30], [1403, 3, 30],
- [1403, 4, 29], [1403, 5, 30], [1403, 6, 30], [1403, 7, 29], [1403, 8, 29], [1403, 9, 30], [1403, 10, 29],
- [1403, 11, 29], [1403, 12, 30], [1404, 1, 29], [1404, 2, 30], [1404, 3, 30], [1404, 4, 29], [1404, 5, 30],
- [1404, 6, 30], [1404, 7, 29], [1404, 8, 30], [1404, 9, 29], [1404, 10, 30], [1404, 11, 29], [1404, 12, 29],
- [1405, 1, 30], [1405, 2, 29], [1405, 3, 30], [1405, 4, 29], [1405, 5, 30], [1405, 6, 30], [1405, 7, 30],
- [1405, 8, 29], [1405, 9, 30], [1405, 10, 29], [1405, 11, 29], [1405, 12, 30], [1406, 1, 30], [1406, 2, 29],
- [1406, 3, 29], [1406, 4, 30], [1406, 5, 29], [1406, 6, 30], [1406, 7, 30], [1406, 8, 29], [1406, 9, 30],
- [1406, 10, 29], [1406, 11, 30], [1406, 12, 30], [1407, 1, 29], [1407, 2, 30], [1407, 3, 29], [1407, 4, 29],
- [1407, 5, 30], [1407, 6, 29], [1407, 7, 30], [1407, 8, 29], [1407, 9, 30], [1407, 10, 29], [1407, 11, 30],
- [1407, 12, 30], [1408, 1, 30], [1408, 2, 29], [1408, 3, 30], [1408, 4, 29], [1408, 5, 30], [1408, 6, 29],
- [1408, 7, 29], [1408, 8, 30], [1408, 9, 29], [1408, 10, 29], [1408, 11, 30], [1408, 12, 30], [1409, 1, 30],
- [1409, 2, 30], [1409, 3, 29], [1409, 4, 30], [1409, 5, 29], [1409, 6, 30], [1409, 7, 29], [1409, 8, 29],
- [1409, 9, 30], [1409, 10, 29], [1409, 11, 29], [1409, 12, 30], [1410, 1, 30], [1410, 2, 30], [1410, 3, 29],
- [1410, 4, 30], [1410, 5, 30], [1410, 6, 29], [1410, 7, 30], [1410, 8, 29], [1410, 9, 29], [1410, 10, 30],
- [1410, 11, 29], [1410, 12, 29], [1411, 1, 30], [1411, 2, 30], [1411, 3, 29], [1411, 4, 30], [1411, 5, 30],
- [1411, 6, 29], [1411, 7, 30], [1411, 8, 30], [1411, 9, 29], [1411, 10, 29], [1411, 11, 30], [1411, 12, 29],
- [1412, 1, 30], [1412, 2, 29], [1412, 3, 30], [1412, 4, 29], [1412, 5, 30], [1412, 6, 29], [1412, 7, 30],
- [1412, 8, 30], [1412, 9, 30], [1412, 10, 29], [1412, 11, 29], [1412, 12, 30], [1413, 1, 29], [1413, 2, 30],
- [1413, 3, 29], [1413, 4, 29], [1413, 5, 30], [1413, 6, 29], [1413, 7, 30], [1413, 8, 30], [1413, 9, 30],
- [1413, 10, 29], [1413, 11, 30], [1413, 12, 29], [1414, 1, 30], [1414, 2, 29], [1414, 3, 30], [1414, 4, 29],
- [1414, 5, 29], [1414, 6, 30], [1414, 7, 29], [1414, 8, 30], [1414, 9, 30], [1414, 10, 29], [1414, 11, 30],
- [1414, 12, 30], [1415, 1, 29], [1415, 2, 30], [1415, 3, 29], [1415, 4, 30], [1415, 5, 29], [1415, 6, 29],
- [1415, 7, 30], [1415, 8, 29], [1415, 9, 30], [1415, 10, 29], [1415, 11, 30], [1415, 12, 30], [1416, 1, 30],
- [1416, 2, 29], [1416, 3, 30], [1416, 4, 29], [1416, 5, 30], [1416, 6, 29], [1416, 7, 29], [1416, 8, 30],
- [1416, 9, 29], [1416, 10, 30], [1416, 11, 29], [1416, 12, 30], [1417, 1, 30], [1417, 2, 29], [1417, 3, 30],
- [1417, 4, 30], [1417, 5, 29], [1417, 6, 29], [1417, 7, 30], [1417, 8, 29], [1417, 9, 30], [1417, 10, 29],
- [1417, 11, 30], [1417, 12, 29], [1418, 1, 30], [1418, 2, 29], [1418, 3, 30], [1418, 4, 30], [1418, 5, 29],
- [1418, 6, 30], [1418, 7, 29], [1418, 8, 30], [1418, 9, 29], [1418, 10, 30], [1418, 11, 29], [1418, 12, 30],
- [1419, 1, 29], [1419, 2, 30], [1419, 3, 29], [1419, 4, 30], [1419, 5, 29], [1419, 6, 30], [1419, 7, 29],
- [1419, 8, 30], [1419, 9, 30], [1419, 10, 30], [1419, 11, 29], [1419, 12, 29], [1420, 1, 29], [1420, 2, 30],
- [1420, 3, 29], [1420, 4, 29], [1420, 5, 30], [1420, 6, 29], [1420, 7, 30], [1420, 8, 30], [1420, 9, 30],
- [1420, 10, 30], [1420, 11, 29], [1420, 12, 30], [1421, 1, 29], [1421, 2, 29], [1421, 3, 30], [1421, 4, 29],
- [1421, 5, 29], [1421, 6, 29], [1421, 7, 30], [1421, 8, 30], [1421, 9, 30], [1421, 10, 30], [1421, 11, 29],
- [1421, 12, 30], [1422, 1, 30], [1422, 2, 29], [1422, 3, 29], [1422, 4, 30], [1422, 5, 29], [1422, 6, 29],
- [1422, 7, 29], [1422, 8, 30], [1422, 9, 30], [1422, 10, 30], [1422, 11, 29], [1422, 12, 30], [1423, 1, 30],
- [1423, 2, 29], [1423, 3, 30], [1423, 4, 29], [1423, 5, 30], [1423, 6, 29], [1423, 7, 29], [1423, 8, 30],
- [1423, 9, 29], [1423, 10, 30], [1423, 11, 29], [1423, 12, 30], [1424, 1, 30], [1424, 2, 29], [1424, 3, 30],
- [1424, 4, 30], [1424, 5, 29], [1424, 6, 30], [1424, 7, 29], [1424, 8, 29], [1424, 9, 30], [1424, 10, 29],
- [1424, 11, 30], [1424, 12, 29], [1425, 1, 30], [1425, 2, 29], [1425, 3, 30], [1425, 4, 30], [1425, 5, 29],
- [1425, 6, 30], [1425, 7, 29], [1425, 8, 30], [1425, 9, 30], [1425, 10, 29], [1425, 11, 30], [1425, 12, 29],
- [1426, 1, 29], [1426, 2, 30], [1426, 3, 29], [1426, 4, 30], [1426, 5, 29], [1426, 6, 30], [1426, 7, 30],
- [1426, 8, 29], [1426, 9, 30], [1426, 10, 30], [1426, 11, 29], [1426, 12, 30], [1427, 1, 29], [1427, 2, 29],
- [1427, 3, 30], [1427, 4, 29], [1427, 5, 30], [1427, 6, 29], [1427, 7, 30], [1427, 8, 30], [1427, 9, 29],
- [1427, 10, 30], [1427, 11, 30], [1427, 12, 29], [1428, 1, 30], [1428, 2, 29], [1428, 3, 29], [1428, 4, 30],
- [1428, 5, 29], [1428, 6, 29], [1428, 7, 30], [1428, 8, 30], [1428, 9, 30], [1428, 10, 29], [1428, 11, 30],
- [1428, 12, 30], [1429, 1, 29], [1429, 2, 30], [1429, 3, 29], [1429, 4, 29], [1429, 5, 30], [1429, 6, 29],
- [1429, 7, 29], [1429, 8, 30], [1429, 9, 30], [1429, 10, 29], [1429, 11, 30], [1429, 12, 30], [1430, 1, 29],
- [1430, 2, 30], [1430, 3, 30], [1430, 4, 29], [1430, 5, 29], [1430, 6, 30], [1430, 7, 29], [1430, 8, 30],
- [1430, 9, 29], [1430, 10, 30], [1430, 11, 29], [1430, 12, 30], [1431, 1, 29], [1431, 2, 30], [1431, 3, 30],
- [1431, 4, 29], [1431, 5, 30], [1431, 6, 29], [1431, 7, 30], [1431, 8, 29], [1431, 9, 30], [1431, 10, 29],
- [1431, 11, 29], [1431, 12, 30], [1432, 1, 29], [1432, 2, 30], [1432, 3, 30], [1432, 4, 30], [1432, 5, 29],
- [1432, 6, 30], [1432, 7, 29], [1432, 8, 30], [1432, 9, 29], [1432, 10, 30], [1432, 11, 29], [1432, 12, 29],
- [1433, 1, 30], [1433, 2, 29], [1433, 3, 30], [1433, 4, 30], [1433, 5, 29], [1433, 6, 30], [1433, 7, 30],
- [1433, 8, 29], [1433, 9, 30], [1433, 10, 29], [1433, 11, 30], [1433, 12, 29], [1434, 1, 29], [1434, 2, 30],
- [1434, 3, 29], [1434, 4, 30], [1434, 5, 29], [1434, 6, 30], [1434, 7, 30], [1434, 8, 29], [1434, 9, 30],
- [1434, 10, 30], [1434, 11, 29], [1434, 12, 29], [1435, 1, 30], [1435, 2, 29], [1435, 3, 30], [1435, 4, 29],
- [1435, 5, 30], [1435, 6, 29], [1435, 7, 30], [1435, 8, 29], [1435, 9, 30], [1435, 10, 30], [1435, 11, 29],
- [1435, 12, 30], [1436, 1, 29], [1436, 2, 30], [1436, 3, 29], [1436, 4, 30], [1436, 5, 29], [1436, 6, 30],
- [1436, 7, 29], [1436, 8, 30], [1436, 9, 29], [1436, 10, 30], [1436, 11, 29], [1436, 12, 30], [1437, 1, 30],
- [1437, 2, 29], [1437, 3, 30], [1437, 4, 30], [1437, 5, 29], [1437, 6, 29], [1437, 7, 30], [1437, 8, 29],
- [1437, 9, 30], [1437, 10, 29], [1437, 11, 29], [1437, 12, 30], [1438, 1, 30], [1438, 2, 29], [1438, 3, 30],
- [1438, 4, 30], [1438, 5, 30], [1438, 6, 29], [1438, 7, 29], [1438, 8, 30], [1438, 9, 29], [1438, 10, 29],
- [1438, 11, 30], [1438, 12, 29], [1439, 1, 30], [1439, 2, 29], [1439, 3, 30], [1439, 4, 30], [1439, 5, 30],
- [1439, 6, 29], [1439, 7, 30], [1439, 8, 29], [1439, 9, 30], [1439, 10, 29], [1439, 11, 29], [1439, 12, 30],
- [1440, 1, 29], [1440, 2, 30], [1440, 3, 29], [1440, 4, 30], [1440, 5, 30], [1440, 6, 30], [1440, 7, 29],
- [1440, 8, 30], [1440, 9, 29], [1440, 10, 30], [1440, 11, 29], [1440, 12, 29], [1441, 1, 30], [1441, 2, 29],
- [1441, 3, 30], [1441, 4, 29], [1441, 5, 30], [1441, 6, 30], [1441, 7, 29], [1441, 8, 30], [1441, 9, 30],
- [1441, 10, 29], [1441, 11, 30], [1441, 12, 29], [1442, 1, 29], [1442, 2, 30], [1442, 3, 29], [1442, 4, 30],
- [1442, 5, 29], [1442, 6, 30], [1442, 7, 29], [1442, 8, 30], [1442, 9, 30], [1442, 10, 29], [1442, 11, 30],
- [1442, 12, 29], [1443, 1, 30], [1443, 2, 29], [1443, 3, 30], [1443, 4, 29], [1443, 5, 30], [1443, 6, 29],
- [1443, 7, 30], [1443, 8, 29], [1443, 9, 30], [1443, 10, 29], [1443, 11, 30], [1443, 12, 30], [1444, 1, 29],
- [1444, 2, 30], [1444, 3, 29], [1444, 4, 30], [1444, 5, 30], [1444, 6, 29], [1444, 7, 29], [1444, 8, 30],
- [1444, 9, 29], [1444, 10, 30], [1444, 11, 29], [1444, 12, 30], [1445, 1, 29], [1445, 2, 30], [1445, 3, 30],
- [1445, 4, 30], [1445, 5, 29], [1445, 6, 30], [1445, 7, 29], [1445, 8, 29], [1445, 9, 30], [1445, 10, 29],
- [1445, 11, 29], [1445, 12, 30], [1446, 1, 29], [1446, 2, 30], [1446, 3, 30], [1446, 4, 30], [1446, 5, 29],
- [1446, 6, 30], [1446, 7, 30], [1446, 8, 29], [1446, 9, 29], [1446, 10, 30], [1446, 11, 29], [1446, 12, 29],
- [1447, 1, 30], [1447, 2, 29], [1447, 3, 30], [1447, 4, 30], [1447, 5, 30], [1447, 6, 29], [1447, 7, 30],
- [1447, 8, 29], [1447, 9, 30], [1447, 10, 29], [1447, 11, 30], [1447, 12, 29], [1448, 1, 29], [1448, 2, 30],
- [1448, 3, 29], [1448, 4, 30], [1448, 5, 30], [1448, 6, 29], [1448, 7, 30], [1448, 8, 30], [1448, 9, 29],
- [1448, 10, 30], [1448, 11, 29], [1448, 12, 30], [1449, 1, 29], [1449, 2, 29], [1449, 3, 30], [1449, 4, 29],
- [1449, 5, 30], [1449, 6, 29], [1449, 7, 30], [1449, 8, 30], [1449, 9, 29], [1449, 10, 30], [1449, 11, 30],
- [1449, 12, 29], [1450, 1, 30], [1450, 2, 29], [1450, 3, 30], [1450, 4, 29], [1450, 5, 29], [1450, 6, 30],
- [1450, 7, 29], [1450, 8, 30], [1450, 9, 29], [1450, 10, 30], [1450, 11, 30], [1450, 12, 29], [1451, 1, 30],
- [1451, 2, 30], [1451, 3, 30], [1451, 4, 29], [1451, 5, 29], [1451, 6, 30], [1451, 7, 29], [1451, 8, 29],
- [1451, 9, 30], [1451, 10, 30], [1451, 11, 29], [1451, 12, 30], [1452, 1, 30], [1452, 2, 29], [1452, 3, 30],
- [1452, 4, 30], [1452, 5, 29], [1452, 6, 29], [1452, 7, 30], [1452, 8, 29], [1452, 9, 29], [1452, 10, 30],
- [1452, 11, 29], [1452, 12, 30], [1453, 1, 30], [1453, 2, 29], [1453, 3, 30], [1453, 4, 30], [1453, 5, 29],
- [1453, 6, 30], [1453, 7, 29], [1453, 8, 30], [1453, 9, 29], [1453, 10, 29], [1453, 11, 30], [1453, 12, 29],
- [1454, 1, 30], [1454, 2, 29], [1454, 3, 30], [1454, 4, 30], [1454, 5, 29], [1454, 6, 30], [1454, 7, 30],
- [1454, 8, 29], [1454, 9, 30], [1454, 10, 29], [1454, 11, 30], [1454, 12, 29], [1455, 1, 29], [1455, 2, 30],
- [1455, 3, 29], [1455, 4, 30], [1455, 5, 30], [1455, 6, 29], [1455, 7, 30], [1455, 8, 29], [1455, 9, 30],
- [1455, 10, 30], [1455, 11, 29], [1455, 12, 30], [1456, 1, 29], [1456, 2, 29], [1456, 3, 30], [1456, 4, 29],
- [1456, 5, 30], [1456, 6, 29], [1456, 7, 30], [1456, 8, 29], [1456, 9, 30], [1456, 10, 30], [1456, 11, 30],
- [1456, 12, 29], [1457, 1, 30], [1457, 2, 29], [1457, 3, 29], [1457, 4, 30], [1457, 5, 29], [1457, 6, 29],
- [1457, 7, 30], [1457, 8, 29], [1457, 9, 30], [1457, 10, 30], [1457, 11, 30], [1457, 12, 30], [1458, 1, 29],
- [1458, 2, 30], [1458, 3, 29], [1458, 4, 29], [1458, 5, 30], [1458, 6, 29], [1458, 7, 29], [1458, 8, 30],
- [1458, 9, 29], [1458, 10, 30], [1458, 11, 30], [1458, 12, 30], [1459, 1, 29], [1459, 2, 30], [1459, 3, 30],
- [1459, 4, 29], [1459, 5, 29], [1459, 6, 30], [1459, 7, 29], [1459, 8, 29], [1459, 9, 30], [1459, 10, 29],
- [1459, 11, 30], [1459, 12, 30], [1460, 1, 29], [1460, 2, 30], [1460, 3, 30], [1460, 4, 29], [1460, 5, 30],
- [1460, 6, 29], [1460, 7, 30], [1460, 8, 29], [1460, 9, 29], [1460, 10, 30], [1460, 11, 29], [1460, 12, 30],
- [1461, 1, 29], [1461, 2, 30], [1461, 3, 30], [1461, 4, 29], [1461, 5, 30], [1461, 6, 29], [1461, 7, 30],
- [1461, 8, 29], [1461, 9, 30], [1461, 10, 30], [1461, 11, 29], [1461, 12, 29], [1462, 1, 30], [1462, 2, 29],
- [1462, 3, 30], [1462, 4, 29], [1462, 5, 30], [1462, 6, 30], [1462, 7, 29], [1462, 8, 30], [1462, 9, 29],
- [1462, 10, 30], [1462, 11, 30], [1462, 12, 29], [1463, 1, 29], [1463, 2, 30], [1463, 3, 29], [1463, 4, 30],
- [1463, 5, 29], [1463, 6, 30], [1463, 7, 29], [1463, 8, 30], [1463, 9, 30], [1463, 10, 30], [1463, 11, 29],
- [1463, 12, 30], [1464, 1, 29], [1464, 2, 30], [1464, 3, 29], [1464, 4, 29], [1464, 5, 30], [1464, 6, 29],
- [1464, 7, 29], [1464, 8, 30], [1464, 9, 30], [1464, 10, 30], [1464, 11, 29], [1464, 12, 30], [1465, 1, 30],
- [1465, 2, 29], [1465, 3, 30], [1465, 4, 29], [1465, 5, 29], [1465, 6, 30], [1465, 7, 29], [1465, 8, 29],
- [1465, 9, 30], [1465, 10, 30], [1465, 11, 29], [1465, 12, 30], [1466, 1, 30], [1466, 2, 30], [1466, 3, 29],
- [1466, 4, 30], [1466, 5, 29], [1466, 6, 29], [1466, 7, 29], [1466, 8, 30], [1466, 9, 29], [1466, 10, 30],
- [1466, 11, 30], [1466, 12, 29], [1467, 1, 30], [1467, 2, 30], [1467, 3, 29], [1467, 4, 30], [1467, 5, 30],
- [1467, 6, 29], [1467, 7, 29], [1467, 8, 30], [1467, 9, 29], [1467, 10, 30], [1467, 11, 29], [1467, 12, 30],
- [1468, 1, 29], [1468, 2, 30], [1468, 3, 29], [1468, 4, 30], [1468, 5, 30], [1468, 6, 29], [1468, 7, 30],
- [1468, 8, 29], [1468, 9, 30], [1468, 10, 29], [1468, 11, 30], [1468, 12, 29], [1469, 1, 29], [1469, 2, 30],
- [1469, 3, 29], [1469, 4, 30], [1469, 5, 30], [1469, 6, 29], [1469, 7, 30], [1469, 8, 30], [1469, 9, 29],
- [1469, 10, 30], [1469, 11, 29], [1469, 12, 30], [1470, 1, 29], [1470, 2, 29], [1470, 3, 30], [1470, 4, 29],
- [1470, 5, 30], [1470, 6, 30], [1470, 7, 29], [1470, 8, 30], [1470, 9, 30], [1470, 10, 29], [1470, 11, 30],
- [1470, 12, 29], [1471, 1, 30], [1471, 2, 29], [1471, 3, 29], [1471, 4, 30], [1471, 5, 29], [1471, 6, 30],
- [1471, 7, 29], [1471, 8, 30], [1471, 9, 30], [1471, 10, 29], [1471, 11, 30], [1471, 12, 30], [1472, 1, 29],
- [1472, 2, 30], [1472, 3, 29], [1472, 4, 29], [1472, 5, 30], [1472, 6, 29], [1472, 7, 30], [1472, 8, 29],
- [1472, 9, 30], [1472, 10, 30], [1472, 11, 29], [1472, 12, 30], [1473, 1, 29], [1473, 2, 30], [1473, 3, 29],
- [1473, 4, 30], [1473, 5, 30], [1473, 6, 29], [1473, 7, 29], [1473, 8, 30], [1473, 9, 29], [1473, 10, 30],
- [1473, 11, 29], [1473, 12, 30], [1474, 1, 29], [1474, 2, 30], [1474, 3, 30], [1474, 4, 29], [1474, 5, 30],
- [1474, 6, 30], [1474, 7, 29], [1474, 8, 29], [1474, 9, 30], [1474, 10, 29], [1474, 11, 30], [1474, 12, 29],
- [1475, 1, 29], [1475, 2, 30], [1475, 3, 30], [1475, 4, 29], [1475, 5, 30], [1475, 6, 30], [1475, 7, 30],
- [1475, 8, 29], [1475, 9, 29], [1475, 10, 30], [1475, 11, 29], [1475, 12, 29], [1476, 1, 30], [1476, 2, 29],
- [1476, 3, 30], [1476, 4, 29], [1476, 5, 30], [1476, 6, 30], [1476, 7, 30], [1476, 8, 29], [1476, 9, 30],
- [1476, 10, 29], [1476, 11, 30], [1476, 12, 29], [1477, 1, 29], [1477, 2, 30], [1477, 3, 29], [1477, 4, 29],
- [1477, 5, 30], [1477, 6, 30], [1477, 7, 30], [1477, 8, 30], [1477, 9, 29], [1477, 10, 30], [1477, 11, 29],
- [1477, 12, 30], [1478, 1, 29], [1478, 2, 29], [1478, 3, 30], [1478, 4, 29], [1478, 5, 30], [1478, 6, 29],
- [1478, 7, 30], [1478, 8, 30], [1478, 9, 29], [1478, 10, 30], [1478, 11, 30], [1478, 12, 29], [1479, 1, 30],
- [1479, 2, 29], [1479, 3, 29], [1479, 4, 30], [1479, 5, 29], [1479, 6, 30], [1479, 7, 29], [1479, 8, 30],
- [1479, 9, 29], [1479, 10, 30], [1479, 11, 30], [1479, 12, 29], [1480, 1, 30], [1480, 2, 29], [1480, 3, 30],
- [1480, 4, 29], [1480, 5, 30], [1480, 6, 29], [1480, 7, 30], [1480, 8, 29], [1480, 9, 30], [1480, 10, 29],
- [1480, 11, 30], [1480, 12, 29], [1481, 1, 30], [1481, 2, 29], [1481, 3, 30], [1481, 4, 30], [1481, 5, 29],
- [1481, 6, 30], [1481, 7, 29], [1481, 8, 30], [1481, 9, 29], [1481, 10, 30], [1481, 11, 29], [1481, 12, 29],
- [1482, 1, 30], [1482, 2, 29], [1482, 3, 30], [1482, 4, 30], [1482, 5, 30], [1482, 6, 30], [1482, 7, 29],
- [1482, 8, 30], [1482, 9, 29], [1482, 10, 29], [1482, 11, 30], [1482, 12, 29], [1483, 1, 29], [1483, 2, 30],
- [1483, 3, 29], [1483, 4, 30], [1483, 5, 30], [1483, 6, 30], [1483, 7, 29], [1483, 8, 30], [1483, 9, 30],
- [1483, 10, 29], [1483, 11, 29], [1483, 12, 30], [1484, 1, 29], [1484, 2, 29], [1484, 3, 30], [1484, 4, 29],
- [1484, 5, 30], [1484, 6, 30], [1484, 7, 30], [1484, 8, 29], [1484, 9, 30], [1484, 10, 29], [1484, 11, 30],
- [1484, 12, 29], [1485, 1, 30], [1485, 2, 29], [1485, 3, 29], [1485, 4, 30], [1485, 5, 29], [1485, 6, 30],
- [1485, 7, 30], [1485, 8, 29], [1485, 9, 30], [1485, 10, 30], [1485, 11, 29], [1485, 12, 30], [1486, 1, 29],
- [1486, 2, 30], [1486, 3, 29], [1486, 4, 29], [1486, 5, 30], [1486, 6, 29], [1486, 7, 30], [1486, 8, 29],
- [1486, 9, 30], [1486, 10, 30], [1486, 11, 29], [1486, 12, 30], [1487, 1, 30], [1487, 2, 29], [1487, 3, 30],
- [1487, 4, 29], [1487, 5, 30], [1487, 6, 29], [1487, 7, 29], [1487, 8, 30], [1487, 9, 29], [1487, 10, 30],
- [1487, 11, 29], [1487, 12, 30], [1488, 1, 30], [1488, 2, 29], [1488, 3, 30], [1488, 4, 30], [1488, 5, 29],
- [1488, 6, 30], [1488, 7, 29], [1488, 8, 29], [1488, 9, 30], [1488, 10, 29], [1488, 11, 30], [1488, 12, 29],
- [1489, 1, 30], [1489, 2, 29], [1489, 3, 30], [1489, 4, 30], [1489, 5, 30], [1489, 6, 29], [1489, 7, 30],
- [1489, 8, 29], [1489, 9, 29], [1489, 10, 30], [1489, 11, 29], [1489, 12, 30], [1490, 1, 29], [1490, 2, 30],
- [1490, 3, 29], [1490, 4, 30], [1490, 5, 30], [1490, 6, 29], [1490, 7, 30], [1490, 8, 30], [1490, 9, 29],
- [1490, 10, 29], [1490, 11, 30], [1490, 12, 29], [1491, 1, 30], [1491, 2, 29], [1491, 3, 29], [1491, 4, 30],
- [1491, 5, 30], [1491, 6, 29], [1491, 7, 30], [1491, 8, 30], [1491, 9, 29], [1491, 10, 30], [1491, 11, 29],
- [1491, 12, 30], [1492, 1, 29], [1492, 2, 30], [1492, 3, 29], [1492, 4, 29], [1492, 5, 30], [1492, 6, 30],
- [1492, 7, 29], [1492, 8, 30], [1492, 9, 29], [1492, 10, 30], [1492, 11, 30], [1492, 12, 29], [1493, 1, 30],
- [1493, 2, 29], [1493, 3, 30], [1493, 4, 29], [1493, 5, 30], [1493, 6, 29], [1493, 7, 29], [1493, 8, 30],
- [1493, 9, 29], [1493, 10, 30], [1493, 11, 30], [1493, 12, 30], [1494, 1, 29], [1494, 2, 30], [1494, 3, 29],
- [1494, 4, 30], [1494, 5, 29], [1494, 6, 30], [1494, 7, 29], [1494, 8, 29], [1494, 9, 29], [1494, 10, 30],
- [1494, 11, 30], [1494, 12, 30], [1495, 1, 29], [1495, 2, 30], [1495, 3, 30], [1495, 4, 29], [1495, 5, 30],
- [1495, 6, 29], [1495, 7, 29], [1495, 8, 30], [1495, 9, 29], [1495, 10, 29], [1495, 11, 30], [1495, 12, 30],
- [1496, 1, 29], [1496, 2, 30], [1496, 3, 30], [1496, 4, 30], [1496, 5, 29], [1496, 6, 30], [1496, 7, 29],
- [1496, 8, 29], [1496, 9, 30], [1496, 10, 29], [1496, 11, 29], [1496, 12, 30], [1497, 1, 30], [1497, 2, 29],
- [1497, 3, 30], [1497, 4, 30], [1497, 5, 29], [1497, 6, 30], [1497, 7, 29], [1497, 8, 30], [1497, 9, 29],
- [1497, 10, 30], [1497, 11, 29], [1497, 12, 30], [1498, 1, 29], [1498, 2, 30], [1498, 3, 29], [1498, 4, 30],
- [1498, 5, 29], [1498, 6, 30], [1498, 7, 30], [1498, 8, 29], [1498, 9, 30], [1498, 10, 29], [1498, 11, 30],
- [1498, 12, 29], [1499, 1, 30], [1499, 2, 29], [1499, 3, 30], [1499, 4, 29], [1499, 5, 29], [1499, 6, 30],
- [1499, 7, 30], [1499, 8, 29], [1499, 9, 30], [1499, 10, 29], [1499, 11, 30], [1499, 12, 30], [1500, 1, 29],
- [1500, 2, 30], [1500, 3, 29], [1500, 4, 30], [1500, 5, 29], [1500, 6, 29], [1500, 7, 30], [1500, 8, 29],
- [1500, 9, 30], [1500, 10, 29], [1500, 11, 30], [1500, 12, 30], [1501, 1, 30], [1501, 2, 29], [1501, 3, 30],
- [1501, 4, 29], [1501, 5, 30], [1501, 6, 29], [1501, 7, 29], [1501, 8, 29], [1501, 9, 30], [1501, 10, 29],
- [1501, 11, 30], [1501, 12, 30], [1502, 1, 30], [1502, 2, 30], [1502, 3, 29], [1502, 4, 30], [1502, 5, 29],
- [1502, 6, 30], [1502, 7, 29], [1502, 8, 29], [1502, 9, 29], [1502, 10, 30], [1502, 11, 30], [1502, 12, 29],
- [1503, 1, 30], [1503, 2, 30], [1503, 3, 29], [1503, 4, 30], [1503, 5, 30], [1503, 6, 29], [1503, 7, 30],
- [1503, 8, 29], [1503, 9, 29], [1503, 10, 29], [1503, 11, 30], [1503, 12, 30], [1504, 1, 29], [1504, 2, 30],
- [1504, 3, 29], [1504, 4, 30], [1504, 5, 30], [1504, 6, 30], [1504, 7, 29], [1504, 8, 29], [1504, 9, 30],
- [1504, 10, 29], [1504, 11, 30], [1504, 12, 29], [1505, 1, 30], [1505, 2, 29], [1505, 3, 30], [1505, 4, 29],
- [1505, 5, 30], [1505, 6, 30], [1505, 7, 29], [1505, 8, 30], [1505, 9, 29], [1505, 10, 30], [1505, 11, 30],
- [1505, 12, 29], [1506, 1, 29], [1506, 2, 30], [1506, 3, 29], [1506, 4, 29], [1506, 5, 30], [1506, 6, 30],
- [1506, 7, 29], [1506, 8, 30], [1506, 9, 30], [1506, 10, 29], [1506, 11, 30], [1506, 12, 30], [1507, 1, 29],
- [1507, 2, 29], [1507, 3, 30], [1507, 4, 29], [1507, 5, 29], [1507, 6, 30], [1507, 7, 30], [1507, 8, 29],
- [1507, 9, 30], [1507, 10, 29], [1507, 11, 30], [1507, 12, 30], [1508, 1, 30], [1508, 2, 29], [1508, 3, 29],
- [1508, 4, 30], [1508, 5, 29], [1508, 6, 30], [1508, 7, 29], [1508, 8, 29], [1508, 9, 30], [1508, 10, 29],
- [1508, 11, 30], [1508, 12, 30], [1509, 1, 30], [1509, 2, 29], [1509, 3, 30], [1509, 4, 29], [1509, 5, 30],
- [1509, 6, 29], [1509, 7, 30], [1509, 8, 29], [1509, 9, 29], [1509, 10, 30], [1509, 11, 29], [1509, 12, 30],
- [1510, 1, 30], [1510, 2, 29], [1510, 3, 30], [1510, 4, 30], [1510, 5, 29], [1510, 6, 30], [1510, 7, 29],
- [1510, 8, 30], [1510, 9, 29], [1510, 10, 29], [1510, 11, 30], [1510, 12, 29], [1511, 1, 30], [1511, 2, 29],
- [1511, 3, 30], [1511, 4, 30], [1511, 5, 29], [1511, 6, 30], [1511, 7, 30], [1511, 8, 29], [1511, 9, 30],
- [1511, 10, 29], [1511, 11, 29], [1511, 12, 30], [1512, 1, 29], [1512, 2, 30], [1512, 3, 29], [1512, 4, 30],
- [1512, 5, 29], [1512, 6, 30], [1512, 7, 30], [1512, 8, 30], [1512, 9, 29], [1512, 10, 30], [1512, 11, 29],
- [1512, 12, 30], [1513, 1, 29], [1513, 2, 29], [1513, 3, 29], [1513, 4, 30], [1513, 5, 29], [1513, 6, 30],
- [1513, 7, 30], [1513, 8, 30], [1513, 9, 29], [1513, 10, 30], [1513, 11, 30], [1513, 12, 29], [1514, 1, 30],
- [1514, 2, 29], [1514, 3, 29], [1514, 4, 29], [1514, 5, 30], [1514, 6, 29], [1514, 7, 30], [1514, 8, 30],
- [1514, 9, 29], [1514, 10, 30], [1514, 11, 30], [1514, 12, 30], [1515, 1, 29], [1515, 2, 29], [1515, 3, 30],
- [1515, 4, 29], [1515, 5, 29], [1515, 6, 30], [1515, 7, 29], [1515, 8, 30], [1515, 9, 30], [1515, 10, 29],
- [1515, 11, 30], [1515, 12, 30], [1516, 1, 29], [1516, 2, 30], [1516, 3, 29], [1516, 4, 30], [1516, 5, 29],
- [1516, 6, 29], [1516, 7, 30], [1516, 8, 29], [1516, 9, 30], [1516, 10, 29], [1516, 11, 30], [1516, 12, 30],
- [1517, 1, 29], [1517, 2, 30], [1517, 3, 29], [1517, 4, 30], [1517, 5, 29], [1517, 6, 30], [1517, 7, 30],
- [1517, 8, 29], [1517, 9, 29], [1517, 10, 30], [1517, 11, 29], [1517, 12, 30], [1518, 1, 29], [1518, 2, 30],
- [1518, 3, 29], [1518, 4, 30], [1518, 5, 30], [1518, 6, 29], [1518, 7, 30], [1518, 8, 30], [1518, 9, 29],
- [1518, 10, 30], [1518, 11, 29], [1518, 12, 29], [1519, 1, 30], [1519, 2, 29], [1519, 3, 29], [1519, 4, 30],
- [1519, 5, 30], [1519, 6, 30], [1519, 7, 29], [1519, 8, 30], [1519, 9, 30], [1519, 10, 29], [1519, 11, 30],
- [1519, 12, 29], [1520, 1, 29], [1520, 2, 30], [1520, 3, 29], [1520, 4, 29], [1520, 5, 30], [1520, 6, 30],
- [1520, 7, 30], [1520, 8, 29], [1520, 9, 30], [1520, 10, 30], [1520, 11, 29], [1520, 12, 30], [1521, 1, 29],
- [1521, 2, 29], [1521, 3, 29], [1521, 4, 30], [1521, 5, 29], [1521, 6, 30], [1521, 7, 30], [1521, 8, 29],
- [1521, 9, 30], [1521, 10, 30], [1521, 11, 29], [1521, 12, 30], [1522, 1, 30], [1522, 2, 29], [1522, 3, 29],
- [1522, 4, 29], [1522, 5, 30], [1522, 6, 29], [1522, 7, 30], [1522, 8, 30], [1522, 9, 29], [1522, 10, 30],
- [1522, 11, 30], [1522, 12, 29], [1523, 1, 30], [1523, 2, 29], [1523, 3, 30], [1523, 4, 29], [1523, 5, 30],
- [1523, 6, 29], [1523, 7, 30], [1523, 8, 29], [1523, 9, 29], [1523, 10, 30], [1523, 11, 30], [1523, 12, 29],
- [1524, 1, 30], [1524, 2, 30], [1524, 3, 29], [1524, 4, 30], [1524, 5, 29], [1524, 6, 30], [1524, 7, 29],
- [1524, 8, 30], [1524, 9, 29], [1524, 10, 29], [1524, 11, 30], [1524, 12, 29], [1525, 1, 30], [1525, 2, 30],
- [1525, 3, 29], [1525, 4, 30], [1525, 5, 30], [1525, 6, 29], [1525, 7, 30], [1525, 8, 29], [1525, 9, 30],
- [1525, 10, 29], [1525, 11, 29], [1525, 12, 30], [1526, 1, 29], [1526, 2, 30], [1526, 3, 29], [1526, 4, 30],
- [1526, 5, 30], [1526, 6, 30], [1526, 7, 29], [1526, 8, 30], [1526, 9, 29], [1526, 10, 30], [1526, 11, 29],
- [1526, 12, 29], [1527, 1, 30], [1527, 2, 29], [1527, 3, 30], [1527, 4, 29], [1527, 5, 30], [1527, 6, 30],
- [1527, 7, 29], [1527, 8, 30], [1527, 9, 30], [1527, 10, 29], [1527, 11, 30], [1527, 12, 29], [1528, 1, 30],
- [1528, 2, 29], [1528, 3, 29], [1528, 4, 30], [1528, 5, 29], [1528, 6, 30], [1528, 7, 29], [1528, 8, 30],
- [1528, 9, 30], [1528, 10, 29], [1528, 11, 30], [1528, 12, 30], [1529, 1, 29], [1529, 2, 30], [1529, 3, 29],
- [1529, 4, 29], [1529, 5, 30], [1529, 6, 29], [1529, 7, 30], [1529, 8, 29], [1529, 9, 30], [1529, 10, 29],
- [1529, 11, 30], [1529, 12, 30], [1530, 1, 29], [1530, 2, 30], [1530, 3, 30], [1530, 4, 29], [1530, 5, 29],
- [1530, 6, 30], [1530, 7, 29], [1530, 8, 30], [1530, 9, 29], [1530, 10, 29], [1530, 11, 30], [1530, 12, 30],
- [1531, 1, 29], [1531, 2, 30], [1531, 3, 30], [1531, 4, 30], [1531, 5, 29], [1531, 6, 29], [1531, 7, 30],
- [1531, 8, 29], [1531, 9, 30], [1531, 10, 29], [1531, 11, 29], [1531, 12, 30], [1532, 1, 29], [1532, 2, 30],
- [1532, 3, 30], [1532, 4, 30], [1532, 5, 29], [1532, 6, 30], [1532, 7, 30], [1532, 8, 29], [1532, 9, 29],
- [1532, 10, 29], [1532, 11, 30], [1532, 12, 29], [1533, 1, 30], [1533, 2, 29], [1533, 3, 30], [1533, 4, 30],
- [1533, 5, 30], [1533, 6, 29], [1533, 7, 30], [1533, 8, 29], [1533, 9, 30], [1533, 10, 29], [1533, 11, 29],
- [1533, 12, 30], [1534, 1, 29], [1534, 2, 30], [1534, 3, 29], [1534, 4, 30], [1534, 5, 30], [1534, 6, 29],
- [1534, 7, 30], [1534, 8, 30], [1534, 9, 29], [1534, 10, 29], [1534, 11, 30], [1534, 12, 29], [1535, 1, 30],
- [1535, 2, 29], [1535, 3, 30], [1535, 4, 29], [1535, 5, 30], [1535, 6, 29], [1535, 7, 30], [1535, 8, 30],
- [1535, 9, 29], [1535, 10, 30], [1535, 11, 29], [1535, 12, 30], [1536, 1, 29], [1536, 2, 30], [1536, 3, 29],
- [1536, 4, 30], [1536, 5, 29], [1536, 6, 30], [1536, 7, 29], [1536, 8, 30], [1536, 9, 29], [1536, 10, 30],
- [1536, 11, 29], [1536, 12, 30], [1537, 1, 30], [1537, 2, 29], [1537, 3, 30], [1537, 4, 30], [1537, 5, 29],
- [1537, 6, 29], [1537, 7, 30], [1537, 8, 29], [1537, 9, 29], [1537, 10, 30], [1537, 11, 29], [1537, 12, 30],
- [1538, 1, 30], [1538, 2, 30], [1538, 3, 29], [1538, 4, 30], [1538, 5, 30], [1538, 6, 29], [1538, 7, 29],
- [1538, 8, 30], [1538, 9, 29], [1538, 10, 29], [1538, 11, 30], [1538, 12, 29], [1539, 1, 30], [1539, 2, 30],
- [1539, 3, 30], [1539, 4, 29], [1539, 5, 30], [1539, 6, 30], [1539, 7, 29], [1539, 8, 29], [1539, 9, 30],
- [1539, 10, 29], [1539, 11, 29], [1539, 12, 30], [1540, 1, 29], [1540, 2, 30], [1540, 3, 30], [1540, 4, 29],
- [1540, 5, 30], [1540, 6, 30], [1540, 7, 29], [1540, 8, 30], [1540, 9, 29], [1540, 10, 29], [1540, 11, 30],
- [1540, 12, 29], [1541, 1, 30], [1541, 2, 29], [1541, 3, 30], [1541, 4, 29], [1541, 5, 30], [1541, 6, 30],
- [1541, 7, 30], [1541, 8, 29], [1541, 9, 30], [1541, 10, 29], [1541, 11, 29], [1541, 12, 30], [1542, 1, 29],
- [1542, 2, 30], [1542, 3, 29], [1542, 4, 30], [1542, 5, 29], [1542, 6, 30], [1542, 7, 30], [1542, 8, 29],
- [1542, 9, 30], [1542, 10, 29], [1542, 11, 30], [1542, 12, 30], [1543, 1, 29], [1543, 2, 30], [1543, 3, 29],
- [1543, 4, 29], [1543, 5, 30], [1543, 6, 29], [1543, 7, 30], [1543, 8, 29], [1543, 9, 30], [1543, 10, 29],
- [1543, 11, 30], [1543, 12, 30], [1544, 1, 30], [1544, 2, 29], [1544, 3, 30], [1544, 4, 29], [1544, 5, 29],
- [1544, 6, 30], [1544, 7, 29], [1544, 8, 30], [1544, 9, 29], [1544, 10, 30], [1544, 11, 29], [1544, 12, 30],
- [1545, 1, 30], [1545, 2, 30], [1545, 3, 29], [1545, 4, 30], [1545, 5, 29], [1545, 6, 29], [1545, 7, 30],
- [1545, 8, 29], [1545, 9, 30], [1545, 10, 29], [1545, 11, 29], [1545, 12, 30], [1546, 1, 30], [1546, 2, 30],
- [1546, 3, 29], [1546, 4, 30], [1546, 5, 29], [1546, 6, 30], [1546, 7, 29], [1546, 8, 30], [1546, 9, 29],
- [1546, 10, 30], [1546, 11, 29], [1546, 12, 29], [1547, 1, 30], [1547, 2, 30], [1547, 3, 29], [1547, 4, 30],
- [1547, 5, 30], [1547, 6, 29], [1547, 7, 30], [1547, 8, 29], [1547, 9, 30], [1547, 10, 29], [1547, 11, 30],
- [1547, 12, 29], [1548, 1, 30], [1548, 2, 29], [1548, 3, 29], [1548, 4, 30], [1548, 5, 30], [1548, 6, 29],
- [1548, 7, 30], [1548, 8, 30], [1548, 9, 29], [1548, 10, 30], [1548, 11, 29], [1548, 12, 30], [1549, 1, 29],
- [1549, 2, 30], [1549, 3, 29], [1549, 4, 29], [1549, 5, 30], [1549, 6, 29], [1549, 7, 30], [1549, 8, 30],
- [1549, 9, 30], [1549, 10, 29], [1549, 11, 30], [1549, 12, 29], [1550, 1, 30], [1550, 2, 29], [1550, 3, 30],
- [1550, 4, 29], [1550, 5, 29], [1550, 6, 29], [1550, 7, 30], [1550, 8, 30], [1550, 9, 30], [1550, 10, 29],
- [1550, 11, 30], [1550, 12, 30], [1551, 1, 29], [1551, 2, 30], [1551, 3, 29], [1551, 4, 29], [1551, 5, 30],
- [1551, 6, 29], [1551, 7, 29], [1551, 8, 30], [1551, 9, 30], [1551, 10, 29], [1551, 11, 30], [1551, 12, 30],
- [1552, 1, 30], [1552, 2, 29], [1552, 3, 30], [1552, 4, 29], [1552, 5, 29], [1552, 6, 30], [1552, 7, 29],
- [1552, 8, 29], [1552, 9, 30], [1552, 10, 30], [1552, 11, 29], [1552, 12, 30], [1553, 1, 30], [1553, 2, 29],
- [1553, 3, 30], [1553, 4, 29], [1553, 5, 30], [1553, 6, 29], [1553, 7, 30], [1553, 8, 29], [1553, 9, 30],
- [1553, 10, 29], [1553, 11, 30], [1553, 12, 29], [1554, 1, 30], [1554, 2, 29], [1554, 3, 30], [1554, 4, 29],
- [1554, 5, 30], [1554, 6, 30], [1554, 7, 29], [1554, 8, 30], [1554, 9, 29], [1554, 10, 30], [1554, 11, 29],
- [1554, 12, 30], [1555, 1, 29], [1555, 2, 29], [1555, 3, 30], [1555, 4, 29], [1555, 5, 30], [1555, 6, 30],
- [1555, 7, 29], [1555, 8, 30], [1555, 9, 30], [1555, 10, 29], [1555, 11, 30], [1555, 12, 29], [1556, 1, 30],
- [1556, 2, 29], [1556, 3, 29], [1556, 4, 30], [1556, 5, 29], [1556, 6, 30], [1556, 7, 29], [1556, 8, 30],
- [1556, 9, 30], [1556, 10, 30], [1556, 11, 29], [1556, 12, 30], [1557, 1, 29], [1557, 2, 30], [1557, 3, 29],
- [1557, 4, 29], [1557, 5, 29], [1557, 6, 30], [1557, 7, 29], [1557, 8, 30], [1557, 9, 30], [1557, 10, 30],
- [1557, 11, 30], [1557, 12, 29], [1558, 1, 30], [1558, 2, 29], [1558, 3, 30], [1558, 4, 29], [1558, 5, 29],
- [1558, 6, 29], [1558, 7, 30], [1558, 8, 29], [1558, 9, 30], [1558, 10, 30], [1558, 11, 30], [1558, 12, 29],
- [1559, 1, 30], [1559, 2, 30], [1559, 3, 29], [1559, 4, 29], [1559, 5, 30], [1559, 6, 29], [1559, 7, 29],
- [1559, 8, 30], [1559, 9, 30], [1559, 10, 29], [1559, 11, 30], [1559, 12, 29], [1560, 1, 30], [1560, 2, 30],
- [1560, 3, 29], [1560, 4, 30], [1560, 5, 29], [1560, 6, 30], [1560, 7, 29], [1560, 8, 30], [1560, 9, 29],
- [1560, 10, 30], [1560, 11, 29], [1560, 12, 30], [1561, 1, 29], [1561, 2, 30], [1561, 3, 30], [1561, 4, 29],
- [1561, 5, 30], [1561, 6, 29], [1561, 7, 30], [1561, 8, 30], [1561, 9, 29], [1561, 10, 29], [1561, 11, 30],
- [1561, 12, 29], [1562, 1, 29], [1562, 2, 30], [1562, 3, 30], [1562, 4, 29], [1562, 5, 30], [1562, 6, 29],
- [1562, 7, 30], [1562, 8, 30], [1562, 9, 30], [1562, 10, 29], [1562, 11, 29], [1562, 12, 30], [1563, 1, 29],
- [1563, 2, 30], [1563, 3, 29], [1563, 4, 29], [1563, 5, 30], [1563, 6, 29], [1563, 7, 30], [1563, 8, 30],
- [1563, 9, 30], [1563, 10, 29], [1563, 11, 30], [1563, 12, 29], [1564, 1, 30], [1564, 2, 29], [1564, 3, 30],
- [1564, 4, 29], [1564, 5, 29], [1564, 6, 30], [1564, 7, 29], [1564, 8, 30], [1564, 9, 30], [1564, 10, 30],
- [1564, 11, 29], [1564, 12, 30], [1565, 1, 29], [1565, 2, 30], [1565, 3, 29], [1565, 4, 30], [1565, 5, 29],
- [1565, 6, 29], [1565, 7, 30], [1565, 8, 29], [1565, 9, 30], [1565, 10, 30], [1565, 11, 29], [1565, 12, 30],
- [1566, 1, 30], [1566, 2, 29], [1566, 3, 30], [1566, 4, 29], [1566, 5, 30], [1566, 6, 29], [1566, 7, 29],
- [1566, 8, 30], [1566, 9, 29], [1566, 10, 30], [1566, 11, 29], [1566, 12, 30], [1567, 1, 30], [1567, 2, 29],
- [1567, 3, 30], [1567, 4, 30], [1567, 5, 29], [1567, 6, 30], [1567, 7, 29], [1567, 8, 30], [1567, 9, 29],
- [1567, 10, 29], [1567, 11, 30], [1567, 12, 29], [1568, 1, 30], [1568, 2, 29], [1568, 3, 30], [1568, 4, 30],
- [1568, 5, 30], [1568, 6, 29], [1568, 7, 30], [1568, 8, 29], [1568, 9, 30], [1568, 10, 29], [1568, 11, 29],
- [1568, 12, 29], [1569, 1, 30], [1569, 2, 29], [1569, 3, 30], [1569, 4, 30], [1569, 5, 30], [1569, 6, 29],
- [1569, 7, 30], [1569, 8, 30], [1569, 9, 29], [1569, 10, 30], [1569, 11, 29], [1569, 12, 29], [1570, 1, 29],
- [1570, 2, 30], [1570, 3, 29], [1570, 4, 30], [1570, 5, 30], [1570, 6, 29], [1570, 7, 30], [1570, 8, 30],
- [1570, 9, 30], [1570, 10, 29], [1570, 11, 29], [1570, 12, 30], [1571, 1, 29], [1571, 2, 29], [1571, 3, 30],
- [1571, 4, 29], [1571, 5, 30], [1571, 6, 30], [1571, 7, 29], [1571, 8, 30], [1571, 9, 30], [1571, 10, 29],
- [1571, 11, 30], [1571, 12, 29], [1572, 1, 30], [1572, 2, 29], [1572, 3, 29], [1572, 4, 30], [1572, 5, 29],
- [1572, 6, 30], [1572, 7, 29], [1572, 8, 30], [1572, 9, 30], [1572, 10, 29], [1572, 11, 30], [1572, 12, 29],
- [1573, 1, 30], [1573, 2, 29], [1573, 3, 30], [1573, 4, 30], [1573, 5, 29], [1573, 6, 30], [1573, 7, 29],
- [1573, 8, 29], [1573, 9, 30], [1573, 10, 29], [1573, 11, 30], [1573, 12, 29], [1574, 1, 30], [1574, 2, 30],
- [1574, 3, 29], [1574, 4, 30], [1574, 5, 30], [1574, 6, 29], [1574, 7, 30], [1574, 8, 29], [1574, 9, 29],
- [1574, 10, 30], [1574, 11, 29], [1574, 12, 29], [1575, 1, 30], [1575, 2, 30], [1575, 3, 30], [1575, 4, 29],
- [1575, 5, 30], [1575, 6, 30], [1575, 7, 29], [1575, 8, 30], [1575, 9, 29], [1575, 10, 29], [1575, 11, 29],
- [1575, 12, 30], [1576, 1, 29], [1576, 2, 30], [1576, 3, 30], [1576, 4, 29], [1576, 5, 30], [1576, 6, 30],
- [1576, 7, 30], [1576, 8, 29], [1576, 9, 30], [1576, 10, 29], [1576, 11, 29], [1576, 12, 29], [1577, 1, 30],
- [1577, 2, 29], [1577, 3, 30], [1577, 4, 30], [1577, 5, 29], [1577, 6, 30], [1577, 7, 30], [1577, 8, 29],
- [1577, 9, 30], [1577, 10, 29], [1577, 11, 30], [1577, 12, 29], [1578, 1, 29], [1578, 2, 30], [1578, 3, 29],
- [1578, 4, 30], [1578, 5, 29], [1578, 6, 30], [1578, 7, 30], [1578, 8, 29], [1578, 9, 30], [1578, 10, 30],
- [1578, 11, 29], [1578, 12, 30], [1579, 1, 29], [1579, 2, 30], [1579, 3, 29], [1579, 4, 30], [1579, 5, 29],
- [1579, 6, 29], [1579, 7, 30], [1579, 8, 30], [1579, 9, 29], [1579, 10, 30], [1579, 11, 29], [1579, 12, 30],
- [1580, 1, 29], [1580, 2, 30], [1580, 3, 30], [1580, 4, 29], [1580, 5, 30], [1580, 6, 29], [1580, 7, 29],
- [1580, 8, 30], [1580, 9, 29], [1580, 10, 30], [1580, 11, 29], [1580, 12, 30], [1581, 1, 30], [1581, 2, 30],
- [1581, 3, 29], [1581, 4, 30], [1581, 5, 29], [1581, 6, 30], [1581, 7, 29], [1581, 8, 29], [1581, 9, 30],
- [1581, 10, 29], [1581, 11, 30], [1581, 12, 29], [1582, 1, 30], [1582, 2, 30], [1582, 3, 29], [1582, 4, 30],
- [1582, 5, 30], [1582, 6, 29], [1582, 7, 30], [1582, 8, 29], [1582, 9, 30], [1582, 10, 29], [1582, 11, 29],
- [1582, 12, 29], [1583, 1, 30], [1583, 2, 30], [1583, 3, 29], [1583, 4, 30], [1583, 5, 30], [1583, 6, 30],
- [1583, 7, 29], [1583, 8, 30], [1583, 9, 29], [1583, 10, 30], [1583, 11, 29], [1583, 12, 29], [1584, 1, 29],
- [1584, 2, 30], [1584, 3, 30], [1584, 4, 29], [1584, 5, 30], [1584, 6, 30], [1584, 7, 29], [1584, 8, 30],
- [1584, 9, 30], [1584, 10, 29], [1584, 11, 30], [1584, 12, 29], [1585, 1, 29], [1585, 2, 30], [1585, 3, 29],
- [1585, 4, 30], [1585, 5, 29], [1585, 6, 30], [1585, 7, 29], [1585, 8, 30], [1585, 9, 30], [1585, 10, 29],
- [1585, 11, 30], [1585, 12, 30], [1586, 1, 29], [1586, 2, 29], [1586, 3, 30], [1586, 4, 29], [1586, 5, 30],
- [1586, 6, 29], [1586, 7, 29], [1586, 8, 30], [1586, 9, 30], [1586, 10, 30], [1586, 11, 29], [1586, 12, 30],
- [1587, 1, 29], [1587, 2, 30], [1587, 3, 30], [1587, 4, 29], [1587, 5, 29], [1587, 6, 29], [1587, 7, 30],
- [1587, 8, 29], [1587, 9, 30], [1587, 10, 29], [1587, 11, 30], [1587, 12, 30], [1588, 1, 30], [1588, 2, 29],
- [1588, 3, 30], [1588, 4, 30], [1588, 5, 29], [1588, 6, 29], [1588, 7, 29], [1588, 8, 30], [1588, 9, 29],
- [1588, 10, 30], [1588, 11, 29], [1588, 12, 30], [1589, 1, 30], [1589, 2, 29], [1589, 3, 30], [1589, 4, 30],
- [1589, 5, 29], [1589, 6, 30], [1589, 7, 29], [1589, 8, 29], [1589, 9, 30], [1589, 10, 29], [1589, 11, 30],
- [1589, 12, 29], [1590, 1, 30], [1590, 2, 29], [1590, 3, 30], [1590, 4, 30], [1590, 5, 30], [1590, 6, 29],
- [1590, 7, 29], [1590, 8, 30], [1590, 9, 29], [1590, 10, 30], [1590, 11, 29], [1590, 12, 30], [1591, 1, 29],
- [1591, 2, 30], [1591, 3, 29], [1591, 4, 30], [1591, 5, 30], [1591, 6, 29], [1591, 7, 30], [1591, 8, 29],
- [1591, 9, 30], [1591, 10, 29], [1591, 11, 30], [1591, 12, 29], [1592, 1, 30], [1592, 2, 29], [1592, 3, 30],
- [1592, 4, 29], [1592, 5, 30], [1592, 6, 29], [1592, 7, 30], [1592, 8, 29], [1592, 9, 30], [1592, 10, 30],
- [1592, 11, 30], [1592, 12, 29], [1593, 1, 30], [1593, 2, 29], [1593, 3, 29], [1593, 4, 30], [1593, 5, 29],
- [1593, 6, 29], [1593, 7, 30], [1593, 8, 29], [1593, 9, 30], [1593, 10, 30], [1593, 11, 30], [1593, 12, 29],
- [1594, 1, 30], [1594, 2, 30], [1594, 3, 29], [1594, 4, 29], [1594, 5, 30], [1594, 6, 29], [1594, 7, 29],
- [1594, 8, 29], [1594, 9, 30], [1594, 10, 30], [1594, 11, 30], [1594, 12, 30], [1595, 1, 29], [1595, 2, 30],
- [1595, 3, 29], [1595, 4, 30], [1595, 5, 29], [1595, 6, 29], [1595, 7, 30], [1595, 8, 29], [1595, 9, 29],
- [1595, 10, 30], [1595, 11, 30], [1595, 12, 30], [1596, 1, 29], [1596, 2, 30], [1596, 3, 30], [1596, 4, 29],
- [1596, 5, 30], [1596, 6, 29], [1596, 7, 29], [1596, 8, 30], [1596, 9, 29], [1596, 10, 30], [1596, 11, 29],
- [1596, 12, 30], [1597, 1, 29], [1597, 2, 30], [1597, 3, 30], [1597, 4, 29], [1597, 5, 30], [1597, 6, 29],
- [1597, 7, 30], [1597, 8, 29], [1597, 9, 30], [1597, 10, 29], [1597, 11, 30], [1597, 12, 29], [1598, 1, 30],
- [1598, 2, 29], [1598, 3, 30], [1598, 4, 29], [1598, 5, 30], [1598, 6, 30], [1598, 7, 29], [1598, 8, 30],
- [1598, 9, 29], [1598, 10, 30], [1598, 11, 30], [1598, 12, 29], [1599, 1, 29], [1599, 2, 30], [1599, 3, 29],
- [1599, 4, 30], [1599, 5, 29], [1599, 6, 30], [1599, 7, 29], [1599, 8, 30], [1599, 9, 30], [1599, 10, 30],
- [1599, 11, 29], [1599, 12, 30], [1600, 1, 29], [1600, 2, 29], [1600, 3, 30], [1600, 4, 29], [1600, 5, 30],
- [1600, 6, 29], [1600, 7, 29], [1600, 8, 30], [1600, 9, 30], [1600, 10, 30], [1600, 11, 29], [1600, 12, 30]
- ];
- const calendar = new NgbCalendarIslamicUmalqura();
- describe('toGregorian', () => {
- it('should convert correctly from Hijri to Gregorian', () => {
- DATE_TABLE.forEach(element => {
- const iDate = new NgbDate(element[3], element[4], element[5]);
- const gDate = new Date(element[0], element[1], element[2]);
- expect(calendar.toGregorian(iDate).getTime())
- .toEqual(gDate.getTime(), `Hijri ${iDate.year}-${iDate.month}-${iDate.day} should be Gregorian ${gDate}`);
- });
- });
- });
-
- describe('fromGregorian', () => {
- it('should convert correctly from Gregorian to Hijri', () => {
- DATE_TABLE.forEach(element => {
- const iDate = new NgbDate(element[3], element[4], element[5]);
- const gDate = new Date(element[0], element[1], element[2]);
- const iDate2 = calendar.fromGregorian(gDate);
- expect(iDate2.equals(iDate))
- .toBeTruthy(`Gregorian ${gDate} should be Hijri ${iDate.year}-${iDate.month}-${iDate.day}`);
- });
- });
-
- it('should convert correctly from Gregorian to Hijri with time 23:59:59.999', () => {
- DATE_TABLE.forEach(element => {
- const iDate = new NgbDate(element[3], element[4], element[5]);
- const gDate = new Date(element[0], element[1], element[2], 23, 59, 59, 999);
- const iDate2 = calendar.fromGregorian(gDate);
- expect(iDate2.equals(iDate))
- .toBeTruthy(`Gregorian ${gDate} should be Hijri ${iDate.year}-${iDate.month}-${iDate.day}`);
- });
- });
- });
-
- it('should return number of days per week', () => { expect(calendar.getDaysPerWeek()).toBe(7); });
-
- it('should return number of weeks per month', () => { expect(calendar.getWeeksPerMonth()).toBe(6); });
-
- it('should return months of a year', () => {
- expect(calendar.getMonths()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- describe('getDaysInIslamicMonth', () => {
- it('should return the correct number of days in islamic month', () => {
- MONTH_LENGTH.forEach(element => {
- expect(calendar.getDaysPerMonth(element[1], element[0]))
- .toEqual(element[2], `Hijri month ${element[1]}-${element[0]} should contain ${element[2]} days`);
- });
- });
- });
-
- it('should return day of week', () => {
- expect(calendar.getWeekday(new NgbDate(1438, 7, 6))).toEqual(1);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 7))).toEqual(2);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 8))).toEqual(3);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 9))).toEqual(4);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 10))).toEqual(5);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 11))).toEqual(6);
- expect(calendar.getWeekday(new NgbDate(1438, 7, 12))).toEqual(7);
- expect(calendar.getWeekday(new NgbDate(1420, 1, 12))).toEqual(3);
- expect(calendar.getWeekday(new NgbDate(1420, 2, 9))).toEqual(1);
- });
-
- it('should add days to date', () => {
- expect(calendar.getNext(new NgbDate(1431, 1, 29))).toEqual(new NgbDate(1431, 2, 1));
- expect(calendar.getNext(new NgbDate(1437, 2, 28))).toEqual(new NgbDate(1437, 2, 29));
- expect(calendar.getNext(new NgbDate(1437, 2, 29))).toEqual(new NgbDate(1437, 3, 1));
- });
-
- it('should subtract days from date', () => {
- expect(calendar.getPrev(new NgbDate(1431, 2, 1))).toEqual(new NgbDate(1431, 1, 29));
- expect(calendar.getPrev(new NgbDate(1431, 3, 1))).toEqual(new NgbDate(1431, 2, 30));
- expect(calendar.getPrev(new NgbDate(1437, 3, 5))).toEqual(new NgbDate(1437, 3, 4));
- });
-
- it('should add months to date', () => {
- expect(calendar.getNext(new NgbDate(1437, 8, 22), 'm')).toEqual(new NgbDate(1437, 9, 1));
- expect(calendar.getNext(new NgbDate(1437, 8, 1), 'm')).toEqual(new NgbDate(1437, 9, 1));
- expect(calendar.getNext(new NgbDate(1437, 12, 22), 'm')).toEqual(new NgbDate(1438, 1, 1));
- });
-
- it('should subtract months from date', () => {
- expect(calendar.getPrev(new NgbDate(1437, 8, 22), 'm')).toEqual(new NgbDate(1437, 7, 1));
- expect(calendar.getPrev(new NgbDate(1437, 9, 1), 'm')).toEqual(new NgbDate(1437, 8, 1));
- expect(calendar.getPrev(new NgbDate(1437, 1, 22), 'm')).toEqual(new NgbDate(1436, 12, 1));
- });
-
- it('should add years to date', () => {
- expect(calendar.getNext(new NgbDate(1437, 2, 22), 'y')).toEqual(new NgbDate(1438, 1, 1));
- expect(calendar.getNext(new NgbDate(1438, 12, 22), 'y')).toEqual(new NgbDate(1439, 1, 1));
- });
-
- it('should subtract years from date', () => {
- expect(calendar.getPrev(new NgbDate(1437, 12, 22), 'y')).toEqual(new NgbDate(1436, 1, 1));
- expect(calendar.getPrev(new NgbDate(1438, 2, 22), 'y')).toEqual(new NgbDate(1437, 1, 1));
- });
-
- it('should return week number', () => {
- let week = [
- new NgbDate(1437, 1, 4), new NgbDate(1437, 1, 5), new NgbDate(1437, 1, 6), new NgbDate(1437, 1, 7),
- new NgbDate(1437, 1, 8), new NgbDate(1437, 1, 9), new NgbDate(1437, 1, 10)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(2);
- week = [
- new NgbDate(1437, 12, 15), new NgbDate(1437, 12, 16), new NgbDate(1437, 12, 17), new NgbDate(1437, 12, 18),
- new NgbDate(1437, 12, 19), new NgbDate(1437, 12, 20), new NgbDate(1437, 12, 21)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(50);
- week = [
- new NgbDate(1437, 12, 22), new NgbDate(1437, 12, 23), new NgbDate(1437, 12, 24), new NgbDate(1437, 12, 25),
- new NgbDate(1437, 12, 26), new NgbDate(1437, 12, 27), new NgbDate(1437, 12, 28)
- ];
- expect(calendar.getWeekNumber(week, 7)).toEqual(51);
- });
-
- describe('setDay', () => {
- it('should return correct value of day', () => {
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 10).day).toEqual(11);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 0).day).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 30).day).toEqual(2);
- expect(calendar.getNext(new NgbDate(1437, 1, 1), 'd', 60).day).toEqual(2);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -1).day).toEqual(29);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -2).day).toEqual(28);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -3).day).toEqual(27);
- });
- });
-
- describe('setMonth', () => {
- it('should return correct value of month', () => {
- expect(calendar.getNext(new NgbDate(1202, 1, 1), 'm', 8).month).toEqual(9);
- expect(calendar.getNext(new NgbDate(1202, 1, 19), 'm', 7).month).toEqual(8);
- expect(calendar.getNext(new NgbDate(1431, 2, 30), 'm', -1).month).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -1).month).toEqual(12);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -2).month).toEqual(11);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', 11).month).toEqual(12);
- expect(calendar.getNext(new NgbDate(1420, 1, 1), 'm', 23).month).toEqual(12);
- expect(calendar.getNext(new NgbDate(1431, 1, 2), 'm', -25).month).toEqual(12);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', 12).month).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 29).month).toEqual(2);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', 30).month).toEqual(2);
- expect(calendar.getNext(new NgbDate(1437, 1, 1), 'd', 60).month).toEqual(3);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -2).month).toEqual(1);
- expect(calendar.getNext(new NgbDate(1431, 2, 1), 'd', -31).month).toEqual(12);
- });
- });
-
- describe('setYear', () => {
- it('should return correct value of yar', () => {
- expect(calendar.getNext(new NgbDate(1200, 8, 19), 'y', 2).year).toEqual(1202);
- expect(calendar.getNext(new NgbDate(1400, 11, 30), 'y', 31).year).toEqual(1431);
- expect(calendar.getNext(new NgbDate(1431, 12, 1), 'd', 32).year).toEqual(1432);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'd', -2).year).toEqual(1430);
- expect(calendar.getNext(new NgbDate(1431, 12, 1), 'm', 12).year).toEqual(1432);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', 24).year).toEqual(1433);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -2).year).toEqual(1430);
- expect(calendar.getNext(new NgbDate(1431, 1, 1), 'm', -14).year).toEqual(1429);
- });
- });
-});
diff --git a/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.ts b/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.ts
deleted file mode 100644
index 2eb7071..0000000
--- a/backup/src/datepicker/hijri/ngb-calendar-islamic-umalqura.ts
+++ /dev/null
@@ -1,222 +0,0 @@
-import {NgbCalendarIslamicCivil} from './ngb-calendar-islamic-civil';
-import {NgbDate} from '../ngb-date';
-import {Injectable} from '@angular/core';
-
-/**
- * Umalqura calendar is one type of Hijri calendars used in islamic countries.
- * This Calendar is used by Saudi Arabia for administrative purpose.
- * Unlike tabular calendars, the algorithm involves astronomical calculation, but it's still deterministic.
- * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
- */
-
-const GREGORIAN_FIRST_DATE = new Date(1882, 10, 12);
-const GREGORIAN_LAST_DATE = new Date(2174, 10, 25);
-const HIJRI_BEGIN = 1300;
-const HIJRI_END = 1600;
-const ONE_DAY = 1000 * 60 * 60 * 24;
-
-const MONTH_LENGTH = [
- // 1300-1304
- '101010101010', '110101010100', '111011001001', '011011010100', '011011101010',
- // 1305-1309
- '001101101100', '101010101101', '010101010101', '011010101001', '011110010010',
- // 1310-1314
- '101110101001', '010111010100', '101011011010', '010101011100', '110100101101',
- // 1315-1319
- '011010010101', '011101001010', '101101010100', '101101101010', '010110101101',
- // 1320-1324
- '010010101110', '101001001111', '010100010111', '011010001011', '011010100101',
- // 1325-1329
- '101011010101', '001011010110', '100101011011', '010010011101', '101001001101',
- // 1330-1334
- '110100100110', '110110010101', '010110101100', '100110110110', '001010111010',
- // 1335-1339
- '101001011011', '010100101011', '101010010101', '011011001010', '101011101001',
- // 1340-1344
- '001011110100', '100101110110', '001010110110', '100101010110', '101011001010',
- // 1345-1349
- '101110100100', '101111010010', '010111011001', '001011011100', '100101101101',
- // 1350-1354
- '010101001101', '101010100101', '101101010010', '101110100101', '010110110100',
- // 1355-1359
- '100110110110', '010101010111', '001010010111', '010101001011', '011010100011',
- // 1360-1364
- '011101010010', '101101100101', '010101101010', '101010101011', '010100101011',
- // 1365-1369
- '110010010101', '110101001010', '110110100101', '010111001010', '101011010110',
- // 1370-1374
- '100101010111', '010010101011', '100101001011', '101010100101', '101101010010',
- // 1375-1379
- '101101101010', '010101110101', '001001110110', '100010110111', '010001011011',
- // 1380-1384
- '010101010101', '010110101001', '010110110100', '100111011010', '010011011101',
- // 1385-1389
- '001001101110', '100100110110', '101010101010', '110101010100', '110110110010',
- // 1390-1394
- '010111010101', '001011011010', '100101011011', '010010101011', '101001010101',
- // 1395-1399
- '101101001001', '101101100100', '101101110001', '010110110100', '101010110101',
- // 1400-1404
- '101001010101', '110100100101', '111010010010', '111011001001', '011011010100',
- // 1405-1409
- '101011101001', '100101101011', '010010101011', '101010010011', '110101001001',
- // 1410-1414
- '110110100100', '110110110010', '101010111001', '010010111010', '101001011011',
- // 1415-1419
- '010100101011', '101010010101', '101100101010', '101101010101', '010101011100',
- // 1420-1424
- '010010111101', '001000111101', '100100011101', '101010010101', '101101001010',
- // 1425-1429
- '101101011010', '010101101101', '001010110110', '100100111011', '010010011011',
- // 1430-1434
- '011001010101', '011010101001', '011101010100', '101101101010', '010101101100',
- // 1435-1439
- '101010101101', '010101010101', '101100101001', '101110010010', '101110101001',
- // 1440-1444
- '010111010100', '101011011010', '010101011010', '101010101011', '010110010101',
- // 1445-1449
- '011101001001', '011101100100', '101110101010', '010110110101', '001010110110',
- // 1450-1454
- '101001010110', '111001001101', '101100100101', '101101010010', '101101101010',
- // 1455-1459
- '010110101101', '001010101110', '100100101111', '010010010111', '011001001011',
- // 1460-1464
- '011010100101', '011010101100', '101011010110', '010101011101', '010010011101',
- // 1465-1469
- '101001001101', '110100010110', '110110010101', '010110101010', '010110110101',
- // 1470-1474
- '001011011010', '100101011011', '010010101101', '010110010101', '011011001010',
- // 1475-1479
- '011011100100', '101011101010', '010011110101', '001010110110', '100101010110',
- // 1480-1484
- '101010101010', '101101010100', '101111010010', '010111011001', '001011101010',
- // 1485-1489
- '100101101101', '010010101101', '101010010101', '101101001010', '101110100101',
- // 1490-1494
- '010110110010', '100110110101', '010011010110', '101010010111', '010101000111',
- // 1495-1499
- '011010010011', '011101001001', '101101010101', '010101101010', '101001101011',
- // 1500-1504
- '010100101011', '101010001011', '110101000110', '110110100011', '010111001010',
- // 1505-1509
- '101011010110', '010011011011', '001001101011', '100101001011', '101010100101',
- // 1510-1514
- '101101010010', '101101101001', '010101110101', '000101110110', '100010110111',
- // 1515-1519
- '001001011011', '010100101011', '010101100101', '010110110100', '100111011010',
- // 1520-1524
- '010011101101', '000101101101', '100010110110', '101010100110', '110101010010',
- // 1525-1529
- '110110101001', '010111010100', '101011011010', '100101011011', '010010101011',
- // 1530-1534
- '011001010011', '011100101001', '011101100010', '101110101001', '010110110010',
- // 1535-1539
- '101010110101', '010101010101', '101100100101', '110110010010', '111011001001',
- // 1540-1544
- '011011010010', '101011101001', '010101101011', '010010101011', '101001010101',
- // 1545-1549
- '110100101001', '110101010100', '110110101010', '100110110101', '010010111010',
- // 1550-1554
- '101000111011', '010010011011', '101001001101', '101010101010', '101011010101',
- // 1555-1559
- '001011011010', '100101011101', '010001011110', '101000101110', '110010011010',
- // 1560-1564
- '110101010101', '011010110010', '011010111001', '010010111010', '101001011101',
- // 1565-1569
- '010100101101', '101010010101', '101101010010', '101110101000', '101110110100',
- // 1570-1574
- '010110111001', '001011011010', '100101011010', '101101001010', '110110100100',
- // 1575-1579
- '111011010001', '011011101000', '101101101010', '010101101101', '010100110101',
- // 1580-1584
- '011010010101', '110101001010', '110110101000', '110111010100', '011011011010',
- // 1585-1589
- '010101011011', '001010011101', '011000101011', '101100010101', '101101001010',
- // 1590-1594
- '101110010101', '010110101010', '101010101110', '100100101110', '110010001111',
- // 1595-1599
- '010100100111', '011010010101', '011010101010', '101011010110', '010101011101',
- // 1600
- '001010011101'
-];
-
-function getDaysDiff(date1: Date, date2: Date): number {
- // Ignores the time part in date1 and date2:
- const time1 = Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate());
- const time2 = Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate());
- const diff = Math.abs(time1 - time2);
- return Math.round(diff / ONE_DAY);
-}
-
-@Injectable()
-export class NgbCalendarIslamicUmalqura extends NgbCalendarIslamicCivil {
- /**
- * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
- * `gdate` is s JS Date to be converted to Hijri.
- */
- fromGregorian(gDate: Date): NgbDate {
- let hDay = 1, hMonth = 0, hYear = 1300;
- let daysDiff = getDaysDiff(gDate, GREGORIAN_FIRST_DATE);
- if (gDate.getTime() - GREGORIAN_FIRST_DATE.getTime() >= 0 && gDate.getTime() - GREGORIAN_LAST_DATE.getTime() <= 0) {
- let year = 1300;
- for (let i = 0; i < MONTH_LENGTH.length; i++, year++) {
- for (let j = 0; j < 12; j++) {
- let numOfDays = +MONTH_LENGTH[i][j] + 29;
- if (daysDiff <= numOfDays) {
- hDay = daysDiff + 1;
- if (hDay > numOfDays) {
- hDay = 1;
- j++;
- }
- if (j > 11) {
- j = 0;
- year++;
- }
- hMonth = j;
- hYear = year;
- return new NgbDate(hYear, hMonth + 1, hDay);
- }
- daysDiff = daysDiff - numOfDays;
- }
- }
- } else {
- return super.fromGregorian(gDate);
- }
- }
- /**
- * Converts the current Hijri date to Gregorian.
- */
- toGregorian(hDate: NgbDate): Date {
- const hYear = hDate.year;
- const hMonth = hDate.month - 1;
- const hDay = hDate.day;
- let gDate = new Date(GREGORIAN_FIRST_DATE);
- let dayDiff = hDay - 1;
- if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
- for (let y = 0; y < hYear - HIJRI_BEGIN; y++) {
- for (let m = 0; m < 12; m++) {
- dayDiff += +MONTH_LENGTH[y][m] + 29;
- }
- }
- for (let m = 0; m < hMonth; m++) {
- dayDiff += +MONTH_LENGTH[hYear - HIJRI_BEGIN][m] + 29;
- }
- gDate.setDate(GREGORIAN_FIRST_DATE.getDate() + dayDiff);
- } else {
- gDate = super.toGregorian(hDate);
- }
- return gDate;
- }
- /**
- * Returns the number of days in a specific Hijri hMonth.
- * `hMonth` is 1 for Muharram, 2 for Safar, etc.
- * `hYear` is any Hijri hYear.
- */
- getDaysPerMonth(hMonth: number, hYear: number): number {
- if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
- const pos = hYear - HIJRI_BEGIN;
- return +MONTH_LENGTH[pos][hMonth - 1] + 29;
- }
- return super.getDaysPerMonth(hMonth, hYear);
- }
-}
diff --git a/backup/src/datepicker/jalali/jalali.ts b/backup/src/datepicker/jalali/jalali.ts
deleted file mode 100644
index d4d5315..0000000
--- a/backup/src/datepicker/jalali/jalali.ts
+++ /dev/null
@@ -1,227 +0,0 @@
-import {NgbDate} from '../ngb-date';
-
-/**
- * Returns the equivalent JS date value for a give input Jalali date.
- * `jalaliDate` is an Jalali date to be converted to Gregorian.
- */
-export function toGregorian(jalaliDate: NgbDate): Date {
- let jdn = jalaliToJulian(jalaliDate.year, jalaliDate.month, jalaliDate.day);
- let date = julianToGregorian(jdn);
- date.setHours(6, 30, 3, 200);
- return date;
-}
-
-/**
- * Returns the equivalent jalali date value for a give input Gregorian date.
- * `gdate` is a JS Date to be converted to jalali.
- * utc to local
- */
-export function fromGregorian(gdate: Date): NgbDate {
- let g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());
- return julianToJalali(g2d);
-}
-
-export function setJalaliYear(date: NgbDate, yearValue: number): NgbDate {
- date.year = +yearValue;
- return date;
-}
-
-export function setJalaliMonth(date: NgbDate, month: number): NgbDate {
- month = +month;
- date.year = date.year + Math.floor((month - 1) / 12);
- date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
- return date;
-}
-
-export function setJalaliDay(date: NgbDate, day: number): NgbDate {
- let mDays = getDaysPerMonth(date.month, date.year);
- if (day <= 0) {
- while (day <= 0) {
- date = setJalaliMonth(date, date.month - 1);
- mDays = getDaysPerMonth(date.month, date.year);
- day += mDays;
- }
- } else if (day > mDays) {
- while (day > mDays) {
- day -= mDays;
- date = setJalaliMonth(date, date.month + 1);
- mDays = getDaysPerMonth(date.month, date.year);
- }
- }
- date.day = day;
- return date;
-}
-
-function mod(a: number, b: number): number {
- return a - b * Math.floor(a / b);
-}
-
-function div(a: number, b: number) {
- return Math.trunc(a / b);
-}
-
-/*
- This function determines if the Jalali (Persian) year is
- leap (366-day long) or is the common year (365 days), and
- finds the day in March (Gregorian calendar) of the first
- day of the Jalali year (jalaliYear).
- @param jalaliYear Jalali calendar year (-61 to 3177)
- @return
- leap: number of years since the last leap year (0 to 4)
- gYear: Gregorian year of the beginning of Jalali year
- march: the March day of Farvardin the 1st (1st day of jalaliYear)
- @see: http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm
- @see: http://www.fourmilab.ch/documents/calendar/
- */
-function jalCal(jalaliYear: number) {
- // Jalali years starting the 33-year rule.
- let breaks =
- [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];
- const breaksLength = breaks.length;
- const gYear = jalaliYear + 621;
- let leapJ = -14;
- let jp = breaks[0];
-
- if (jalaliYear < jp || jalaliYear >= breaks[breaksLength - 1]) {
- throw new Error('Invalid Jalali year ' + jalaliYear);
- }
-
- // Find the limiting years for the Jalali year jalaliYear.
- let jump;
- for (let i = 1; i < breaksLength; i += 1) {
- const jm = breaks[i];
- jump = jm - jp;
- if (jalaliYear < jm) {
- break;
- }
- leapJ = leapJ + div(jump, 33) * 8 + div(mod(jump, 33), 4);
- jp = jm;
- }
- let n = jalaliYear - jp;
-
- // Find the number of leap years from AD 621 to the beginning
- // of the current Jalali year in the Persian calendar.
- leapJ = leapJ + div(n, 33) * 8 + div(mod(n, 33) + 3, 4);
- if (mod(jump, 33) === 4 && jump - n === 4) {
- leapJ += 1;
- }
-
- // And the same in the Gregorian calendar (until the year gYear).
- const leapG = div(gYear, 4) - div((div(gYear, 100) + 1) * 3, 4) - 150;
-
- // Determine the Gregorian date of Farvardin the 1st.
- const march = 20 + leapJ - leapG;
-
- // Find how many years have passed since the last leap year.
- if (jump - n < 6) {
- n = n - jump + div(jump + 4, 33) * 33;
- }
- let leap = mod(mod(n + 1, 33) - 1, 4);
- if (leap === -1) {
- leap = 4;
- }
-
- return {leap: leap, gy: gYear, march: march};
-}
-
-/*
- Calculates Gregorian and Julian calendar dates from the Julian Day number
- (jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both
- calendars) to some millions years ahead of the present.
- @param jdn Julian Day number
- @return
- gYear: Calendar year (years BC numbered 0, -1, -2, ...)
- gMonth: Calendar month (1 to 12)
- gDay: Calendar day of the month M (1 to 28/29/30/31)
- */
-function julianToGregorian(julianDayNumber: number) {
- let j = 4 * julianDayNumber + 139361631;
- j = j + div(div(4 * julianDayNumber + 183187720, 146097) * 3, 4) * 4 - 3908;
- const i = div(mod(j, 1461), 4) * 5 + 308;
- const gDay = div(mod(i, 153), 5) + 1;
- const gMonth = mod(div(i, 153), 12) + 1;
- const gYear = div(j, 1461) - 100100 + div(8 - gMonth, 6);
-
- return new Date(gYear, gMonth - 1, gDay);
-}
-
-/*
- Converts a date of the Jalali calendar to the Julian Day number.
- @param jy Jalali year (1 to 3100)
- @param jm Jalali month (1 to 12)
- @param jd Jalali day (1 to 29/31)
- @return Julian Day number
- */
-function gregorianToJulian(gy: number, gm: number, gd: number) {
- let d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod(gm + 9, 12) + 2, 5) + gd - 34840408;
- d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;
- return d;
-}
-
-/*
- Converts the Julian Day number to a date in the Jalali calendar.
- @param julianDayNumber Julian Day number
- @return
- jalaliYear: Jalali year (1 to 3100)
- jalaliMonth: Jalali month (1 to 12)
- jalaliDay: Jalali day (1 to 29/31)
- */
-function julianToJalali(julianDayNumber: number) {
- let gy = julianToGregorian(julianDayNumber).getFullYear() // Calculate Gregorian year (gy).
- ,
- jalaliYear = gy - 621, r = jalCal(jalaliYear), gregorianDay = gregorianToJulian(gy, 3, r.march), jalaliDay,
- jalaliMonth, numberOfDays;
-
- // Find number of days that passed since 1 Farvardin.
- numberOfDays = julianDayNumber - gregorianDay;
- if (numberOfDays >= 0) {
- if (numberOfDays <= 185) {
- // The first 6 months.
- jalaliMonth = 1 + div(numberOfDays, 31);
- jalaliDay = mod(numberOfDays, 31) + 1;
- return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
- } else {
- // The remaining months.
- numberOfDays -= 186;
- }
- } else {
- // Previous Jalali year.
- jalaliYear -= 1;
- numberOfDays += 179;
- if (r.leap === 1) {
- numberOfDays += 1;
- }
- }
- jalaliMonth = 7 + div(numberOfDays, 30);
- jalaliDay = mod(numberOfDays, 30) + 1;
-
- return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
-}
-
-/*
- Converts a date of the Jalali calendar to the Julian Day number.
- @param jYear Jalali year (1 to 3100)
- @param jMonth Jalali month (1 to 12)
- @param jDay Jalali day (1 to 29/31)
- @return Julian Day number
- */
-function jalaliToJulian(jYear: number, jMonth: number, jDay: number) {
- let r = jalCal(jYear);
- return gregorianToJulian(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;
-}
-
-/**
- * Returns the number of days in a specific jalali month.
- */
-function getDaysPerMonth(month: number, year: number): number {
- if (month <= 6) {
- return 31;
- }
- if (month <= 11) {
- return 30;
- }
- if (jalCal(year).leap === 0) {
- return 30;
- }
- return 29;
-}
diff --git a/backup/src/datepicker/jalali/ngb-calendar-persian.ts b/backup/src/datepicker/jalali/ngb-calendar-persian.ts
deleted file mode 100644
index 939a2b4..0000000
--- a/backup/src/datepicker/jalali/ngb-calendar-persian.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-import {Injectable} from '@angular/core';
-import {NgbDate} from '../ngb-date';
-import {NgbCalendar, NgbPeriod} from '../ngb-calendar';
-import {isInteger} from '../../util/util';
-
-import {fromGregorian, setJalaliDay, setJalaliMonth, setJalaliYear, toGregorian} from './jalali';
-
-@Injectable()
-export class NgbCalendarPersian extends NgbCalendar {
- getDaysPerWeek() { return 7; }
-
- getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }
-
- getWeeksPerMonth() { return 6; }
-
- getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {
- date = new NgbDate(date.year, date.month, date.day);
-
- switch (period) {
- case 'y':
- date = setJalaliYear(date, date.year + number);
- date.month = 1;
- date.day = 1;
- return date;
- case 'm':
- date = setJalaliMonth(date, date.month + number);
- date.day = 1;
- return date;
- case 'd':
- return setJalaliDay(date, date.day + number);
- default:
- return date;
- }
- }
-
- getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }
-
- getWeekday(date: NgbDate) {
- const day = toGregorian(date).getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- }
-
- getWeekNumber(week: NgbDate[], firstDayOfWeek: number) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
-
- const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- const date = week[thursdayIndex];
-
- const jsDate = toGregorian(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- const time = jsDate.getTime();
- const startDate = toGregorian(new NgbDate(date.year, 1, 1));
- return Math.floor(Math.round((time - startDate.getTime()) / 86400000) / 7) + 1;
- }
-
- getToday(): NgbDate { return fromGregorian(new Date()); }
-
- isValid(date: NgbDate): boolean {
- return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) &&
- !isNaN(toGregorian(date).getTime());
- }
-}
diff --git a/backup/src/datepicker/ngb-calendar.spec.ts b/backup/src/datepicker/ngb-calendar.spec.ts
deleted file mode 100644
index 781decf..0000000
--- a/backup/src/datepicker/ngb-calendar.spec.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import {NgbCalendarGregorian} from './ngb-calendar';
-import {NgbDate} from './ngb-date';
-
-describe('ngb-calendar-gregorian', () => {
-
- const calendar = new NgbCalendarGregorian();
-
- it('should return today\'s date', () => {
- const jsToday = new Date();
- const today = new NgbDate(jsToday.getFullYear(), jsToday.getMonth() + 1, jsToday.getDate());
-
- expect(calendar.getToday()).toEqual(today);
- });
-
- it('should return number of days per week', () => { expect(calendar.getDaysPerWeek()).toBe(7); });
-
- it('should return number of weeks per month', () => { expect(calendar.getWeeksPerMonth()).toBe(6); });
-
- it('should return months of a year', () => {
- expect(calendar.getMonths()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);
- });
-
- it('should return day of week', () => {
- expect(calendar.getWeekday(new NgbDate(2017, 1, 2))).toBe(1); // Mon, 2 Jan 2017
- expect(calendar.getWeekday(new NgbDate(2017, 1, 3))).toBe(2);
- expect(calendar.getWeekday(new NgbDate(2017, 1, 4))).toBe(3);
- expect(calendar.getWeekday(new NgbDate(2017, 1, 5))).toBe(4);
- expect(calendar.getWeekday(new NgbDate(2017, 1, 6))).toBe(5);
- expect(calendar.getWeekday(new NgbDate(2017, 1, 7))).toBe(6);
- expect(calendar.getWeekday(new NgbDate(2017, 1, 8))).toBe(7); // Sun, 8 Jan 2017
- });
-
- it('should add days to date', () => {
- expect(calendar.getNext(new NgbDate(2016, 12, 31))).toEqual(new NgbDate(2017, 1, 1));
- expect(calendar.getNext(new NgbDate(2016, 2, 28))).toEqual(new NgbDate(2016, 2, 29));
- expect(calendar.getNext(new NgbDate(2017, 2, 28))).toEqual(new NgbDate(2017, 3, 1));
- });
-
- it('should subtract days from date', () => {
- expect(calendar.getPrev(new NgbDate(2017, 1, 1))).toEqual(new NgbDate(2016, 12, 31));
- expect(calendar.getPrev(new NgbDate(2016, 2, 29))).toEqual(new NgbDate(2016, 2, 28));
- expect(calendar.getPrev(new NgbDate(2017, 3, 1))).toEqual(new NgbDate(2017, 2, 28));
- });
-
- it('should add months to date', () => {
- expect(calendar.getNext(new NgbDate(2016, 7, 22), 'm')).toEqual(new NgbDate(2016, 8, 1));
- expect(calendar.getNext(new NgbDate(2016, 7, 1), 'm')).toEqual(new NgbDate(2016, 8, 1));
- expect(calendar.getNext(new NgbDate(2016, 12, 22), 'm')).toEqual(new NgbDate(2017, 1, 1));
- });
-
- it('should subtract months from date', () => {
- expect(calendar.getPrev(new NgbDate(2016, 7, 22), 'm')).toEqual(new NgbDate(2016, 6, 1));
- expect(calendar.getPrev(new NgbDate(2016, 8, 1), 'm')).toEqual(new NgbDate(2016, 7, 1));
- expect(calendar.getPrev(new NgbDate(2017, 1, 22), 'm')).toEqual(new NgbDate(2016, 12, 1));
- });
-
- it('should add years to date', () => {
- expect(calendar.getNext(new NgbDate(2016, 1, 22), 'y')).toEqual(new NgbDate(2017, 1, 1));
- expect(calendar.getNext(new NgbDate(2017, 12, 22), 'y')).toEqual(new NgbDate(2018, 1, 1));
- });
-
- it('should subtract years from date', () => {
- expect(calendar.getPrev(new NgbDate(2016, 12, 22), 'y')).toEqual(new NgbDate(2015, 1, 1));
- expect(calendar.getPrev(new NgbDate(2017, 1, 22), 'y')).toEqual(new NgbDate(2016, 1, 1));
- });
-
- it('should properly recognize invalid javascript date', () => {
- expect(calendar.isValid(null)).toBeFalsy();
- expect(calendar.isValid(undefined)).toBeFalsy();
- expect(calendar.isValid(NaN)).toBeFalsy();
- expect(calendar.isValid(new Date())).toBeFalsy();
- expect(calendar.isValid(new NgbDate(null, null, null))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(undefined, undefined, undefined))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(NaN, NaN, NaN))).toBeFalsy();
- expect(calendar.isValid(new NgbDate('2017', '03', '10'))).toBeFalsy();
- });
-
- it('should recognize dates outside of JS range as invalid', () => {
- expect(calendar.isValid(new NgbDate(275760, 9, 14))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(-271821, 4, 19))).toBeFalsy();
- });
-
- it('should recognize dates outside of calendar range as invalid', () => {
- expect(calendar.isValid(new NgbDate(0, 0, 0))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(-1, -1, -1))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(2016, 17, 1))).toBeFalsy();
- expect(calendar.isValid(new NgbDate(2017, 5, 35))).toBeFalsy();
- });
-
- it('should mark valid JS dates as valid', () => {
- expect(calendar.isValid(new NgbDate(275760, 9, 12))).toBeTruthy();
- expect(calendar.isValid(new NgbDate(2016, 8, 8))).toBeTruthy();
- });
-
- it('should dates with year 0 as invalid', () => { expect(calendar.isValid(new NgbDate(0, 1, 1))).toBeFalsy(); });
-
-});
diff --git a/backup/src/datepicker/ngb-calendar.ts b/backup/src/datepicker/ngb-calendar.ts
deleted file mode 100644
index f42a1de..0000000
--- a/backup/src/datepicker/ngb-calendar.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-import {NgbDate} from './ngb-date';
-import {Injectable} from '@angular/core';
-import {isInteger} from '../util/util';
-
-export function fromJSDate(jsDate: Date) {
- return new NgbDate(jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());
-}
-export function toJSDate(date: NgbDate) {
- const jsDate = new Date(date.year, date.month - 1, date.day, 12);
- // this is done avoid 30 -> 1930 conversion
- if (!isNaN(jsDate.getTime())) {
- jsDate.setFullYear(date.year);
- }
- return jsDate;
-}
-
-export type NgbPeriod = 'y' | 'm' | 'd';
-
-export function NGB_DATEPICKER_CALENDAR_FACTORY() {
- return new NgbCalendarGregorian();
-}
-
-/**
- * A service that represents the calendar used by the datepicker.
- *
- * The default implementation uses the Gregorian calendar. You can inject it in your own
- * implementations if necessary to simplify `NgbDate` calculations.
- */
-@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_CALENDAR_FACTORY})
-export abstract class NgbCalendar {
- /**
- * Returns the number of days per week.
- */
- abstract getDaysPerWeek(): number;
-
- /**
- * Returns an array of months per year.
- *
- * With default calendar we use ISO 8601 and return [1, 2, ..., 12];
- */
- abstract getMonths(year?: number): number[];
-
- /**
- * Returns the number of weeks per month.
- */
- abstract getWeeksPerMonth(): number;
-
- /**
- * Returns the weekday number for a given day.
- *
- * With the default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun
- */
- abstract getWeekday(date: NgbDate): number;
-
- /**
- * Adds a number of years, months or days to a given date.
- *
- * * `period` can be `y`, `m` or `d` and defaults to day.
- * * `number` defaults to 1.
- *
- * Always returns a new date.
- */
- abstract getNext(date: NgbDate, period?: NgbPeriod, number?: number): NgbDate;
-
- /**
- * Subtracts a number of years, months or days from a given date.
- *
- * * `period` can be `y`, `m` or `d` and defaults to day.
- * * `number` defaults to 1.
- *
- * Always returns a new date.
- */
- abstract getPrev(date: NgbDate, period?: NgbPeriod, number?: number): NgbDate;
-
- /**
- * Returns the week number for a given week.
- */
- abstract getWeekNumber(week: NgbDate[], firstDayOfWeek: number): number;
-
- /**
- * Returns the today's date.
- */
- abstract getToday(): NgbDate;
-
- /**
- * Checks if a date is valid in the current calendar.
- */
- abstract isValid(date: NgbDate): boolean;
-}
-
-@Injectable()
-export class NgbCalendarGregorian extends NgbCalendar {
- getDaysPerWeek() { return 7; }
-
- getMonths() { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; }
-
- getWeeksPerMonth() { return 6; }
-
- getNext(date: NgbDate, period: NgbPeriod = 'd', number = 1) {
- let jsDate = toJSDate(date);
-
- switch (period) {
- case 'y':
- return new NgbDate(date.year + number, 1, 1);
- case 'm':
- jsDate = new Date(date.year, date.month + number - 1, 1, 12);
- break;
- case 'd':
- jsDate.setDate(jsDate.getDate() + number);
- break;
- default:
- return date;
- }
-
- return fromJSDate(jsDate);
- }
-
- getPrev(date: NgbDate, period: NgbPeriod = 'd', number = 1) { return this.getNext(date, period, -number); }
-
- getWeekday(date: NgbDate) {
- let jsDate = toJSDate(date);
- let day = jsDate.getDay();
- // in JS Date Sun=0, in ISO 8601 Sun=7
- return day === 0 ? 7 : day;
- }
-
- getWeekNumber(week: NgbDate[], firstDayOfWeek: number) {
- // in JS Date Sun=0, in ISO 8601 Sun=7
- if (firstDayOfWeek === 7) {
- firstDayOfWeek = 0;
- }
-
- const thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
- let date = week[thursdayIndex];
-
- const jsDate = toJSDate(date);
- jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
- const time = jsDate.getTime();
- jsDate.setMonth(0); // Compare with Jan 1
- jsDate.setDate(1);
- return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;
- }
-
- getToday(): NgbDate { return fromJSDate(new Date()); }
-
- isValid(date: NgbDate): boolean {
- if (!date || !isInteger(date.year) || !isInteger(date.month) || !isInteger(date.day)) {
- return false;
- }
-
- // year 0 doesn't exist in Gregorian calendar
- if (date.year === 0) {
- return false;
- }
-
- const jsDate = toJSDate(date);
-
- return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&
- jsDate.getDate() === date.day;
- }
-}
diff --git a/backup/src/datepicker/ngb-date-parser-formatter.spec.ts b/backup/src/datepicker/ngb-date-parser-formatter.spec.ts
deleted file mode 100644
index c4f1114..0000000
--- a/backup/src/datepicker/ngb-date-parser-formatter.spec.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import {NgbDateISOParserFormatter} from './ngb-date-parser-formatter';
-
-describe('ngb-date parsing and formatting', () => {
- let pf: NgbDateISOParserFormatter;
-
- beforeEach(() => { pf = new NgbDateISOParserFormatter(); });
-
- describe('parsing', () => {
-
- it('should parse null undefined and empty string as null', () => {
- expect(pf.parse(null)).toBeNull();
- expect(pf.parse(undefined)).toBeNull();
- expect(pf.parse('')).toBeNull();
- expect(pf.parse(' ')).toBeNull();
- });
-
- it('should parse valid date', () => { expect(pf.parse('2016-05-12')).toEqual({year: 2016, month: 5, day: 12}); });
-
- it('should parse non-date as null', () => {
- expect(pf.parse('foo-bar-baz')).toBeNull();
- expect(pf.parse('2014-bar')).toBeNull();
- expect(pf.parse('2014-11-12-15')).toBeNull();
- });
-
- it('should do its best parsing incomplete dates',
- () => { expect(pf.parse('2011-5')).toEqual({year: 2011, month: 5, day: null}); });
- });
-
- describe('formatting', () => {
-
- it('should format null and undefined as an empty string', () => {
- expect(pf.format(null)).toBe('');
- expect(pf.format(undefined)).toBe('');
- });
-
- it('should format a valid date', () => { expect(pf.format({year: 2016, month: 10, day: 15})).toBe('2016-10-15'); });
-
- it('should format a valid date with padding',
- () => { expect(pf.format({year: 2016, month: 10, day: 5})).toBe('2016-10-05'); });
-
- it('should try its best with invalid dates', () => {
- expect(pf.format({year: 2016, month: NaN, day: undefined})).toBe('2016--');
- expect(pf.format({year: 2016, month: null, day: 0})).toBe('2016--00');
- });
- });
-
-});
diff --git a/backup/src/datepicker/ngb-date-parser-formatter.ts b/backup/src/datepicker/ngb-date-parser-formatter.ts
deleted file mode 100644
index 93522a8..0000000
--- a/backup/src/datepicker/ngb-date-parser-formatter.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import {padNumber, toInteger, isNumber} from '../util/util';
-import {NgbDateStruct} from './ngb-date-struct';
-import {Injectable} from '@angular/core';
-
-export function NGB_DATEPICKER_PARSER_FORMATTER_FACTORY() {
- return new NgbDateISOParserFormatter();
-}
-
-/**
- * An abstract service for parsing and formatting dates for the
- * [`NgbInputDatepicker`](#/components/datepicker/api#NgbInputDatepicker) directive.
- * Converts between the internal `NgbDateStruct` model presentation and a `string` that is displayed in the
- * input element.
- *
- * When user types something in the input this service attempts to parse it into a `NgbDateStruct` object.
- * And vice versa, when users selects a date in the calendar with the mouse, it must be displayed as a `string`
- * in the input.
- *
- * Default implementation uses the ISO 8601 format, but you can provide another implementation via DI
- * to use an alternative string format or a custom parsing logic.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- */
-@Injectable({providedIn: 'root', useFactory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY})
-export abstract class NgbDateParserFormatter {
- /**
- * Parses the given `string` to an `NgbDateStruct`.
- *
- * Implementations should try their best to provide a result, even
- * partial. They must return `null` if the value can't be parsed.
- */
- abstract parse(value: string): NgbDateStruct;
-
- /**
- * Formats the given `NgbDateStruct` to a `string`.
- *
- * Implementations should return an empty string if the given date is `null`,
- * and try their best to provide a partial result if the given date is incomplete or invalid.
- */
- abstract format(date: NgbDateStruct): string;
-}
-
-@Injectable()
-export class NgbDateISOParserFormatter extends NgbDateParserFormatter {
- parse(value: string): NgbDateStruct {
- if (value) {
- const dateParts = value.trim().split('-');
- if (dateParts.length === 1 && isNumber(dateParts[0])) {
- return {year: toInteger(dateParts[0]), month: null, day: null};
- } else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {
- return {year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: null};
- } else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) {
- return {year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: toInteger(dateParts[2])};
- }
- }
- return null;
- }
-
- format(date: NgbDateStruct): string {
- return date ?
- `${date.year}-${isNumber(date.month) ? padNumber(date.month) : ''}-${isNumber(date.day) ? padNumber(date.day) : ''}` :
- '';
- }
-}
diff --git a/backup/src/datepicker/ngb-date-struct.ts b/backup/src/datepicker/ngb-date-struct.ts
deleted file mode 100644
index 24fa47c..0000000
--- a/backup/src/datepicker/ngb-date-struct.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * An interface of the date model used by the datepicker.
- *
- * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- */
-export interface NgbDateStruct {
- /**
- * The year, for example 2016
- */
- year: number;
-
- /**
- * The month, for example 1=Jan ... 12=Dec
- */
- month: number;
-
- /**
- * The day of month, starting at 1
- */
- day: number;
-}
diff --git a/backup/src/datepicker/ngb-date.spec.ts b/backup/src/datepicker/ngb-date.spec.ts
deleted file mode 100644
index c2ba06a..0000000
--- a/backup/src/datepicker/ngb-date.spec.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import {NgbDate} from './ngb-date';
-
-describe('ngb-date', () => {
-
- describe('from', () => {
-
- it('should create a date from a structure',
- () => { expect(NgbDate.from({year: 2010, month: 10, day: 2})).toEqual(new NgbDate(2010, 10, 2)); });
-
- it('should work with non-numeric values', () => {
- expect(NgbDate.from({year: null, month: null, day: null})).toEqual(new NgbDate(null, null, null));
- expect(NgbDate.from({year: undefined, month: undefined, day: undefined})).toEqual(new NgbDate(null, null, null));
- expect(NgbDate.from({year: '2010', month: '10', day: '2'})).toEqual(new NgbDate(null, null, null));
- });
-
- it('should return the same NgbDate object', () => {
- const date = new NgbDate(2010, 10, 10);
- expect(NgbDate.from(date)).toBe(date);
- });
- });
-
- describe('equals', () => {
- const date = new NgbDate(2016, 8, 18);
-
- it('should return true for the same dates', () => { expect(date.equals(new NgbDate(2016, 8, 18))).toBeTruthy(); });
-
- it('should work with structures', () => { expect(date.equals({day: 18, month: 8, year: 2016})).toBeTruthy(); });
-
- it('should return false different dates', () => {
- expect(date.equals(new NgbDate(0, 8, 18))).toBeFalsy();
- expect(date.equals(new NgbDate(2016, 0, 18))).toBeFalsy();
- expect(date.equals(new NgbDate(2016, 8, 0))).toBeFalsy();
- });
-
- it('should return false undefined and null values', () => {
- expect(date.equals(null)).toBeFalsy();
- expect(date.equals(undefined)).toBeFalsy();
- });
- });
-
- describe('before', () => {
- const date = new NgbDate(2016, 8, 18);
-
- it('should return false undefined and null values', () => {
- expect(date.before(null)).toBeFalsy();
- expect(date.before(undefined)).toBeFalsy();
- });
-
- it('should work with structures', () => { expect(date.before({day: 18, month: 9, year: 2016})).toBeTruthy(); });
-
- it('should return true if current date is before the other one', () => {
- expect(date.before(new NgbDate(2016, 8, 19))).toBeTruthy();
- expect(date.before(new NgbDate(2016, 9, 18))).toBeTruthy();
- expect(date.before(new NgbDate(2017, 8, 18))).toBeTruthy();
- });
-
- it('should return false if current date is after the other one', () => {
- expect(date.before(new NgbDate(2016, 8, 17))).toBeFalsy();
- expect(date.before(new NgbDate(2016, 7, 18))).toBeFalsy();
- expect(date.before(new NgbDate(2015, 8, 18))).toBeFalsy();
- });
- });
-
- describe('after', () => {
- const date = new NgbDate(2016, 8, 18);
-
- it('should return false undefined and null values', () => {
- expect(date.after(null)).toBeFalsy();
- expect(date.after(undefined)).toBeFalsy();
- });
-
- it('should work with structures', () => { expect(date.after({day: 17, month: 8, year: 2016})).toBeTruthy(); });
-
- it('should return true if current date is after the other one', () => {
- expect(date.after(new NgbDate(2016, 8, 17))).toBeTruthy();
- expect(date.after(new NgbDate(2016, 7, 18))).toBeTruthy();
- expect(date.after(new NgbDate(2015, 8, 18))).toBeTruthy();
- });
-
- it('should return false if current date is before the other one', () => {
- expect(date.after(new NgbDate(2016, 8, 19))).toBeFalsy();
- expect(date.after(new NgbDate(2016, 9, 18))).toBeFalsy();
- expect(date.after(new NgbDate(2017, 8, 18))).toBeFalsy();
- });
- });
-});
diff --git a/backup/src/datepicker/ngb-date.ts b/backup/src/datepicker/ngb-date.ts
deleted file mode 100644
index 4f65790..0000000
--- a/backup/src/datepicker/ngb-date.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-import {NgbDateStruct} from './ngb-date-struct';
-import {isInteger} from '../util/util';
-
-/**
- * A simple class that represents a date that datepicker also uses internally.
- *
- * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,
- * like `.equals()`, `.before()`, etc.
- *
- * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
- *
- * In many cases it is simpler to manipulate these objects together with
- * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.
- *
- * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
- *
- * @since 3.0.0
- */
-export class NgbDate implements NgbDateStruct {
- /**
- * The year, for example 2016
- */
- year: number;
-
- /**
- * The month, for example 1=Jan ... 12=Dec as in ISO 8601
- */
- month: number;
-
- /**
- * The day of month, starting with 1
- */
- day: number;
-
- /**
- * A **static method** that creates a new date object from the `NgbDateStruct`,
- *
- * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
- *
- * If the `date` is already of `NgbDate` type, the method will return the same object.
- */
- static from(date: NgbDateStruct): NgbDate {
- if (date instanceof NgbDate) {
- return date;
- }
- return date ? new NgbDate(date.year, date.month, date.day) : null;
- }
-
- constructor(year: number, month: number, day: number) {
- this.year = isInteger(year) ? year : null;
- this.month = isInteger(month) ? month : null;
- this.day = isInteger(day) ? day : null;
- }
-
- /**
- * Checks if the current date is equal to another date.
- */
- equals(other: NgbDateStruct): boolean {
- return other && this.year === other.year && this.month === other.month && this.day === other.day;
- }
-
- /**
- * Checks if the current date is before another date.
- */
- before(other: NgbDateStruct): boolean {
- if (!other) {
- return false;
- }
-
- if (this.year === other.year) {
- if (this.month === other.month) {
- return this.day === other.day ? false : this.day < other.day;
- } else {
- return this.month < other.month;
- }
- } else {
- return this.year < other.year;
- }
- }
-
- /**
- * Checks if the current date is after another date.
- */
- after(other: NgbDateStruct): boolean {
- if (!other) {
- return false;
- }
- if (this.year === other.year) {
- if (this.month === other.month) {
- return this.day === other.day ? false : this.day > other.day;
- } else {
- return this.month > other.month;
- }
- } else {
- return this.year > other.year;
- }
- }
-}
diff --git a/backup/src/dropdown/dropdown-config.spec.ts b/backup/src/dropdown/dropdown-config.spec.ts
deleted file mode 100644
index 8bd5917..0000000
--- a/backup/src/dropdown/dropdown-config.spec.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import {NgbDropdownConfig} from './dropdown-config';
-
-describe('ngb-dropdown-config', () => {
- it('should have sensible default values', () => {
- const config = new NgbDropdownConfig();
-
- expect(config.placement).toEqual(['bottom-left', 'bottom-right', 'top-left', 'top-right']);
- expect(config.autoClose).toBe(true);
- });
-
- it('should allow setting "inside" and "outside" value for autoClose', () => {
- const config = new NgbDropdownConfig();
-
- // This test looks like having trivial assertions but its goal
- // is to prove that we've got TS typings right.
- config.autoClose = 'outside';
- expect(config.autoClose).toBe('outside');
- config.autoClose = 'inside';
- expect(config.autoClose).toBe('inside');
- });
-});
diff --git a/backup/src/dropdown/dropdown-config.ts b/backup/src/dropdown/dropdown-config.ts
deleted file mode 100644
index a4766bf..0000000
--- a/backup/src/dropdown/dropdown-config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {Injectable} from '@angular/core';
-import {PlacementArray} from '../util/positioning';
-
-/**
- * A configuration service for the [`NgbDropdown`](#/components/dropdown/api#NgbDropdown) component.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all the dropdowns used in the application.
- */
-@Injectable({providedIn: 'root'})
-export class NgbDropdownConfig {
- autoClose: boolean | 'outside' | 'inside' = true;
- placement: PlacementArray = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
- container: null | 'body';
-}
diff --git a/backup/src/dropdown/dropdown.module.ts b/backup/src/dropdown/dropdown.module.ts
deleted file mode 100644
index 32cccfd..0000000
--- a/backup/src/dropdown/dropdown.module.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {NgModule} from '@angular/core';
-import {
- NgbDropdown,
- NgbDropdownAnchor,
- NgbDropdownToggle,
- NgbDropdownMenu,
- NgbDropdownItem,
- NgbNavbar
-} from './dropdown';
-
-export {NgbDropdown, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem} from './dropdown';
-export {NgbDropdownConfig} from './dropdown-config';
-
-const NGB_DROPDOWN_DIRECTIVES =
- [NgbDropdown, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem, NgbNavbar];
-
-@NgModule({declarations: NGB_DROPDOWN_DIRECTIVES, exports: NGB_DROPDOWN_DIRECTIVES})
-export class NgbDropdownModule {
-}
diff --git a/backup/src/dropdown/dropdown.spec.ts b/backup/src/dropdown/dropdown.spec.ts
deleted file mode 100644
index 456252d..0000000
--- a/backup/src/dropdown/dropdown.spec.ts
+++ /dev/null
@@ -1,492 +0,0 @@
-import {ComponentFixture, inject, TestBed} from '@angular/core/testing';
-import {createGenericTestComponent} from '../test/common';
-
-import {Component} from '@angular/core';
-
-import {NgbDropdown, NgbDropdownModule} from './dropdown.module';
-import {NgbDropdownConfig} from './dropdown-config';
-import {By} from '@angular/platform-browser';
-
-const createTestComponent = (html: string) =>
- createGenericTestComponent(html, TestComponent) as ComponentFixture;
-
-function getDropdownEl(tc) {
- return tc.querySelector(`[ngbDropdown]`);
-}
-
-function getMenuEl(tc) {
- return tc.querySelector(`[ngbDropdownMenu]`);
-}
-
-const jasmineMatchers = {
- toBeShown: function(util, customEqualityTests) {
- return {
- compare: function(actual, content?, selector?) {
- const dropdownEl = getDropdownEl(actual);
- const menuEl = getMenuEl(actual);
- const isOpen = dropdownEl.classList.contains('show') && menuEl.classList.contains('show');
-
- return {
- pass: isOpen,
- message: `Expected ${actual.outerHTML} to have the "show class on both container and menu"`
- };
- },
- negativeCompare: function(actual) {
- const dropdownEl = getDropdownEl(actual);
- const menuEl = getMenuEl(actual);
- const isClosed = !dropdownEl.classList.contains('show') && !menuEl.classList.contains('show');
-
- return {
- pass: isClosed,
- message: `Expected ${actual.outerHTML} not to have the "show class both container and menu"`
- };
- }
- };
- }
-};
-
-describe('ngb-dropdown', () => {
-
- beforeEach(() => {
- jasmine.addMatchers(jasmineMatchers);
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDropdownModule]});
- });
-
- it('should be closed and down by default', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- expect(compiled).not.toBeShown();
- });
-
- it('should have dropup CSS class if placed on top', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- expect(getDropdownEl(compiled)).toHaveCssClass('dropup');
- });
-
- it('should have dropdown CSS class if placement is other than top', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- expect(getDropdownEl(compiled)).toHaveCssClass('dropdown');
- });
-
- it('should have x-placement attribute reflecting placement', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- fixture.detectChanges();
- expect(getMenuEl(compiled).getAttribute('x-placement')).toBe('bottom-right');
- });
-
- it('should have x-placement attribute reflecting placement with a template', () => {
-
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- fixture.detectChanges();
- expect(getMenuEl(compiled).getAttribute('x-placement')).toBe('bottom-right');
- });
-
- it('should be open initially if open expression is true', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- expect(compiled).toBeShown();
- });
-
- it('should toggle open on "open" binding change', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
-
- expect(compiled).not.toBeShown();
-
- fixture.componentInstance.isOpen = true;
- fixture.detectChanges();
- expect(compiled).toBeShown();
-
- fixture.componentInstance.isOpen = false;
- fixture.detectChanges();
- expect(compiled).not.toBeShown();
- });
-
- it('should allow toggling dropdown from outside', () => {
- const html = `
- Open
- Close
- Toggle
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- let buttonEls = compiled.querySelectorAll('button');
-
- buttonEls[0].click();
- fixture.detectChanges();
- expect(compiled).toBeShown();
-
- buttonEls[1].click();
- fixture.detectChanges();
- expect(compiled).not.toBeShown();
-
- buttonEls[2].click();
- fixture.detectChanges();
- expect(compiled).toBeShown();
-
- buttonEls[2].click();
- fixture.detectChanges();
- expect(compiled).not.toBeShown();
- });
-
- it('should allow binding to open output', () => {
- const html = `
- Toggle
-
`;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- let buttonEl = compiled.querySelector('button');
-
- expect(fixture.componentInstance.isOpen).toBe(false);
-
- buttonEl.click();
- fixture.detectChanges();
-
- expect(fixture.componentInstance.isOpen).toBe(true);
-
- buttonEl.click();
- fixture.detectChanges();
-
- expect(fixture.componentInstance.isOpen).toBe(false);
- });
-
- it('should not raise open events if open state does not change', () => {
- const html = `
- Open
- Close
-
`;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- let buttonEls = compiled.querySelectorAll('button');
-
- expect(fixture.componentInstance.isOpen).toBe(false);
- expect(fixture.componentInstance.stateChanges).toEqual([]);
-
- buttonEls[1].click(); // close a closed one
- fixture.detectChanges();
- expect(fixture.componentInstance.isOpen).toBe(false);
- expect(fixture.componentInstance.stateChanges).toEqual([]);
-
- buttonEls[0].click(); // open a closed one
- fixture.detectChanges();
- expect(fixture.componentInstance.isOpen).toBe(true);
- expect(fixture.componentInstance.stateChanges).toEqual([true]);
-
- buttonEls[0].click(); // open an opened one
- fixture.detectChanges();
- expect(fixture.componentInstance.isOpen).toBe(true);
- expect(fixture.componentInstance.stateChanges).toEqual([true]);
-
- buttonEls[1].click(); // close an opened one
- fixture.detectChanges();
- expect(fixture.componentInstance.isOpen).toBe(false);
- expect(fixture.componentInstance.stateChanges).toEqual([true, false]);
- });
-});
-
-describe('ngb-dropdown-toggle', () => {
- beforeEach(() => {
- jasmine.addMatchers(jasmineMatchers);
- TestBed.configureTestingModule({declarations: [TestComponent], imports: [NgbDropdownModule]});
- });
-
- it('should toggle dropdown on click', () => {
- const html = `
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- let dropdownEl = getDropdownEl(compiled);
- let buttonEl = compiled.querySelector('button');
-
- expect(dropdownEl).not.toHaveCssClass('show');
- expect(buttonEl.getAttribute('aria-haspopup')).toBe('true');
- expect(buttonEl.getAttribute('aria-expanded')).toBe('false');
-
- buttonEl.click();
- fixture.detectChanges();
- expect(compiled).toBeShown();
- expect(buttonEl.getAttribute('aria-expanded')).toBe('true');
-
- buttonEl.click();
- fixture.detectChanges();
- expect(compiled).not.toBeShown();
- expect(buttonEl.getAttribute('aria-expanded')).toBe('false');
- });
-
- it('should toggle dropdown on click of child of toggle', () => {
- const html = `
-
-
- Toggle dropdown
-
-
-
`;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- const toggleEl = compiled.querySelector('.toggle');
-
- expect(compiled).not.toBeShown();
-
- toggleEl.click();
- fixture.detectChanges();
- expect(compiled).toBeShown();
-
- toggleEl.click();
- fixture.detectChanges();
- expect(compiled).not.toBeShown();
- });
-
- it('should be appended to body', () => {
- const html = `
-
-
- Toggle dropdown
-
-
-
`;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- const dropdown = fixture.debugElement.query(By.directive(NgbDropdown)).injector.get(NgbDropdown);
- dropdown.open();
- fixture.detectChanges();
- const dropdownElement = document.querySelector('div[ngbDropdownMenu]');
- const parentContainer = dropdownElement.parentNode;
- expect(parentContainer).toHaveCssClass('dropdown');
- expect(parentContainer.parentNode).toBe(document.body, 'The dropdown should be attached to the body');
-
- });
-
- it(`should second placement if the first one doesn't fit`, () => {
- const html = `
-
-
- Toggle dropdown
-
-
-
`;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- const dropdown = fixture.debugElement.query(By.directive(NgbDropdown)).injector.get(NgbDropdown);
- dropdown.open();
- fixture.detectChanges();
- const dropdownEl = compiled.querySelector('[ngbdropdownmenu]');
- const targetElement = compiled.querySelector('button');
- expect(Math.round(dropdownEl.getBoundingClientRect().left))
- .toBe(Math.round(targetElement.getBoundingClientRect().right), 'Wrong dropdown placement');
-
- });
-
- describe('ngb-dropdown-navbar', () => {
- it(`shouldn't position the menu`, () => {
- const html = `
-
-
-
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- const dropdown = fixture.debugElement.query(By.directive(NgbDropdown)).injector.get(NgbDropdown);
- dropdown.open();
- fixture.detectChanges();
- const dropdownEl: HTMLElement = compiled.querySelector('[ngbdropdownmenu]');
-
- expect(dropdownEl.getAttribute('style')).toBeNull(`The dropdown element shouldn't have calculated styles`);
- expect(dropdownEl.getAttribute('x-placement')).toBeNull(`The dropdown element shouldn't have x-placement set`);
-
- });
-
- it(`can override the defaut display value`, () => {
- const html = `
-
-
-
- `;
-
- const fixture = createTestComponent(html);
- const compiled = fixture.nativeElement;
- const dropdown = fixture.debugElement.query(By.directive(NgbDropdown)).injector.get(NgbDropdown);
- dropdown.open();
- fixture.detectChanges();
- const dropdownEl: HTMLElement = compiled.querySelector('[ngbdropdownmenu]');
-
- expect(dropdownEl.getAttribute('style')).not.toBeNull(`The dropdown element should have calculated styles`);
-
- });
-
- });
-
- describe('Custom config', () => {
- let config: NgbDropdownConfig;
-
- beforeEach(() => {
- TestBed.configureTestingModule({imports: [NgbDropdownModule]});
- TestBed.overrideComponent(TestComponent, {
- set: {
- template: `
- `
- }
- });
- });
-
- beforeEach(inject([NgbDropdownConfig], (c: NgbDropdownConfig) => {
- config = c;
- config.placement = 'top-right';
- }));
-
- it('should initialize inputs with provided config', () => {
- const fixture = TestBed.createComponent(TestComponent);
- fixture.detectChanges();
-
- const compiled = fixture.nativeElement;
-
- expect(getDropdownEl(compiled)).toHaveCssClass('dropup');
- });
- });
-
- describe('Custom config as provider', () => {
- let config = new NgbDropdownConfig();
- config.placement = 'top-right';
-
- beforeEach(() => {
- TestBed.configureTestingModule(
- {imports: [NgbDropdownModule], providers: [{provide: NgbDropdownConfig, useValue: config}]});
- });
-
- it('should initialize inputs with provided config as provider', () => {
- const fixture = createTestComponent(`
- `);
- fixture.detectChanges();
-
- const compiled = fixture.nativeElement;
-
- expect(getDropdownEl(compiled)).toHaveCssClass('dropup');
- });
- });
-});
-
-@Component({selector: 'test-cmp', template: ''})
-class TestComponent {
- isOpen = false;
- stateChanges = [];
- items = [];
-
- recordStateChange($event) {
- this.stateChanges.push($event);
- this.isOpen = $event;
- }
-}
diff --git a/backup/src/dropdown/dropdown.ts b/backup/src/dropdown/dropdown.ts
deleted file mode 100644
index 937f569..0000000
--- a/backup/src/dropdown/dropdown.ts
+++ /dev/null
@@ -1,437 +0,0 @@
-import {
- ChangeDetectorRef,
- ContentChild,
- ContentChildren,
- Directive,
- ElementRef,
- EventEmitter,
- forwardRef,
- Inject,
- Input,
- NgZone,
- AfterContentInit,
- OnDestroy,
- Output,
- QueryList,
- Renderer2,
- SimpleChanges,
- Optional
-} from '@angular/core';
-import {DOCUMENT} from '@angular/common';
-import {Subject, Subscription} from 'rxjs';
-import {take} from 'rxjs/operators';
-
-import {Placement, PlacementArray, positionElements} from '../util/positioning';
-import {ngbAutoClose} from '../util/autoclose';
-import {Key} from '../util/key';
-
-import {NgbDropdownConfig} from './dropdown-config';
-
-@Directive({selector: '.navbar'})
-export class NgbNavbar {
-}
-
-/**
- * A directive you should put put on a dropdown item to enable keyboard navigation.
- * Arrow keys will move focus between items marked with this directive.
- *
- * @since 4.1.0
- */
-@Directive({selector: '[ngbDropdownItem]', host: {'class': 'dropdown-item', '[class.disabled]': 'disabled'}})
-export class NgbDropdownItem {
- private _disabled = false;
-
- @Input()
- set disabled(value: boolean) {
- this._disabled = value === '' || value === true; // accept an empty attribute as true
- }
-
- get disabled(): boolean { return this._disabled; }
-
- constructor(public elementRef: ElementRef) {}
-}
-
-/**
- * A directive that wraps dropdown menu content and dropdown items.
- */
-@Directive({
- selector: '[ngbDropdownMenu]',
- host: {
- '[class.dropdown-menu]': 'true',
- '[class.show]': 'dropdown.isOpen()',
- '[attr.x-placement]': 'placement',
- '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
- '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
- '(keydown.Home)': 'dropdown.onKeyDown($event)',
- '(keydown.End)': 'dropdown.onKeyDown($event)',
- '(keydown.Enter)': 'dropdown.onKeyDown($event)',
- '(keydown.Space)': 'dropdown.onKeyDown($event)'
- }
-})
-export class NgbDropdownMenu {
- placement: Placement = 'bottom';
- isOpen = false;
-
- @ContentChildren(NgbDropdownItem) menuItems: QueryList;
-
- constructor(@Inject(forwardRef(() => NgbDropdown)) public dropdown) {}
-}
-
-/**
- * A directive to mark an element to which dropdown menu will be anchored.
- *
- * This is a simple version of the `NgbDropdownToggle` directive.
- * It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support
- * for events other than click.
- *
- * @since 1.1.0
- */
-@Directive({
- selector: '[ngbDropdownAnchor]',
- host: {'class': 'dropdown-toggle', 'aria-haspopup': 'true', '[attr.aria-expanded]': 'dropdown.isOpen()'}
-})
-export class NgbDropdownAnchor {
- anchorEl;
-
- constructor(@Inject(forwardRef(() => NgbDropdown)) public dropdown, private _elementRef: ElementRef) {
- this.anchorEl = _elementRef.nativeElement;
- }
-
- getNativeElement() { return this._elementRef.nativeElement; }
-}
-
-/**
- * A directive to mark an element that will toggle dropdown via the `click` event.
- *
- * You can also use `NgbDropdownAnchor` as an alternative.
- */
-@Directive({
- selector: '[ngbDropdownToggle]',
- host: {
- 'class': 'dropdown-toggle',
- 'aria-haspopup': 'true',
- '[attr.aria-expanded]': 'dropdown.isOpen()',
- '(click)': 'dropdown.toggle()',
- '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
- '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
- '(keydown.Home)': 'dropdown.onKeyDown($event)',
- '(keydown.End)': 'dropdown.onKeyDown($event)'
- },
- providers: [{provide: NgbDropdownAnchor, useExisting: forwardRef(() => NgbDropdownToggle)}]
-})
-export class NgbDropdownToggle extends NgbDropdownAnchor {
- constructor(@Inject(forwardRef(() => NgbDropdown)) dropdown, elementRef: ElementRef) {
- super(dropdown, elementRef);
- }
-}
-
-/**
- * A directive that provides contextual overlays for displaying lists of links and more.
- */
-@Directive({selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: {'[class.show]': 'isOpen()'}})
-export class NgbDropdown implements AfterContentInit, OnDestroy {
- private _closed$ = new Subject();
- private _zoneSubscription: Subscription;
- private _bodyContainer: HTMLElement;
-
- @ContentChild(NgbDropdownMenu, {static: false}) private _menu: NgbDropdownMenu;
- @ContentChild(NgbDropdownMenu, {read: ElementRef, static: false}) private _menuElement: ElementRef;
- @ContentChild(NgbDropdownAnchor, {static: false}) private _anchor: NgbDropdownAnchor;
-
- /**
- * Indicates whether the dropdown should be closed when clicking one of dropdown items or pressing ESC.
- *
- * * `true` - the dropdown will close on both outside and inside (menu) clicks.
- * * `false` - the dropdown can only be closed manually via `close()` or `toggle()` methods.
- * * `"inside"` - the dropdown will close on inside menu clicks, but not outside clicks.
- * * `"outside"` - the dropdown will close only on the outside clicks and not on menu clicks.
- */
- @Input() autoClose: boolean | 'outside' | 'inside';
-
- /**
- * Defines whether or not the dropdown menu is opened initially.
- */
- @Input('open') _open = false;
-
- /**
- * The preferred placement of the dropdown.
- *
- * Possible values are `"top"`, `"top-left"`, `"top-right"`, `"bottom"`, `"bottom-left"`,
- * `"bottom-right"`, `"left"`, `"left-top"`, `"left-bottom"`, `"right"`, `"right-top"`,
- * `"right-bottom"`
- *
- * Accepts an array of strings or a string with space separated possible values.
- *
- * The default order of preference is `"bottom-left bottom-right top-left top-right"`
- *
- * Please see the [positioning overview](#/positioning) for more details.
- */
- @Input() placement: PlacementArray;
-
- /**
- * A selector specifying the element the dropdown should be appended to.
- * Currently only supports "body".
- *
- * @since 4.1.0
- */
- @Input() container: null | 'body';
-
- /**
- * Enable or disable the dynamic positioning. The default value is dynamic unless the dropdown is used
- * inside a Bootstrap navbar. If you need custom placement for a dropdown in a navbar, set it to
- * dynamic explicitly. See the [positioning of dropdown](#/positioning#dropdown)
- * and the [navbar demo](/#/components/dropdown/examples#navbar) for more details.
- *
- * @since 4.2.0
- */
- @Input() display: 'dynamic' | 'static';
-
- /**
- * An event fired when the dropdown is opened or closed.
- *
- * The event payload is a `boolean`:
- * * `true` - the dropdown was opened
- * * `false` - the dropdown was closed
- */
- @Output() openChange = new EventEmitter();
-
- constructor(
- private _changeDetector: ChangeDetectorRef, config: NgbDropdownConfig, @Inject(DOCUMENT) private _document: any,
- private _ngZone: NgZone, private _elementRef: ElementRef, private _renderer: Renderer2,
- @Optional() ngbNavbar: NgbNavbar) {
- this.placement = config.placement;
- this.container = config.container;
- this.autoClose = config.autoClose;
-
- this.display = ngbNavbar ? 'static' : 'dynamic';
-
- this._zoneSubscription = _ngZone.onStable.subscribe(() => { this._positionMenu(); });
- }
-
- ngAfterContentInit() {
- this._ngZone.onStable.pipe(take(1)).subscribe(() => {
- this._applyPlacementClasses();
- if (this._open) {
- this._setCloseHandlers();
- }
- });
- }
-
- ngOnChanges(changes: SimpleChanges) {
- if (changes.container && this._open) {
- this._applyContainer(this.container);
- }
-
- if (changes.placement && !changes.placement.isFirstChange) {
- this._applyPlacementClasses();
- }
- }
-
- /**
- * Checks if the dropdown menu is open.
- */
- isOpen(): boolean { return this._open; }
-
- /**
- * Opens the dropdown menu.
- */
- open(): void {
- if (!this._open) {
- this._open = true;
- this._applyContainer(this.container);
- this.openChange.emit(true);
- this._setCloseHandlers();
- }
- }
-
- private _setCloseHandlers() {
- const anchor = this._anchor;
- ngbAutoClose(
- this._ngZone, this._document, this.autoClose, () => this.close(), this._closed$,
- this._menu ? [this._menuElement.nativeElement] : [], anchor ? [anchor.getNativeElement()] : [],
- '.dropdown-item,.dropdown-divider');
- }
-
- /**
- * Closes the dropdown menu.
- */
- close(): void {
- if (this._open) {
- this._open = false;
- this._resetContainer();
- this._closed$.next();
- this.openChange.emit(false);
- this._changeDetector.markForCheck();
- }
- }
-
- /**
- * Toggles the dropdown menu.
- */
- toggle(): void {
- if (this.isOpen()) {
- this.close();
- } else {
- this.open();
- }
- }
-
- ngOnDestroy() {
- this._resetContainer();
-
- this._closed$.next();
- this._zoneSubscription.unsubscribe();
- }
-
- onKeyDown(event: KeyboardEvent) {
- // tslint:disable-next-line:deprecation
- const key = event.which;
- const itemElements = this._getMenuElements();
-
- let position = -1;
- let isEventFromItems = false;
- const isEventFromToggle = this._isEventFromToggle(event);
-
- if (!isEventFromToggle && itemElements.length) {
- itemElements.forEach((itemElement, index) => {
- if (itemElement.contains(event.target as HTMLElement)) {
- isEventFromItems = true;
- }
- if (itemElement === this._document.activeElement) {
- position = index;
- }
- });
- }
-
- // closing on Enter / Space
- if (key === Key.Space || key === Key.Enter) {
- if (isEventFromItems && (this.autoClose === true || this.autoClose === 'inside')) {
- this.close();
- }
- return;
- }
-
- // opening / navigating
- if (isEventFromToggle || isEventFromItems) {
- this.open();
-
- if (itemElements.length) {
- switch (key) {
- case Key.ArrowDown:
- position = Math.min(position + 1, itemElements.length - 1);
- break;
- case Key.ArrowUp:
- if (this._isDropup() && position === -1) {
- position = itemElements.length - 1;
- break;
- }
- position = Math.max(position - 1, 0);
- break;
- case Key.Home:
- position = 0;
- break;
- case Key.End:
- position = itemElements.length - 1;
- break;
- }
- itemElements[position].focus();
- }
- event.preventDefault();
- }
- }
-
- private _isDropup(): boolean { return this._elementRef.nativeElement.classList.contains('dropup'); }
-
- private _isEventFromToggle(event: KeyboardEvent) {
- return this._anchor.getNativeElement().contains(event.target as HTMLElement);
- }
-
- private _getMenuElements(): HTMLElement[] {
- const menu = this._menu;
- if (menu == null) {
- return [];
- }
- return menu.menuItems.filter(item => !item.disabled).map(item => item.elementRef.nativeElement);
- }
-
- private _positionMenu() {
- const menu = this._menu;
- if (this.isOpen() && menu) {
- this._applyPlacementClasses(
- this.display === 'dynamic' ?
- positionElements(
- this._anchor.anchorEl, this._bodyContainer || this._menuElement.nativeElement, this.placement,
- this.container === 'body') :
- this._getFirstPlacement(this.placement));
- }
- }
-
- private _getFirstPlacement(placement: PlacementArray): Placement {
- return Array.isArray(placement) ? placement[0] : placement.split(' ')[0] as Placement;
- }
-
- private _resetContainer() {
- const renderer = this._renderer;
- const menuElement = this._menuElement;
- if (menuElement) {
- const dropdownElement = this._elementRef.nativeElement;
- const dropdownMenuElement = menuElement.nativeElement;
-
- renderer.appendChild(dropdownElement, dropdownMenuElement);
- renderer.removeStyle(dropdownMenuElement, 'position');
- renderer.removeStyle(dropdownMenuElement, 'transform');
- }
- if (this._bodyContainer) {
- renderer.removeChild(this._document.body, this._bodyContainer);
- this._bodyContainer = null;
- }
- }
-
- private _applyContainer(container: null | 'body' = null) {
- this._resetContainer();
- if (container === 'body') {
- const renderer = this._renderer;
- const dropdownMenuElement = this._menuElement.nativeElement;
- const bodyContainer = this._bodyContainer = this._bodyContainer || renderer.createElement('div');
-
- // Override some styles to have the positionning working
- renderer.setStyle(bodyContainer, 'position', 'absolute');
- renderer.setStyle(dropdownMenuElement, 'position', 'static');
- renderer.setStyle(bodyContainer, 'z-index', '1050');
-
- renderer.appendChild(bodyContainer, dropdownMenuElement);
- renderer.appendChild(this._document.body, bodyContainer);
- }
- }
-
- private _applyPlacementClasses(placement?: Placement) {
- const menu = this._menu;
- if (menu) {
- if (!placement) {
- placement = this._getFirstPlacement(this.placement);
- }
-
- const renderer = this._renderer;
- const dropdownElement = this._elementRef.nativeElement;
-
- // remove the current placement classes
- renderer.removeClass(dropdownElement, 'dropup');
- renderer.removeClass(dropdownElement, 'dropdown');
- menu.placement = this.display === 'static' ? null : placement;
-
- /*
- * apply the new placement
- * in case of top use up-arrow or down-arrow otherwise
- */
- const dropdownClass = placement.search('^top') !== -1 ? 'dropup' : 'dropdown';
- renderer.addClass(dropdownElement, dropdownClass);
-
- const bodyContainer = this._bodyContainer;
- if (bodyContainer) {
- renderer.removeClass(bodyContainer, 'dropup');
- renderer.removeClass(bodyContainer, 'dropdown');
- renderer.addClass(bodyContainer, dropdownClass);
- }
- }
- }
-}
diff --git a/backup/src/index.ts b/backup/src/index.ts
deleted file mode 100644
index 6540e29..0000000
--- a/backup/src/index.ts
+++ /dev/null
@@ -1,140 +0,0 @@
-import {NgModule} from '@angular/core';
-
-import {SbCardModule} from './card/card.module';
-import {NgbAccordionModule} from './accordion/accordion.module';
-import {NgbAlertModule} from './alert/alert.module';
-import {NgbButtonsModule} from './buttons/buttons.module';
-import {NgbCarouselModule} from './carousel/carousel.module';
-import {NgbCollapseModule} from './collapse/collapse.module';
-import {NgbDatepickerModule} from './datepicker/datepicker.module';
-import {NgbDropdownModule} from './dropdown/dropdown.module';
-import {NgbModalModule} from './modal/modal.module';
-import {NgbPaginationModule} from './pagination/pagination.module';
-import {NgbPopoverModule} from './popover/popover.module';
-import {NgbProgressbarModule} from './progressbar/progressbar.module';
-import {NgbRatingModule} from './rating/rating.module';
-import {NgbTabsetModule} from './tabset/tabset.module';
-import {NgbTimepickerModule} from './timepicker/timepicker.module';
-import {NgbToastModule} from './toast/toast.module';
-import {NgbTooltipModule} from './tooltip/tooltip.module';
-import {NgbTypeaheadModule} from './typeahead/typeahead.module';
-
-
-
-export {
- NgbAccordion,
- NgbAccordionConfig,
- NgbAccordionModule,
- NgbPanel,
- NgbPanelChangeEvent,
- NgbPanelContent,
- NgbPanelHeader,
- NgbPanelHeaderContext,
- NgbPanelTitle,
- NgbPanelToggle
-} from './accordion/accordion.module';
-export {SbCard, SbCardConfig, SbCardModule} from './card/card.module';
-export {NgbAlert, NgbAlertConfig, NgbAlertModule} from './alert/alert.module';
-export {NgbButtonLabel, NgbButtonsModule, NgbCheckBox, NgbRadio, NgbRadioGroup} from './buttons/buttons.module';
-export {
- NgbCarousel,
- NgbCarouselConfig,
- NgbCarouselModule,
- NgbSlide,
- NgbSlideEvent,
- NgbSlideEventDirection,
- NgbSlideEventSource
-} from './carousel/carousel.module';
-export {NgbCollapse, NgbCollapseModule} from './collapse/collapse.module';
-export {
- NgbCalendar,
- NgbCalendarGregorian,
- NgbCalendarHebrew,
- NgbCalendarIslamicCivil,
- NgbCalendarIslamicUmalqura,
- NgbCalendarPersian,
- NgbDate,
- NgbDateAdapter,
- NgbDateNativeAdapter,
- NgbDateNativeUTCAdapter,
- NgbDateParserFormatter,
- NgbDatepicker,
- NgbDatepickerConfig,
- NgbDatepickerI18n,
- NgbDatepickerI18nHebrew,
- NgbDatepickerModule,
- NgbDatepickerNavigateEvent,
- NgbDateStruct,
- NgbInputDatepicker,
- NgbPeriod
-} from './datepicker/datepicker.module';
-export {
- NgbDropdown,
- NgbDropdownAnchor,
- NgbDropdownConfig,
- NgbDropdownItem,
- NgbDropdownMenu,
- NgbDropdownModule,
- NgbDropdownToggle
-} from './dropdown/dropdown.module';
-export {
- ModalDismissReasons,
- NgbActiveModal,
- NgbModal,
- NgbModalConfig,
- NgbModalModule,
- NgbModalOptions,
- NgbModalRef
-} from './modal/modal.module';
-export {
- NgbPagination,
- NgbPaginationConfig,
- NgbPaginationEllipsis,
- NgbPaginationFirst,
- NgbPaginationLast,
- NgbPaginationModule,
- NgbPaginationNext,
- NgbPaginationNumber,
- NgbPaginationPrevious
-} from './pagination/pagination.module';
-export {NgbPopover, NgbPopoverConfig, NgbPopoverModule} from './popover/popover.module';
-export {NgbProgressbar, NgbProgressbarConfig, NgbProgressbarModule} from './progressbar/progressbar.module';
-export {NgbRating, NgbRatingConfig, NgbRatingModule} from './rating/rating.module';
-export {
- NgbTab,
- NgbTabChangeEvent,
- NgbTabContent,
- NgbTabset,
- NgbTabsetConfig,
- NgbTabsetModule,
- NgbTabTitle
-} from './tabset/tabset.module';
-export {
- NgbTimeAdapter,
- NgbTimepickerI18n,
- NgbTimepicker,
- NgbTimepickerConfig,
- NgbTimepickerModule,
- NgbTimeStruct
-} from './timepicker/timepicker.module';
-export {NgbToast, NgbToastConfig, NgbToastHeader, NgbToastModule} from './toast/toast.module';
-export {NgbTooltip, NgbTooltipConfig, NgbTooltipModule} from './tooltip/tooltip.module';
-export {
- NgbHighlight,
- NgbTypeahead,
- NgbTypeaheadConfig,
- NgbTypeaheadModule,
- NgbTypeaheadSelectItemEvent
-} from './typeahead/typeahead.module';
-export {Placement} from './util/positioning';
-
-
-const NGB_MODULES = [
- SbCardModule, NgbAccordionModule, NgbAlertModule, NgbButtonsModule, NgbCarouselModule, NgbCollapseModule, NgbDatepickerModule,
- NgbDropdownModule, NgbModalModule, NgbPaginationModule, NgbPopoverModule, NgbProgressbarModule, NgbRatingModule,
- NgbTabsetModule, NgbTimepickerModule, NgbToastModule, NgbTooltipModule, NgbTypeaheadModule
-];
-
-@NgModule({imports: NGB_MODULES, exports: NGB_MODULES})
-export class NgbModule {
-}
diff --git a/backup/src/karma-ie.sauce.conf.js b/backup/src/karma-ie.sauce.conf.js
deleted file mode 100644
index 9eb9591..0000000
--- a/backup/src/karma-ie.sauce.conf.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// Configuration used testing via Sauce Labs on Travis CI
-
-process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY.split('').reverse().join('');
-
-const BROWSERS = {
- 'SL_IE10': {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 8',
- version: '10'
- },
- 'SL_IE11': {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 10',
- version: '11'
- },
-};
-
-module.exports = function (config) {
- config.set({
- basePath: '',
- files: ['../node_modules/bootstrap/dist/css/bootstrap.min.css'],
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
- plugins: [
- require('karma-jasmine'),
- require('karma-sauce-launcher'),
- require('@angular-devkit/build-angular/plugins/karma')
- ],
- client: {
- clearContext: false // leave Jasmine Spec Runner output visible in browser
- },
- sauceLabs: {
- build: `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`,
- tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
- testName: 'ng-bootstrap/ie',
- retryLimit: 3,
- startConnect: false,
- recordVideo: false,
- recordScreenshots: false,
- options: {
- commandTimeout: 600,
- idleTimeout: 600,
- maxDuration: 5400
- }
- },
-
- customLaunchers: BROWSERS,
-
- reporters: ['dots', 'saucelabs'],
-
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- browsers: Object.keys(BROWSERS),
- singleRun: true,
- captureTimeout: 180000,
- browserDisconnectTimeout: 180000,
- browserDisconnectTolerance: 3,
- browserNoActivityTimeout: 300000
- });
-};
diff --git a/backup/src/karma.conf.js b/backup/src/karma.conf.js
deleted file mode 100644
index c30cd35..0000000
--- a/backup/src/karma.conf.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Configuration used for local testing and Travis CI
-
-const reporters = process.env.TRAVIS ? ['dots'] : ['progress'];
-const browsers = process.env.TRAVIS ? ['ChromeHeadlessNoSandbox'] : ['ChromeNoExtensions'];
-
-module.exports = function (config) {
- config.set({
- basePath: '',
- files: ['../node_modules/bootstrap/dist/css/bootstrap.min.css'],
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
- plugins: [
- require('karma-jasmine'),
- require('karma-chrome-launcher'),
- require('karma-firefox-launcher'),
- require('karma-coverage-istanbul-reporter'),
- require('@angular-devkit/build-angular/plugins/karma')
- ],
- client: {
- clearContext: false // leave Jasmine Spec Runner output visible in browser
- },
- coverageIstanbulReporter: {
- dir: require('path').join(__dirname, '..', 'coverage'),
- reports: ['html', 'json', 'lcovonly'],
- fixWebpackSourcePaths: true
- },
- customLaunchers: {
- ChromeHeadlessNoSandbox: {
- base: 'ChromeHeadless',
- flags: ['--no-sandbox']
- },
- ChromeNoExtensions: {
- base: 'Chrome',
- flags: ['--disable-extensions']
- }
- },
- reporters,
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- autoWatch: true,
- browsers,
- singleRun: false,
- restartOnFileChange: true,
- browserNoActivityTimeout: 20000
- });
-};
diff --git a/backup/src/karma.sauce.conf.js b/backup/src/karma.sauce.conf.js
deleted file mode 100644
index 5c9189f..0000000
--- a/backup/src/karma.sauce.conf.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Configuration used testing via Sauce Labs on Travis CI
-
-process.env.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY.split('').reverse().join('');
-
-const BROWSERS = {
- 'SL_CHROME': {
- base: 'SauceLabs',
- browserName: 'chrome',
- version: 'latest'
- },
- 'SL_FIREFOX': {
- base: 'SauceLabs',
- browserName: 'firefox',
- version: 'latest'
- },
- 'SL_EDGE16': {
- base: 'SauceLabs',
- browserName: 'MicrosoftEdge',
- platform: 'Windows 10',
- version: '16.16299'
- },
- 'SL_EDGE17': {
- base: 'SauceLabs',
- browserName: 'MicrosoftEdge',
- platform: 'Windows 10',
- version: '17.17134'
- },
- 'SL_SAFARI11': {
- base: 'SauceLabs',
- browserName: 'safari',
- platform: 'macOS 10.13',
- version: '11'
- },
- 'SL_SAFARI12': {
- base: 'SauceLabs',
- browserName: 'safari',
- platform: 'macOS 10.13',
- version: '12'
- },
-};
-
-module.exports = function (config) {
- config.set({
- basePath: '',
- files: ['../node_modules/bootstrap/dist/css/bootstrap.min.css'],
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
- plugins: [
- require('karma-jasmine'),
- require('karma-sauce-launcher'),
- require('@angular-devkit/build-angular/plugins/karma')
- ],
- client: {
- clearContext: false // leave Jasmine Spec Runner output visible in browser
- },
- sauceLabs: {
- build: `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`,
- tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
- testName: 'ng-bootstrap',
- retryLimit: 3,
- startConnect: false,
- recordVideo: false,
- recordScreenshots: false,
- options: {
- commandTimeout: 600,
- idleTimeout: 600,
- maxDuration: 5400
- }
- },
-
- customLaunchers: BROWSERS,
-
- reporters: ['dots', 'saucelabs'],
-
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- browsers: Object.keys(BROWSERS),
- singleRun: true,
- captureTimeout: 180000,
- browserDisconnectTimeout: 180000,
- browserDisconnectTolerance: 3,
- browserNoActivityTimeout: 300000
- });
-};
diff --git a/backup/src/modal/modal-backdrop.spec.ts b/backup/src/modal/modal-backdrop.spec.ts
deleted file mode 100644
index 4237e8e..0000000
--- a/backup/src/modal/modal-backdrop.spec.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import {TestBed} from '@angular/core/testing';
-
-import {NgbModalBackdrop} from './modal-backdrop';
-
-describe('ngb-modal-backdrop', () => {
-
- beforeEach(() => { TestBed.configureTestingModule({declarations: [NgbModalBackdrop]}); });
-
- it('should render backdrop with required CSS classes', () => {
- const fixture = TestBed.createComponent(NgbModalBackdrop);
-
- fixture.detectChanges();
- expect(fixture.nativeElement).toHaveCssClass('modal-backdrop');
- });
-});
diff --git a/backup/src/modal/modal-backdrop.ts b/backup/src/modal/modal-backdrop.ts
deleted file mode 100644
index cffcbef..0000000
--- a/backup/src/modal/modal-backdrop.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {Component, Input} from '@angular/core';
-
-@Component({
- selector: 'ngb-modal-backdrop',
- template: '',
- host:
- {'[class]': '"modal-backdrop fade show" + (backdropClass ? " " + backdropClass : "")', 'style': 'z-index: 1050'}
-})
-export class NgbModalBackdrop {
- @Input() backdropClass: string;
-}
diff --git a/backup/src/modal/modal-config.ts b/backup/src/modal/modal-config.ts
deleted file mode 100644
index f0339a6..0000000
--- a/backup/src/modal/modal-config.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-import {Injectable, Injector} from '@angular/core';
-
-/**
- * Options available when opening new modal windows with `NgbModal.open()` method.
- */
-export interface NgbModalOptions {
- /**
- * `aria-labelledby` attribute value to set on the modal window.
- *
- * @since 2.2.0
- */
- ariaLabelledBy?: string;
-
- /**
- * If `true`, the backdrop element will be created for a given modal.
- *
- * Alternatively, specify `'static'` for a backdrop which doesn't close the modal on click.
- *
- * Default value is `true`.
- */
- backdrop?: boolean | 'static';
-
- /**
- * Callback right before the modal will be dismissed.
- *
- * If this function returns:
- * * `false`
- * * a promise resolved with `false`
- * * a promise that is rejected
- *
- * then the modal won't be dismissed.
- */
- beforeDismiss?: () => boolean | Promise;
-
- /**
- * If `true`, the modal will be centered vertically.
- *
- * Default value is `false`.
- *
- * @since 1.1.0
- */
- centered?: boolean;
-
- /**
- * A selector specifying the element all new modal windows should be appended to.
- *
- * If not specified, will be `body`.
- */
- container?: string;
-
- /**
- * The `Injector` to use for modal content.
- */
- injector?: Injector;
-
- /**
- * If `true`, the modal will be closed when `Escape` key is pressed
- *
- * Default value is `true`.
- */
- keyboard?: boolean;
-
- /**
- * Scrollable modal content (false by default).
- *
- * @since 5.0.0
- */
- scrollable?: boolean;
-
- /**
- * Size of a new modal window.
- */
- size?: 'sm' | 'lg' | 'xl';
-
- /**
- * A custom class to append to the modal window.
- */
- windowClass?: string;
-
- /**
- * A custom class to append to the modal backdrop.
- *
- * @since 1.1.0
- */
- backdropClass?: string;
-}
-
-/**
- * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.
- *
- * You can inject this service, typically in your root component, and customize the values of its properties in
- * order to provide default values for all modals used in the application.
-*
-* @since 3.1.0
-*/
-@Injectable({providedIn: 'root'})
-export class NgbModalConfig implements NgbModalOptions {
- backdrop: boolean | 'static' = true;
- keyboard = true;
-}
diff --git a/backup/src/modal/modal-dismiss-reasons.ts b/backup/src/modal/modal-dismiss-reasons.ts
deleted file mode 100644
index e494fc3..0000000
--- a/backup/src/modal/modal-dismiss-reasons.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export enum ModalDismissReasons {
- BACKDROP_CLICK,
- ESC
-}
diff --git a/backup/src/modal/modal-ref.ts b/backup/src/modal/modal-ref.ts
deleted file mode 100644
index ced43a0..0000000
--- a/backup/src/modal/modal-ref.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-import {ComponentRef} from '@angular/core';
-
-import {NgbModalBackdrop} from './modal-backdrop';
-import {NgbModalWindow} from './modal-window';
-
-import {ContentRef} from '../util/popup';
-
-/**
- * A reference to the currently opened (active) modal.
- *
- * Instances of this class can be injected into your component passed as modal content.
- * So you can `.close()` or `.dismiss()` the modal window from your component.
- */
-export class NgbActiveModal {
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- */
- close(result?: any): void {}
-
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- */
- dismiss(reason?: any): void {}
-}
-
-/**
- * A reference to the newly opened modal returned by the `NgbModal.open()` method.
- */
-export class NgbModalRef {
- private _resolve: (result?: any) => void;
- private _reject: (reason?: any) => void;
-
- /**
- * The instance of a component used for the modal content.
- *
- * When a `TemplateRef` is used as the content, will return `undefined`.
- */
- get componentInstance(): any {
- if (this._contentRef.componentRef) {
- return this._contentRef.componentRef.instance;
- }
- }
-
- /**
- * The promise that is resolved when the modal is closed and rejected when the modal is dismissed.
- */
- result: Promise;
-
- constructor(
- private _windowCmptRef: ComponentRef, private _contentRef: ContentRef,
- private _backdropCmptRef?: ComponentRef, private _beforeDismiss?: Function) {
- _windowCmptRef.instance.dismissEvent.subscribe((reason: any) => { this.dismiss(reason); });
-
- this.result = new Promise((resolve, reject) => {
- this._resolve = resolve;
- this._reject = reject;
- });
- this.result.then(null, () => {});
- }
-
- /**
- * Closes the modal with an optional `result` value.
- *
- * The `NgbMobalRef.result` promise will be resolved with the provided value.
- */
- close(result?: any): void {
- if (this._windowCmptRef) {
- this._resolve(result);
- this._removeModalElements();
- }
- }
-
- private _dismiss(reason?: any) {
- this._reject(reason);
- this._removeModalElements();
- }
-
- /**
- * Dismisses the modal with an optional `reason` value.
- *
- * The `NgbModalRef.result` promise will be rejected with the provided value.
- */
- dismiss(reason?: any): void {
- if (this._windowCmptRef) {
- if (!this._beforeDismiss) {
- this._dismiss(reason);
- } else {
- const dismiss = this._beforeDismiss();
- if (dismiss && dismiss.then) {
- dismiss.then(
- result => {
- if (result !== false) {
- this._dismiss(reason);
- }
- },
- () => {});
- } else if (dismiss !== false) {
- this._dismiss(reason);
- }
- }
- }
- }
-
- private _removeModalElements() {
- const windowNativeEl = this._windowCmptRef.location.nativeElement;
- windowNativeEl.parentNode.removeChild(windowNativeEl);
- this._windowCmptRef.destroy();
-
- if (this._backdropCmptRef) {
- const backdropNativeEl = this._backdropCmptRef.location.nativeElement;
- backdropNativeEl.parentNode.removeChild(backdropNativeEl);
- this._backdropCmptRef.destroy();
- }
-
- if (this._contentRef && this._contentRef.viewRef) {
- this._contentRef.viewRef.destroy();
- }
-
- this._windowCmptRef = null;
- this._backdropCmptRef = null;
- this._contentRef = null;
- }
-}
diff --git a/backup/src/modal/modal-stack.ts b/backup/src/modal/modal-stack.ts
deleted file mode 100644
index 5cda3d2..0000000
--- a/backup/src/modal/modal-stack.ts
+++ /dev/null
@@ -1,223 +0,0 @@
-import {DOCUMENT} from '@angular/common';
-import {
- ApplicationRef,
- ComponentFactoryResolver,
- ComponentRef,
- Inject,
- Injectable,
- Injector,
- RendererFactory2,
- TemplateRef,
-} from '@angular/core';
-import {Subject} from 'rxjs';
-
-import {ngbFocusTrap} from '../util/focus-trap';
-import {ContentRef} from '../util/popup';
-import {ScrollBar} from '../util/scrollbar';
-import {isDefined, isString} from '../util/util';
-import {NgbModalBackdrop} from './modal-backdrop';
-import {NgbModalOptions} from './modal-config';
-import {NgbActiveModal, NgbModalRef} from './modal-ref';
-import {NgbModalWindow} from './modal-window';
-
-@Injectable({providedIn: 'root'})
-export class NgbModalStack {
- private _activeWindowCmptHasChanged = new Subject();
- private _ariaHiddenValues: Map = new Map();
- private _backdropAttributes = ['backdropClass'];
- private _modalRefs: NgbModalRef[] = [];
- private _windowAttributes =
- ['ariaLabelledBy', 'backdrop', 'centered', 'keyboard', 'scrollable', 'size', 'windowClass'];
- private _windowCmpts: ComponentRef[] = [];
-
- constructor(
- private _applicationRef: ApplicationRef, private _injector: Injector, @Inject(DOCUMENT) private _document: any,
- private _scrollBar: ScrollBar, private _rendererFactory: RendererFactory2) {
- // Trap focus on active WindowCmpt
- this._activeWindowCmptHasChanged.subscribe(() => {
- if (this._windowCmpts.length) {
- const activeWindowCmpt = this._windowCmpts[this._windowCmpts.length - 1];
- ngbFocusTrap(activeWindowCmpt.location.nativeElement, this._activeWindowCmptHasChanged);
- this._revertAriaHidden();
- this._setAriaHidden(activeWindowCmpt.location.nativeElement);
- }
- });
- }
-
- open(moduleCFR: ComponentFactoryResolver, contentInjector: Injector, content: any, options): NgbModalRef {
- const containerEl =
- isDefined(options.container) ? this._document.querySelector(options.container) : this._document.body;
- const renderer = this._rendererFactory.createRenderer(null, null);
-
- const revertPaddingForScrollBar = this._scrollBar.compensate();
- const removeBodyClass = () => {
- if (!this._modalRefs.length) {
- renderer.removeClass(this._document.body, 'modal-open');
- this._revertAriaHidden();
- }
- };
-
- if (!containerEl) {
- throw new Error(`The specified modal container "${options.container || 'body'}" was not found in the DOM.`);
- }
-
- const activeModal = new NgbActiveModal();
- const contentRef =
- this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal, options);
-
- let backdropCmptRef: ComponentRef =
- options.backdrop !== false ? this._attachBackdrop(moduleCFR, containerEl) : null;
- let windowCmptRef: ComponentRef