openstack-uicore-foundation 4.0.99 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/clock.js +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/inputs/access-levels-input.js +1 -1
- package/lib/components/inputs/company-input.js +1 -1
- package/lib/components/inputs/country-dropdown.js +1 -1
- package/lib/components/inputs/country-input.js +1 -1
- package/lib/components/inputs/event-input.js +1 -1
- package/lib/components/inputs/group-input.js +1 -1
- package/lib/components/inputs/language-input.js +1 -1
- package/lib/components/inputs/member-input.js +1 -1
- package/lib/components/inputs/organization-input.js +1 -1
- package/lib/components/inputs/promocode-input.js +1 -1
- package/lib/components/inputs/registration-company-input.js +1 -1
- package/lib/components/inputs/speaker-input.js +1 -1
- package/lib/components/inputs/sponsor-input.js +1 -1
- package/lib/components/inputs/summit-input.js +1 -1
- package/lib/components/inputs/tag-input.js +1 -1
- package/lib/components/inputs/ticket-types-input.js +1 -1
- package/lib/components/sponsored-project-input.js +1 -1
- package/lib/components/table-sortable.js +1 -1
- package/lib/utils/query-actions.js +1 -1
- package/package.json +1 -1
package/lib/components/clock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={1186:(e,t,i)=>{i.d(t,{default:()=>
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={1186:(e,t,i)=>{i.d(t,{default:()=>n});var s=i(8779),r=i.n(s);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}class n{constructor(){this.originalHash="",this.hash={}}convertToHash(e){let t=(e=e.substr(1).toLowerCase()).split("&"),i={};for(let e of t){if(e=e.split("="),2!==e.length)continue;let t=e[1].trim();""!==t&&("true"!==t&&"false"!==t||(e[1]="true"==t),i[e[0]]=e[1])}return i}clearParams(){this.originalHash="",this.hash={}}getParam(e){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),this.hash.hasOwnProperty(e)?this.hash[e]:null}getParams(){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){r()(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},this.hash)}deleteParam(e){var t=this.getParams();this.clearParams();for(let i in t)i!=e&&(this.hash[i]=t[i])}deleteParams(e){var t=this.getParams();this.clearParams();for(let i in t)e.includes(i)||(this.hash[i]=t[i])}setParam(e,t){return"undefined"!=typeof window&&this.originalHash!==window.location.hash&&(this.originalHash=window.location.hash,this.hash=this.convertToHash(this.originalHash)),null!==t&&""!==t?this.hash[e]=t:delete this.hash[e],this}serialize(){let e="";for(let t in this.hash){""!==e&&(e+="&"),e+=t+"="+this.hash[t]}return e}}},6793:(e,t,i)=>{i.d(t,{getTimeServiceUrl:()=>s});i(8362),i(6530);const s=()=>"undefined"!=typeof window?window.TIMEINTERVALSINCE1970_API_URL||process.env.TIMEINTERVALSINCE1970_API_URL:null},8779:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},8362:e=>{e.exports=require("moment-timezone")},6689:e=>{e.exports=require("react")},6530:e=>{e.exports=require("urijs")}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,i),o.exports}(()=>{i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t}})(),(()=>{i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};return(()=>{i.r(s),i.d(s,{default:()=>p});var e=i(8779),t=i.n(e),r=i(6689),o=i.n(r),n=i(8362),a=i.n(n),h=i(1186),l=i(6793);class c extends o().Component{constructor(e){super(e),t()(this,"processServerTimeResponse",((e,t)=>{const i=a()().unix();let s=i;e&&(s=e.timestamp+(i-t)),this._isMounted&&(console.log(`Clock::processServerTimeResponse setting timestamp ${s}`),this.setState({timestamp:s})),this.props.onTick&&this.props.onTick(s)})),t()(this,"processServerTimeResponseError",(()=>{let e=a()().unix();this._isMounted&&(console.log(`Clock::processServerTimeResponseError setting timestamp ${e}`),this.setState({timestamp:e})),this.props.onTick&&this.props.onTick(e)})),t()(this,"getServerTime",(()=>{const e=(0,l.getTimeServiceUrl)();return fetch(`${e}`).then((async e=>200===e.status?e.json():Promise.reject(null))).catch((e=>(console.log(e),Promise.reject(e))))})),t()(this,"tick",(()=>{const{timestamp:e}=this.state;null!==e&&(this.props.onTick&&this.props.onTick(e+1),this._isMounted&&this.setState({timestamp:e+1}))})),t()(this,"now",(()=>this.state.timestamp)),this.fragmentParser=new h.default,this.interval=null,this.state={timestamp:null},this._isMounted=!1,this.onVisibilityChange=this.onVisibilityChange.bind(this)}componentDidMount(){this._isMounted=!0;const{timezone:e="UTC",now:t}=this.props,i=this.fragmentParser.getParam("now"),s=a().tz(i,"YYYY-MM-DD,hh:mm:ss",e);let r=null;if(s.isValid())r=s.valueOf()/1e3;else if(t)r=t;else{const e=a()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}r&&(this.setState({timestamp:r}),this.props.onTick&&this.props.onTick(r)),this.interval=setInterval(this.tick,1e3),document.addEventListener("visibilitychange",this.onVisibilityChange,!1)}onVisibilityChange(){if("visible"===document.visibilityState){console.log("Clock::onVisibilityChange");const e=a()().unix();this.getServerTime().then((t=>this.processServerTimeResponse(t,e))).catch((()=>this.processServerTimeResponseError()))}}componentWillUnmount(){this._isMounted=!1,clearInterval(this.interval),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.interval=null}render(){const{display:e,timezone:t="UTC"}=this.props,{timestamp:i}=this.state;return e&&i?o().createElement("div",{style:{marginTop:"50px",textAlign:"center",fontSize:"20px"}},a().tz(1e3*i,t).format("YYYY-MM-DD hh:mm:ss")):null}}const p=c})(),s})()));
|