From 030121e8b394bb70fad7bd67638beb06a31ade45 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Thu, 15 Aug 2013 23:28:36 -0500 Subject: [PATCH] Update definition and tests for pickadate.js v3.2.0 --- jquery.pickadate/jquery.pickadate-tests.ts | 8 +++++++ jquery.pickadate/jquery.pickadate.d.ts | 26 +++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/jquery.pickadate/jquery.pickadate-tests.ts b/jquery.pickadate/jquery.pickadate-tests.ts index ac6a161c6..75ceafd47 100644 --- a/jquery.pickadate/jquery.pickadate-tests.ts +++ b/jquery.pickadate/jquery.pickadate-tests.ts @@ -99,6 +99,10 @@ $('.datepicker').pickadate({ ] }); +$('.datepicker').pickadate({ + container: '#root-outlet' +}); + $('.datepicker').pickadate({ onStart: function () { console.log('Hello there :)') @@ -189,6 +193,10 @@ $('.timepicker').pickatime({ ] }); +$('.timepicker').pickatime({ + container: '#root-outlet' +}); + $('.timepicker').pickatime({ onStart: function () { console.log('Hello there :)') diff --git a/jquery.pickadate/jquery.pickadate.d.ts b/jquery.pickadate/jquery.pickadate.d.ts index 03d2f943a..06c5ccdc9 100644 --- a/jquery.pickadate/jquery.pickadate.d.ts +++ b/jquery.pickadate/jquery.pickadate.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pickadate.js 3.0.5 +// Type definitions for pickadate.js 3.2.0 // Project: https://github.com/amsul/pickadate.js // Definitions by: Theodore Brown // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -37,6 +37,9 @@ interface pickadateOptions { // Disable dates disable?: any[]; // arrays formatted as [YEAR,MONTH,DATE] or integers representing days of the week (from 1 to 7). Switch to whitelist by setting first item in collection to `true`. + /** Specify where to insert the picker's root element by passing any valid CSS selector to this option */ + container?: any; + // Events onStart?: (event: any) => void; onRender?: (event: any) => void; @@ -125,6 +128,9 @@ interface pickatimeOptions { // Disable times disable?: any[]; // arrays formatted as [HOUR,MINUTE] or integers representing hours (from 0 to 23). Switch to whitelist by setting true as the first item in the collection. + /** Specify where to insert the picker's root element by passing any valid CSS selector to this option */ + container?: any; + // Events onStart?: (event: any) => void; onRender?: (event: any) => void; @@ -241,8 +247,13 @@ interface DatePickerObject extends PickerObject { /** Destroy the picker. */ stop(): DatePickerObject; - /** Refresh the picker after adding something to the holder. */ - render(): DatePickerObject; + /** + * Refresh the picker box after adding something to the holder. + * By default, only the "face" of the picker (i.e. the box element) + * has it’s contents re-rendered. To render the entire picker from + * the root up, pass true as the first argument. + */ + render(entirePicker?: boolean): DatePickerObject; /** Clear the value in the picker's input element. */ clear(): DatePickerObject; @@ -307,8 +318,13 @@ interface TimePickerObject extends PickerObject { /** Destroy the picker. */ stop(): TimePickerObject; - /** Refresh the picker after adding something to the holder. */ - render(): TimePickerObject; + /** + * Refresh the picker box after adding something to the holder. + * By default, only the "face" of the picker (i.e. the box element) + * has it’s contents re-rendered. To render the entire picker from + * the root up, pass true as the first argument. + */ + render(entirePicker?: boolean): TimePickerObject; /** Clear the value in the picker's input element. */ clear(): TimePickerObject;