@blueprintjs/timezone
Advanced tools
Comparing version 3.8.6 to 3.8.7
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("@blueprintjs/select"),require("classnames"),require("moment-timezone"),require("react"),require("tslib")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","@blueprintjs/select","classnames","moment-timezone","react","tslib"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("@blueprintjs/select"),require("classnames"),require("moment-timezone"),require("react"),require("tslib")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Timezone=t(e.Blueprint.Core,e.Blueprint.Select,e.classNames,e.moment,e.React,e.window))}(self,(function(e,t,n,o,r,i){return function(){"use strict";var s={165:function(e,t,n){n.r(t),n.d(t,{Classes:function(){return a},TimezoneDisplayFormat:function(){return P},TimezonePicker:function(){return T},getTimezoneMetadata:function(){return c}});var o={};n.r(o),n.d(o,{TIMEZONE_PICKER:function(){return i},TIMEZONE_PICKER_POPOVER:function(){return s}});var r=n(669),i=r.Classes.getClassNamespace()+"-timezone-picker",s=i+"-popover",a=o,l=n(285),p=n.n(l),u=/^[^-+]/;function c(e,t){void 0===t&&(t=new Date);var n=t.getTime(),o=p().tz.zone(e),r=p().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 f=n(770),m=n(957),d=n.n(m),h=n(888),v=n.n(h);function y(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function b(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function g(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 S(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=y,t.componentWillReceiveProps=b),"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=g;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}y.__suppressDeprecationWarning=!0,b.__suppressDeprecationWarning=!0,g.__suppressDeprecationWarning=!0;var _=n(388),P={ABBREVIATION:"abbreviation",COMPOSITE:"composite",NAME:"name",OFFSET:"offset"};function z(e,t){var n=function(e){var t=p().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)}(e),o=function(e){var t=p().tz.guess();if(void 0!==t){var n=e.getTime();return{iconName:"locate",key:t+"-local",label:p().tz(n,t).format("Z"),text:"Current timezone",timezone:t}}}(e);return t&&void 0!==o?(0,f.__spreadArrays)([o],n):n}function E(e){var t=e.abbreviation,n=e.offsetAsString,o=e.timezone;return{key:o,label:n,text:o+(t?" ("+t+")":""),timezone:o}}var I=_.Select.ofType(),T=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?v().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){var t,n;return null===(n=(t=o.props).onChange)||void 0===n?void 0:n.call(t,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,l=t.inputProps,u=void 0===l?{}:l;return o.state={query:u.value||""},o.timezoneItems=function(e){return p().tz.names().map((function(t){return c(t,e)})).sort((function(e,t){return e.offset-t.offset})).map(E)}(s),o.initialTimezoneItems=z(s,a),o}return(0,f.__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,p=this.state.query,u=(0,f.__assign)({placeholder:"Search for timezones..."},a),c=(0,f.__assign)((0,f.__assign)({},l),{popoverClassName:d()(s,l.popoverClassName)});return v().createElement(I,{className:d()(i,n),items:p?this.timezoneItems:this.initialTimezoneItems,itemListPredicate:this.filterItems,itemRenderer:this.renderItem,noResults:v().createElement(r.MenuItem,{disabled:!0,text:"No matching timezones."}),onItemSelect:this.handleItemSelect,resetOnSelect:!0,resetOnClose:!0,popoverProps:c,inputProps:u,disabled:o,onQueryChange:this.handleQueryChange},null!=t?t:this.renderButton())},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n);var o=this.props,r=o.date,i=void 0===r?new Date:r,s=o.inputProps,a=void 0===s?{}:s;this.props.showLocalTimezone!==t.showLocalTimezone&&(this.initialTimezoneItems=z(i,this.props.showLocalTimezone)),void 0!==a.value&&this.state.query!==a.value&&this.setState({query:a.value})},t.prototype.validateProps=function(e){v().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,l=e.valueDisplayFormat,u=a?function(e,t,n){if(e&&p().tz.zone(e)){var o=c(e,t),r=o.abbreviation,i=o.offsetAsString;switch(n){case P.ABBREVIATION:return void 0!==r?r:i;case P.NAME:return e;case P.OFFSET:return i;case P.COMPOSITE:return e+(r?" ("+r+")":"")+" "+i}}}(a,o,l):v().createElement("span",{className:r.Classes.TEXT_MUTED},s);return v().createElement(r.Button,(0,f.__assign)({rightIcon:"caret-down",disabled:i,text:u},n))},t.displayName=r.DISPLAYNAME_PREFIX+".TimezonePicker",t.defaultProps={date:new Date,disabled:!1,inputProps:{},placeholder:"Select timezone...",popoverProps:{},showLocalTimezone:!0,valueDisplayFormat:P.OFFSET},(0,f.__decorate)([S],t)}(r.AbstractPureComponent2)},669:function(t){t.exports=e},388:function(e){e.exports=t},957:function(e){e.exports=n},285:function(e){e.exports=o},888:function(e){e.exports=r},770:function(e){e.exports=i}},a={};function l(e){if(a[e])return a[e].exports;var t=a[e]={exports:{}};return s[e](t,t.exports,l),t.exports}return l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(165)}()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("@blueprintjs/select"),require("classnames"),require("moment-timezone"),require("react"),require("tslib")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","@blueprintjs/select","classnames","moment-timezone","react","tslib"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("@blueprintjs/select"),require("classnames"),require("moment-timezone"),require("react"),require("tslib")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Timezone=t(e.Blueprint.Core,e.Blueprint.Select,e.classNames,e.moment,e.React,e.window))}(self,(function(e,t,n,o,r,i){return function(){"use strict";var s={165:function(e,t,n){n.r(t),n.d(t,{Classes:function(){return a},TimezoneDisplayFormat:function(){return S},TimezonePicker:function(){return E},getTimezoneMetadata:function(){return u}});var o={};n.r(o),n.d(o,{TIMEZONE_PICKER:function(){return i},TIMEZONE_PICKER_POPOVER:function(){return s}});var r=n(669),i=r.Classes.getClassNamespace()+"-timezone-picker",s=i+"-popover",a=o,l=n(285),p=/^[^-+]/;function u(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:p.test(a)?a:void 0,offset:i,offsetAsString:s,population:o.population,timezone:e}}var c=n(770),f=n(957),m=n.n(f),d=n(888);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(388),S={ABBREVIATION:"abbreviation",COMPOSITE:"composite",NAME:"name",OFFSET:"offset"};function _(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]=u(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(P)}(e),o=function(e){var t=l.tz.guess();if(void 0!==t){var n=e.getTime();return{iconName:"locate",key:t+"-local",label:l.tz(n,t).format("Z"),text:"Current timezone",timezone:t}}}(e);return t&&void 0!==o?(0,c.__spreadArrays)([o],n):n}function P(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){var t,n;return null===(n=(t=o.props).onChange)||void 0===n?void 0:n.call(t,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,p=t.inputProps,c=void 0===p?{}:p;return o.state={query:c.value||""},o.timezoneItems=function(e){return l.tz.names().map((function(t){return u(t,e)})).sort((function(e,t){return e.offset-t.offset})).map(P)}(s),o.initialTimezoneItems=_(s,a),o}return(0,c.__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,p=this.state.query,u=(0,c.__assign)({placeholder:"Search for timezones..."},a),f=(0,c.__assign)((0,c.__assign)({},l),{popoverClassName:m()(s,l.popoverClassName)});return d.createElement(z,{className:m()(i,n),items:p?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:u,disabled:o,onQueryChange:this.handleQueryChange},null!=t?t:this.renderButton())},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n);var o=this.props,r=o.date,i=void 0===r?new Date:r,s=o.inputProps,a=void 0===s?{}:s;this.props.showLocalTimezone!==t.showLocalTimezone&&(this.initialTimezoneItems=_(i,this.props.showLocalTimezone)),void 0!==a.value&&this.state.query!==a.value&&this.setState({query:a.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,p=e.valueDisplayFormat,f=a?function(e,t,n){if(e&&l.tz.zone(e)){var o=u(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,p):d.createElement("span",{className:r.Classes.TEXT_MUTED},s);return d.createElement(r.Button,(0,c.__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},(0,c.__decorate)([b],t)}(r.AbstractPureComponent2)},669:function(t){t.exports=e},388:function(e){e.exports=t},957:function(e){e.exports=n},285:function(e){e.exports=o},888:function(e){e.exports=r},770:function(e){e.exports=i}},a={};function l(e){if(a[e])return a[e].exports;var t=a[e]={exports:{}};return s[e](t,t.exports,l),t.exports}return l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l(165)}()})); |
@@ -20,3 +20,3 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var moment_timezone_1 = tslib_1.__importDefault(require("moment-timezone")); | ||
var moment = tslib_1.__importStar(require("moment-timezone")); | ||
var timezoneMetadata_1 = require("./timezoneMetadata"); | ||
@@ -35,3 +35,3 @@ // eslint-disable-next-line @typescript-eslint/no-redeclare | ||
function formatTimezone(timezone, date, displayFormat) { | ||
if (!timezone || !moment_timezone_1.default.tz.zone(timezone)) { | ||
if (!timezone || !moment.tz.zone(timezone)) { | ||
return undefined; | ||
@@ -38,0 +38,0 @@ } |
@@ -20,3 +20,3 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var moment_timezone_1 = tslib_1.__importDefault(require("moment-timezone")); | ||
var moment = tslib_1.__importStar(require("moment-timezone")); | ||
var timezoneMetadata_1 = require("./timezoneMetadata"); | ||
@@ -29,3 +29,3 @@ /** | ||
function getTimezoneItems(date) { | ||
return moment_timezone_1.default.tz | ||
return moment.tz | ||
.names() | ||
@@ -57,6 +57,6 @@ .map(function (timezone) { return timezoneMetadata_1.getTimezoneMetadata(timezone, date); }) | ||
function getLocalTimezoneItem(date) { | ||
var timezone = moment_timezone_1.default.tz.guess(); | ||
var timezone = moment.tz.guess(); | ||
if (timezone !== undefined) { | ||
var timestamp = date.getTime(); | ||
var zonedDate = moment_timezone_1.default.tz(timestamp, timezone); | ||
var zonedDate = moment.tz(timestamp, timezone); | ||
var offsetAsString = zonedDate.format("Z"); | ||
@@ -84,3 +84,3 @@ return { | ||
// Filter out noisy timezones. See https://github.com/moment/moment-timezone/issues/227 | ||
var timezones = moment_timezone_1.default.tz.names().filter(function (timezone) { return /\//.test(timezone) && !/Etc\//.test(timezone); }); | ||
var timezones = moment.tz.names().filter(function (timezone) { return /\//.test(timezone) && !/Etc\//.test(timezone); }); | ||
var timezoneToMetadata = timezones.reduce(function (store, zone) { | ||
@@ -87,0 +87,0 @@ store[zone] = timezoneMetadata_1.getTimezoneMetadata(zone, date); |
@@ -20,3 +20,3 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var moment_timezone_1 = tslib_1.__importDefault(require("moment-timezone")); | ||
var moment = tslib_1.__importStar(require("moment-timezone")); | ||
// non-empty abbreviations that do not begin with -/+ | ||
@@ -27,4 +27,4 @@ var ABBR_REGEX = /^[^-+]/; | ||
var timestamp = date.getTime(); | ||
var zone = moment_timezone_1.default.tz.zone(timezone); | ||
var zonedDate = moment_timezone_1.default.tz(timestamp, timezone); | ||
var zone = moment.tz.zone(timezone); | ||
var zonedDate = moment.tz(timestamp, timezone); | ||
var offset = zonedDate.utcOffset(); | ||
@@ -31,0 +31,0 @@ var offsetAsString = zonedDate.format("Z"); |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { AbstractPureComponent2, IButtonProps, IInputGroupProps2, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
@@ -3,0 +3,0 @@ import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; |
@@ -21,3 +21,3 @@ "use strict"; | ||
var classnames_1 = tslib_1.__importDefault(require("classnames")); | ||
var react_1 = tslib_1.__importDefault(require("react")); | ||
var React = tslib_1.__importStar(require("react")); | ||
var react_lifecycles_compat_1 = require("react-lifecycles-compat"); | ||
@@ -47,3 +47,3 @@ var core_1 = require("@blueprintjs/core"); | ||
} | ||
return (react_1.default.createElement(core_1.MenuItem, { key: item.key, active: modifiers.active, icon: item.iconName, text: item.text, label: item.label, onClick: handleClick, shouldDismissPopover: false })); | ||
return (React.createElement(core_1.MenuItem, { key: item.key, active: modifiers.active, icon: item.iconName, text: item.text, label: item.label, onClick: handleClick, shouldDismissPopover: false })); | ||
}; | ||
@@ -63,3 +63,3 @@ _this.handleItemSelect = function (timezone) { var _a, _b; return (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, timezone.timezone); }; | ||
var finalPopoverProps = tslib_1.__assign(tslib_1.__assign({}, popoverProps), { popoverClassName: classnames_1.default(Classes.TIMEZONE_PICKER_POPOVER, popoverProps.popoverClassName) }); | ||
return (react_1.default.createElement(TypedSelect, { className: classnames_1.default(Classes.TIMEZONE_PICKER, className), items: query ? this.timezoneItems : this.initialTimezoneItems, itemListPredicate: this.filterItems, itemRenderer: this.renderItem, noResults: react_1.default.createElement(core_1.MenuItem, { disabled: true, text: "No matching timezones." }), onItemSelect: this.handleItemSelect, resetOnSelect: true, resetOnClose: true, popoverProps: finalPopoverProps, inputProps: finalInputProps, disabled: disabled, onQueryChange: this.handleQueryChange }, children != null ? children : this.renderButton())); | ||
return (React.createElement(TypedSelect, { className: classnames_1.default(Classes.TIMEZONE_PICKER, className), items: query ? this.timezoneItems : this.initialTimezoneItems, itemListPredicate: this.filterItems, itemRenderer: this.renderItem, noResults: React.createElement(core_1.MenuItem, { disabled: true, text: "No matching timezones." }), onItemSelect: this.handleItemSelect, resetOnSelect: true, resetOnClose: true, popoverProps: finalPopoverProps, inputProps: finalInputProps, disabled: disabled, onQueryChange: this.handleQueryChange }, children != null ? children : this.renderButton())); | ||
}; | ||
@@ -77,3 +77,3 @@ TimezonePicker.prototype.componentDidUpdate = function (prevProps, prevState) { | ||
TimezonePicker.prototype.validateProps = function (props) { | ||
var childrenCount = react_1.default.Children.count(props.children); | ||
var childrenCount = React.Children.count(props.children); | ||
if (childrenCount > 1) { | ||
@@ -85,4 +85,4 @@ console.warn(Errors.TIMEZONE_PICKER_WARN_TOO_MANY_CHILDREN); | ||
var _a = this.props, _b = _a.buttonProps, buttonProps = _b === void 0 ? {} : _b, date = _a.date, disabled = _a.disabled, placeholder = _a.placeholder, value = _a.value, valueDisplayFormat = _a.valueDisplayFormat; | ||
var buttonContent = value ? (timezoneDisplayFormat_1.formatTimezone(value, date, valueDisplayFormat)) : (react_1.default.createElement("span", { className: core_1.Classes.TEXT_MUTED }, placeholder)); | ||
return react_1.default.createElement(core_1.Button, tslib_1.__assign({ rightIcon: "caret-down", disabled: disabled, text: buttonContent }, buttonProps)); | ||
var buttonContent = value ? (timezoneDisplayFormat_1.formatTimezone(value, date, valueDisplayFormat)) : (React.createElement("span", { className: core_1.Classes.TEXT_MUTED }, placeholder)); | ||
return React.createElement(core_1.Button, tslib_1.__assign({ rightIcon: "caret-down", disabled: disabled, text: buttonContent }, buttonProps)); | ||
}; | ||
@@ -89,0 +89,0 @@ TimezonePicker.displayName = core_1.DISPLAYNAME_PREFIX + ".TimezonePicker"; |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
import { getTimezoneMetadata } from "./timezoneMetadata"; | ||
@@ -19,0 +19,0 @@ // eslint-disable-next-line @typescript-eslint/no-redeclare |
@@ -17,3 +17,3 @@ /* | ||
import { __spreadArrays } from "tslib"; | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
import { getTimezoneMetadata } from "./timezoneMetadata"; | ||
@@ -20,0 +20,0 @@ /** |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
// non-empty abbreviations that do not begin with -/+ | ||
@@ -19,0 +19,0 @@ var ABBR_REGEX = /^[^-+]/; |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { AbstractPureComponent2, IButtonProps, IInputGroupProps2, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
@@ -3,0 +3,0 @@ import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; |
@@ -18,3 +18,3 @@ /* | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { polyfill } from "react-lifecycles-compat"; | ||
@@ -21,0 +21,0 @@ import { AbstractPureComponent2, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, } from "@blueprintjs/core"; |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
import { getTimezoneMetadata } from "./timezoneMetadata"; | ||
@@ -19,0 +19,0 @@ // eslint-disable-next-line @typescript-eslint/no-redeclare |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
import { getTimezoneMetadata } from "./timezoneMetadata"; | ||
@@ -19,0 +19,0 @@ /** |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
// non-empty abbreviations that do not begin with -/+ | ||
@@ -19,0 +19,0 @@ const ABBR_REGEX = /^[^-+]/; |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { AbstractPureComponent2, IButtonProps, IInputGroupProps2, IPopoverProps, IProps } from "@blueprintjs/core"; | ||
@@ -3,0 +3,0 @@ import { TimezoneDisplayFormat } from "./timezoneDisplayFormat"; |
@@ -18,3 +18,3 @@ /* | ||
import classNames from "classnames"; | ||
import React from "react"; | ||
import * as React from "react"; | ||
import { polyfill } from "react-lifecycles-compat"; | ||
@@ -21,0 +21,0 @@ import { AbstractPureComponent2, Button, Classes as CoreClasses, DISPLAYNAME_PREFIX, MenuItem, } from "@blueprintjs/core"; |
{ | ||
"name": "@blueprintjs/timezone", | ||
"version": "3.8.6", | ||
"version": "3.8.7", | ||
"description": "Components related to timezone selection and UI", | ||
@@ -38,4 +38,4 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@blueprintjs/core": "^3.40.0", | ||
"@blueprintjs/select": "^3.15.6", | ||
"@blueprintjs/core": "^3.40.1", | ||
"@blueprintjs/select": "^3.15.7", | ||
"classnames": "^2.2", | ||
@@ -53,3 +53,3 @@ "moment": "^2.29.0", | ||
"@blueprintjs/node-build-scripts": "^1.5.0", | ||
"@blueprintjs/test-commons": "^0.10.9", | ||
"@blueprintjs/test-commons": "^0.10.10", | ||
"enzyme": "^3.11.0", | ||
@@ -56,0 +56,0 @@ "karma": "^5.2.3", |
@@ -17,3 +17,3 @@ /* | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
@@ -20,0 +20,0 @@ import { getTimezoneMetadata } from "./timezoneMetadata"; |
@@ -17,3 +17,3 @@ /* | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
@@ -20,0 +20,0 @@ import { IconName } from "@blueprintjs/core"; |
@@ -17,3 +17,3 @@ /* | ||
import moment from "moment-timezone"; | ||
import * as moment from "moment-timezone"; | ||
@@ -20,0 +20,0 @@ // non-empty abbreviations that do not begin with -/+ |
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
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
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
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
148296
Updated@blueprintjs/core@^3.40.1
Updated@blueprintjs/select@^3.15.7