@blueprintjs/timezone
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment-timezone"),require("@blueprintjs/core"),require("react"),require("tslib"),require("classnames"),require("@blueprintjs/select")):"function"==typeof define&&define.amd?define(["moment-timezone","@blueprintjs/core","react","tslib","classnames","@blueprintjs/select"],t):"object"==typeof exports?exports.Timezone=t(require("moment-timezone"),require("@blueprintjs/core"),require("react"),require("tslib"),require("classnames"),require("@blueprintjs/select")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Timezone=t(e.moment,e.Blueprint.Core,e.React,e.window,e.classNames,e.Blueprint.Select))}(window,function(e,t,n,r,o,i){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=o},function(e,t){e.exports=i},function(e,t,n){e.exports=n(7)},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"TIMEZONE_PICKER",function(){return i}),n.d(r,"TIMEZONE_PICKER_POPOVER",function(){return s});var o=n(1),i=o.Classes.getClassNamespace()+"-timezone-picker",s=i+"-popover",a=r,u=n(0),l=/^[^-+]/;function c(e,t){void 0===t&&(t=new Date);var n=t.getTime(),r=u.tz.zone(e),o=u.tz(n,e),i=o.utcOffset(),s=o.format("Z"),a=r.abbr(n);return{abbreviation:l.test(a)?a:void 0,offset:i,offsetAsString:s,population:r.population,timezone:e}}var p=n(3),f=n(4),m=n.n(f),d=n(2),v=n(5),b={ABBREVIATION:"abbreviation",COMPOSITE:"composite",NAME:"name",OFFSET:"offset"};function h(e,t){var n=function(e){var t=u.tz.names().filter(function(e){return/\//.test(e)&&!/Etc\//.test(e)}),n=t.reduce(function(t,n){return t[n]=c(n,e),t},{}),r=t.reduce(function(e,t){var r=n[t],o=e[r.offsetAsString];return(null==o||r.population>n[o].population)&&(e[r.offsetAsString]=t),e},{});return Object.keys(r).map(function(e){return n[r[e]]}).sort(function(e,t){return e.offset-t.offset}).map(z)}(e),r=function(e){var t=u.tz.guess();if(void 0!==t){var n=e.getTime(),r=u.tz(n,t),o=r.format("Z");return{iconName:"locate",key:t+"-local",label:o,text:"Current timezone",timezone:t}}return}(e);return t&&void 0!==r?[r].concat(n):n}function z(e){var t=e.abbreviation,n=e.offsetAsString,r=e.timezone;return{key:r,label:n,text:r+(t?" ("+t+")":""),timezone:r}}var y=v.Select.ofType(),P=function(e){function t(t,n){var r=e.call(this,t,n)||this;r.filterItems=function(e,t){var n=new RegExp(e.replace(/([[()+*?])/g,"\\$1").replace(" ","[ _/\\(\\)]+"),"i");return t.filter(function(e){return n.test(e.text+e.label)})},r.renderItem=function(e,t){var n=t.handleClick,r=t.modifiers;return r.matchesPredicate?d.createElement(o.MenuItem,{key:e.key,active:r.active,icon:e.iconName,text:e.text,label:e.label,onClick:n,shouldDismissPopover:!1}):null},r.handleItemSelect=function(e){return o.Utils.safeInvoke(r.props.onChange,e.timezone)},r.handleQueryChange=function(e){return r.setState({query:e})};var i=t.date,s=void 0===i?new Date:i,a=t.showLocalTimezone,l=t.inputProps,p=void 0===l?{}:l;return r.state={query:p.value||""},r.timezoneItems=function(e){return u.tz.names().map(function(t){return c(t,e)}).sort(function(e,t){return e.offset-t.offset}).map(z)}(s),r.initialTimezoneItems=h(s,a),r}return p.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.children,n=e.className,r=e.disabled,a=e.inputProps,u=e.popoverProps,l=this.state.query,c=p.__assign({placeholder:"Search for timezones..."},a),f=p.__assign({},u,{popoverClassName:m()(s,u.popoverClassName)});return d.createElement(y,{className:m()(i,n),items:l?this.timezoneItems:this.initialTimezoneItems,itemListPredicate:this.filterItems,itemRenderer:this.renderItem,noResults:d.createElement(o.MenuItem,{disabled:!0,text:"No matching timezones."}),onItemSelect:this.handleItemSelect,resetOnSelect:!0,resetOnClose:!0,popoverProps:f,inputProps:c,disabled:r,onQueryChange:this.handleQueryChange},null!=t?t:this.renderButton())},t.prototype.componentWillReceiveProps=function(e){var t=e.date,n=void 0===t?new Date:t,r=e.inputProps,o=void 0===r?{}:r;this.props.showLocalTimezone!==e.showLocalTimezone&&(this.initialTimezoneItems=h(n,e.showLocalTimezone)),void 0!==o.value&&this.state.query!==o.value&&this.setState({query:o.value})},t.prototype.validateProps=function(e){d.Children.count(e.children)>1&&console.warn("[Blueprint] <TimezonePicker> supports up to one child; additional children are ignored. If a child is present, it it will be rendered in place of the default button target.")},t.prototype.renderButton=function(){var e=this.props,t=e.buttonProps,n=void 0===t?{}:t,r=e.date,i=e.disabled,s=e.placeholder,a=e.value,l=e.valueDisplayFormat,f=a?function(e,t,n){if(e&&u.tz.zone(e)){var r=c(e,t),o=r.abbreviation,i=r.offsetAsString;switch(n){case b.ABBREVIATION:return void 0!==o?o:i;case b.NAME:return e;case b.OFFSET:return i;case b.COMPOSITE:return e+(o?" ("+o+")":"")+" "+i}}}(a,r,l):d.createElement("span",{className:o.Classes.TEXT_MUTED},s);return d.createElement(o.Button,p.__assign({rightIcon:"caret-down",disabled:i,text:f},n))},t.displayName=o.DISPLAYNAME_PREFIX+".TimezonePicker",t.defaultProps={date:new Date,disabled:!1,inputProps:{},placeholder:"Select timezone...",popoverProps:{},showLocalTimezone:!0,valueDisplayFormat:b.OFFSET},t}(o.AbstractPureComponent);n.d(t,"Classes",function(){return a}),n.d(t,"getTimezoneMetadata",function(){return c}),n.d(t,"TimezoneDisplayFormat",function(){return b}),n.d(t,"TimezonePicker",function(){return P})}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("moment-timezone"),require("@blueprintjs/core"),require("react"),require("tslib"),require("classnames"),require("@blueprintjs/select")):"function"==typeof define&&define.amd?define(["moment-timezone","@blueprintjs/core","react","tslib","classnames","@blueprintjs/select"],t):"object"==typeof exports?exports.Timezone=t(require("moment-timezone"),require("@blueprintjs/core"),require("react"),require("tslib"),require("classnames"),require("@blueprintjs/select")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Timezone=t(e.moment,e.Blueprint.Core,e.React,e.window,e.classNames,e.Blueprint.Select))}(window,function(e,t,n,o,r,i){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=o},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t,n){e.exports=n(7)},function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"TIMEZONE_PICKER",function(){return i}),n.d(o,"TIMEZONE_PICKER_POPOVER",function(){return s});var r=n(1),i=r.Classes.getClassNamespace()+"-timezone-picker",s=i+"-popover",a=o,l=n(0),u=/^[^-+]/;function c(e,t){void 0===t&&(t=new Date);var n=t.getTime(),o=l.tz.zone(e),r=l.tz(n,e),i=r.utcOffset(),s=r.format("Z"),a=o.abbr(n);return{abbreviation:u.test(a)?a:void 0,offset:i,offsetAsString:s,population:o.population,timezone:e}}var p=n(3),f=n(4),m=n.n(f),d=n(2);function h(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function v(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function y(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function b(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,o=null,r=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?o="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(o="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?r="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(r="UNSAFE_componentWillUpdate"),null!==n||null!==o||null!==r){var i=e.displayName||e.name,s="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+i+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==o?"\n "+o:"")+(null!==r?"\n "+r:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=h,t.componentWillReceiveProps=v),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=y;var a=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;a.call(this,e,t,o)}}return e}h.__suppressDeprecationWarning=!0,v.__suppressDeprecationWarning=!0,y.__suppressDeprecationWarning=!0;var g=n(5),S={ABBREVIATION:"abbreviation",COMPOSITE:"composite",NAME:"name",OFFSET:"offset"};function P(e,t){var n=function(e){var t=l.tz.names().filter(function(e){return/\//.test(e)&&!/Etc\//.test(e)}),n=t.reduce(function(t,n){return t[n]=c(n,e),t},{}),o=t.reduce(function(e,t){var o=n[t],r=e[o.offsetAsString];return(null==r||o.population>n[r].population)&&(e[o.offsetAsString]=t),e},{});return Object.keys(o).map(function(e){return n[o[e]]}).sort(function(e,t){return e.offset-t.offset}).map(_)}(e),o=function(e){var t=l.tz.guess();if(void 0!==t){var n=e.getTime(),o=l.tz(n,t),r=o.format("Z");return{iconName:"locate",key:t+"-local",label:r,text:"Current timezone",timezone:t}}return}(e);return t&&void 0!==o?[o].concat(n):n}function _(e){var t=e.abbreviation,n=e.offsetAsString,o=e.timezone;return{key:o,label:n,text:o+(t?" ("+t+")":""),timezone:o}}var z=g.Select.ofType(),E=function(e){function t(t,n){var o=e.call(this,t,n)||this;o.filterItems=function(e,t){var n=new RegExp(e.replace(/([[()+*?])/g,"\\$1").replace(" ","[ _/\\(\\)]+"),"i");return t.filter(function(e){return n.test(e.text+e.label)})},o.renderItem=function(e,t){var n=t.handleClick,o=t.modifiers;return o.matchesPredicate?d.createElement(r.MenuItem,{key:e.key,active:o.active,icon:e.iconName,text:e.text,label:e.label,onClick:n,shouldDismissPopover:!1}):null},o.handleItemSelect=function(e){return r.Utils.safeInvoke(o.props.onChange,e.timezone)},o.handleQueryChange=function(e){return o.setState({query:e})};var i=t.date,s=void 0===i?new Date:i,a=t.showLocalTimezone,u=t.inputProps,p=void 0===u?{}:u;return o.state={query:p.value||""},o.timezoneItems=function(e){return l.tz.names().map(function(t){return c(t,e)}).sort(function(e,t){return e.offset-t.offset}).map(_)}(s),o.initialTimezoneItems=P(s,a),o}return p.__extends(t,e),t.prototype.render=function(){var e=this.props,t=e.children,n=e.className,o=e.disabled,a=e.inputProps,l=e.popoverProps,u=this.state.query,c=p.__assign({placeholder:"Search for timezones..."},a),f=p.__assign({},l,{popoverClassName:m()(s,l.popoverClassName)});return d.createElement(z,{className:m()(i,n),items:u?this.timezoneItems:this.initialTimezoneItems,itemListPredicate:this.filterItems,itemRenderer:this.renderItem,noResults:d.createElement(r.MenuItem,{disabled:!0,text:"No matching timezones."}),onItemSelect:this.handleItemSelect,resetOnSelect:!0,resetOnClose:!0,popoverProps:f,inputProps:c,disabled:o,onQueryChange:this.handleQueryChange},null!=t?t:this.renderButton())},t.prototype.componentDidUpdate=function(t,n,o){e.prototype.componentDidUpdate.call(this,t,n,o);var r=this.props,i=r.date,s=void 0===i?new Date:i,a=r.inputProps,l=void 0===a?{}:a;this.props.showLocalTimezone!==t.showLocalTimezone&&(this.initialTimezoneItems=P(s,this.props.showLocalTimezone)),void 0!==l.value&&this.state.query!==l.value&&this.setState({query:l.value})},t.prototype.validateProps=function(e){d.Children.count(e.children)>1&&console.warn("[Blueprint] <TimezonePicker> supports up to one child; additional children are ignored. If a child is present, it it will be rendered in place of the default button target.")},t.prototype.renderButton=function(){var e=this.props,t=e.buttonProps,n=void 0===t?{}:t,o=e.date,i=e.disabled,s=e.placeholder,a=e.value,u=e.valueDisplayFormat,f=a?function(e,t,n){if(e&&l.tz.zone(e)){var o=c(e,t),r=o.abbreviation,i=o.offsetAsString;switch(n){case S.ABBREVIATION:return void 0!==r?r:i;case S.NAME:return e;case S.OFFSET:return i;case S.COMPOSITE:return e+(r?" ("+r+")":"")+" "+i}}}(a,o,u):d.createElement("span",{className:r.Classes.TEXT_MUTED},s);return d.createElement(r.Button,p.__assign({rightIcon:"caret-down",disabled:i,text:f},n))},t.displayName=r.DISPLAYNAME_PREFIX+".TimezonePicker",t.defaultProps={date:new Date,disabled:!1,inputProps:{},placeholder:"Select timezone...",popoverProps:{},showLocalTimezone:!0,valueDisplayFormat:S.OFFSET},t=p.__decorate([b],t)}(r.AbstractPureComponent2);n.d(t,"Classes",function(){return a}),n.d(t,"getTimezoneMetadata",function(){return c}),n.d(t,"TimezoneDisplayFormat",function(){return S}),n.d(t,"TimezonePicker",function(){return E})}])}); |
import * as React from "react"; | ||
import { AbstractPureComponent, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { AbstractPureComponent2, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; | ||
@@ -62,3 +62,3 @@ export { TimezoneDisplayFormat }; | ||
} | ||
export declare class TimezonePicker extends AbstractPureComponent<ITimezonePickerProps, ITimezonePickerState> { | ||
export declare class TimezonePicker extends AbstractPureComponent2<ITimezonePickerProps, ITimezonePickerState> { | ||
static displayName: string; | ||
@@ -70,3 +70,3 @@ static defaultProps: Partial<ITimezonePickerProps>; | ||
render(): JSX.Element; | ||
componentWillReceiveProps(nextProps: ITimezonePickerProps): void; | ||
componentDidUpdate(prevProps: ITimezonePickerProps, prevState: ITimezonePickerState, snapshot?: {}): void; | ||
protected validateProps(props: IPopoverProps & { | ||
@@ -73,0 +73,0 @@ children?: React.ReactNode; |
@@ -21,2 +21,3 @@ "use strict"; | ||
var React = tslib_1.__importStar(require("react")); | ||
var react_lifecycles_compat_1 = require("react-lifecycles-compat"); | ||
var core_1 = require("@blueprintjs/core"); | ||
@@ -62,6 +63,7 @@ var select_1 = require("@blueprintjs/select"); | ||
}; | ||
TimezonePicker.prototype.componentWillReceiveProps = function (nextProps) { | ||
var _a = nextProps.date, nextDate = _a === void 0 ? new Date() : _a, _b = nextProps.inputProps, nextInputProps = _b === void 0 ? {} : _b; | ||
if (this.props.showLocalTimezone !== nextProps.showLocalTimezone) { | ||
this.initialTimezoneItems = timezoneItems_1.getInitialTimezoneItems(nextDate, nextProps.showLocalTimezone); | ||
TimezonePicker.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) { | ||
_super.prototype.componentDidUpdate.call(this, prevProps, prevState, snapshot); | ||
var _a = this.props, _b = _a.date, nextDate = _b === void 0 ? new Date() : _b, _c = _a.inputProps, nextInputProps = _c === void 0 ? {} : _c; | ||
if (this.props.showLocalTimezone !== prevProps.showLocalTimezone) { | ||
this.initialTimezoneItems = timezoneItems_1.getInitialTimezoneItems(nextDate, this.props.showLocalTimezone); | ||
} | ||
@@ -93,5 +95,8 @@ if (nextInputProps.value !== undefined && this.state.query !== nextInputProps.value) { | ||
}; | ||
TimezonePicker = tslib_1.__decorate([ | ||
react_lifecycles_compat_1.polyfill | ||
], TimezonePicker); | ||
return TimezonePicker; | ||
}(core_1.AbstractPureComponent)); | ||
}(core_1.AbstractPureComponent2)); | ||
exports.TimezonePicker = TimezonePicker; | ||
//# sourceMappingURL=timezonePicker.js.map |
import * as React from "react"; | ||
import { AbstractPureComponent, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { AbstractPureComponent2, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; | ||
@@ -62,3 +62,3 @@ export { TimezoneDisplayFormat }; | ||
} | ||
export declare class TimezonePicker extends AbstractPureComponent<ITimezonePickerProps, ITimezonePickerState> { | ||
export declare class TimezonePicker extends AbstractPureComponent2<ITimezonePickerProps, ITimezonePickerState> { | ||
static displayName: string; | ||
@@ -70,3 +70,3 @@ static defaultProps: Partial<ITimezonePickerProps>; | ||
render(): JSX.Element; | ||
componentWillReceiveProps(nextProps: ITimezonePickerProps): void; | ||
componentDidUpdate(prevProps: ITimezonePickerProps, prevState: ITimezonePickerState, snapshot?: {}): void; | ||
protected validateProps(props: IPopoverProps & { | ||
@@ -73,0 +73,0 @@ children?: React.ReactNode; |
@@ -19,3 +19,4 @@ /* | ||
import * as React from "react"; | ||
import { AbstractPureComponent, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, Utils, } from "@blueprintjs/core"; | ||
import { polyfill } from "react-lifecycles-compat"; | ||
import { AbstractPureComponent2, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, Utils, } from "@blueprintjs/core"; | ||
import { Select } from "@blueprintjs/select"; | ||
@@ -60,6 +61,7 @@ import * as Classes from "../../common/classes"; | ||
}; | ||
TimezonePicker.prototype.componentWillReceiveProps = function (nextProps) { | ||
var _a = nextProps.date, nextDate = _a === void 0 ? new Date() : _a, _b = nextProps.inputProps, nextInputProps = _b === void 0 ? {} : _b; | ||
if (this.props.showLocalTimezone !== nextProps.showLocalTimezone) { | ||
this.initialTimezoneItems = getInitialTimezoneItems(nextDate, nextProps.showLocalTimezone); | ||
TimezonePicker.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) { | ||
_super.prototype.componentDidUpdate.call(this, prevProps, prevState, snapshot); | ||
var _a = this.props, _b = _a.date, nextDate = _b === void 0 ? new Date() : _b, _c = _a.inputProps, nextInputProps = _c === void 0 ? {} : _c; | ||
if (this.props.showLocalTimezone !== prevProps.showLocalTimezone) { | ||
this.initialTimezoneItems = getInitialTimezoneItems(nextDate, this.props.showLocalTimezone); | ||
} | ||
@@ -91,5 +93,8 @@ if (nextInputProps.value !== undefined && this.state.query !== nextInputProps.value) { | ||
}; | ||
TimezonePicker = tslib_1.__decorate([ | ||
polyfill | ||
], TimezonePicker); | ||
return TimezonePicker; | ||
}(AbstractPureComponent)); | ||
}(AbstractPureComponent2)); | ||
export { TimezonePicker }; | ||
//# sourceMappingURL=timezonePicker.js.map |
import * as React from "react"; | ||
import { AbstractPureComponent, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { AbstractPureComponent2, HTMLInputProps, IButtonProps, IInputGroupProps, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; | ||
@@ -62,3 +62,3 @@ export { TimezoneDisplayFormat }; | ||
} | ||
export declare class TimezonePicker extends AbstractPureComponent<ITimezonePickerProps, ITimezonePickerState> { | ||
export declare class TimezonePicker extends AbstractPureComponent2<ITimezonePickerProps, ITimezonePickerState> { | ||
static displayName: string; | ||
@@ -70,3 +70,3 @@ static defaultProps: Partial<ITimezonePickerProps>; | ||
render(): JSX.Element; | ||
componentWillReceiveProps(nextProps: ITimezonePickerProps): void; | ||
componentDidUpdate(prevProps: ITimezonePickerProps, prevState: ITimezonePickerState, snapshot?: {}): void; | ||
protected validateProps(props: IPopoverProps & { | ||
@@ -73,0 +73,0 @@ children?: React.ReactNode; |
@@ -16,5 +16,7 @@ /* | ||
*/ | ||
import * as tslib_1 from "tslib"; | ||
import classNames from "classnames"; | ||
import * as React from "react"; | ||
import { AbstractPureComponent, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, Utils, } from "@blueprintjs/core"; | ||
import { polyfill } from "react-lifecycles-compat"; | ||
import { AbstractPureComponent2, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, Utils, } from "@blueprintjs/core"; | ||
import { Select } from "@blueprintjs/select"; | ||
@@ -27,3 +29,3 @@ import * as Classes from "../../common/classes"; | ||
const TypedSelect = Select.ofType(); | ||
export class TimezonePicker extends AbstractPureComponent { | ||
let TimezonePicker = class TimezonePicker extends AbstractPureComponent2 { | ||
constructor(props, context) { | ||
@@ -63,6 +65,7 @@ super(props, context); | ||
} | ||
componentWillReceiveProps(nextProps) { | ||
const { date: nextDate = new Date(), inputProps: nextInputProps = {} } = nextProps; | ||
if (this.props.showLocalTimezone !== nextProps.showLocalTimezone) { | ||
this.initialTimezoneItems = getInitialTimezoneItems(nextDate, nextProps.showLocalTimezone); | ||
componentDidUpdate(prevProps, prevState, snapshot) { | ||
super.componentDidUpdate(prevProps, prevState, snapshot); | ||
const { date: nextDate = new Date(), inputProps: nextInputProps = {} } = this.props; | ||
if (this.props.showLocalTimezone !== prevProps.showLocalTimezone) { | ||
this.initialTimezoneItems = getInitialTimezoneItems(nextDate, this.props.showLocalTimezone); | ||
} | ||
@@ -84,3 +87,3 @@ if (nextInputProps.value !== undefined && this.state.query !== nextInputProps.value) { | ||
} | ||
} | ||
}; | ||
TimezonePicker.displayName = `${DISPLAYNAME_PREFIX}.TimezonePicker`; | ||
@@ -96,2 +99,6 @@ TimezonePicker.defaultProps = { | ||
}; | ||
TimezonePicker = tslib_1.__decorate([ | ||
polyfill | ||
], TimezonePicker); | ||
export { TimezonePicker }; | ||
//# sourceMappingURL=timezonePicker.js.map |
{ | ||
"name": "@blueprintjs/timezone", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"description": "Components related to timezone selection and UI", | ||
@@ -38,4 +38,4 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@blueprintjs/core": "^3.18.0", | ||
"@blueprintjs/select": "^3.10.0", | ||
"@blueprintjs/core": "^3.19.0", | ||
"@blueprintjs/select": "^3.11.0", | ||
"classnames": "^2.2", | ||
@@ -42,0 +42,0 @@ "moment": "^2.24.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147140
2050
Updated@blueprintjs/core@^3.19.0
Updated@blueprintjs/select@^3.11.0