UNPKG

@geoblink/design-system

Version:

Geoblink Design System for Vue.js

1 lines 8.31 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],t):"object"==typeof exports?exports["components/GeoCalendarMonthGridQuarterUnit"]=t(require("lodash")):e["components/GeoCalendarMonthGridQuarterUnit"]=t(e.lodash)}(window,function(e){return n={},t.m=r={"/Tr7":function(e,t,r){"use strict";function n(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}r.d(t,"a",function(){return n})},28:function(e,t,r){e.exports=r("Lk1a")},"2Ktv":function(e,t,r){"use strict";t.a={props:{currentMonth:{type:Number,required:!0,validator:function(e){return 0<=e&&e<=11}},currentYear:{type:Number,required:!0},earliestDate:{type:Date,required:!1},latestDate:{type:Date,required:!1},locale:{type:Object,required:!1}}}},"9ig3":function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r("/Tr7");function o(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e);return t.setDate(1),t.setHours(0,0,0,0),t}},"KHd+":function(e,t,r){"use strict";function n(e,t,r,n,o,a,i,u){var c,s="function"==typeof e?e.options:e;if(t&&(s.render=t,s.staticRenderFns=r,s._compiled=!0),n&&(s.functional=!0),a&&(s._scopeId="data-v-"+a),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},s._ssrRegister=c):o&&(c=u?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(s.functional){s._injectStyles=c;var l=s.render;s.render=function(e,t){return c.call(t),l(e,t)}}else{var d=s.beforeCreate;s.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:s}}r.d(t,"a",function(){return n})},Lk1a:function(e,t,r){"use strict";r.r(t);var n=r("YLtl"),o=r.n(n),a=r("d60l"),i=r("XAIm"),u=r("qSxj"),c=r("2Ktv"),s=r("9ig3"),l={name:"GeoCalendarMonthGridQuarterUnit",internal:!0,mixins:[i.a,u.a,c.a],props:{quarter:{type:Array,required:!0}},computed:{isSomeMonthInQuarterUnavailable:function(){var e=this;return o.a.reduce(this.quarter,function(t,r){return t||e.isMonthUnavailable(r.index)},!1)},canQuarterBeHighlighted:function(){return this.granularityId===a.GRANULARITY_IDS.quarter}},methods:{isMonthUnavailable:function(e){return Object(a.isBefore)(new Date(this.currentYear,e),Object(s.a)(this.earliestDate))||Object(a.isAfter)(new Date(this.currentYear,e),this.latestDate)},selectMonth:function(e){this.isMonthUnavailable(e)||(this.granularityId===a.GRANULARITY_IDS.month?this.$emit("select-month",e):this.$emit("select-quarter",e))},emitMonthUnitMouseover:function(e){this.$emit("month-unit-mouseover",e)}}},d=r("KHd+"),f=Object(d.a)(l,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{class:{"geo-calendar-grid__quarter-unit":!0,"geo-calendar-grid__quarter-unit--actionable":e.canQuarterBeHighlighted,"geo-calendar-grid__quarter-unit--unavailable":e.canQuarterBeHighlighted&&e.isSomeMonthInQuarterUnavailable}},e._l(e.quarter,function(t){return r("geo-calendar-month-grid-month-unit",{key:t.index,attrs:{"current-month":e.currentMonth,"current-year":e.currentYear,"earliest-date":e.earliestDate,"granularity-id":e.granularityId,"latest-date":e.latestDate,"month-name":t.name,"month-index":t.index,"selected-from-day":e.selectedFromDay,"selected-to-day":e.selectedToDay},on:{"select-month-unit":function(t){return e.selectMonth(t)},"month-unit-mouseover":function(t){return e.emitMonthUnitMouseover(t)}}})}),1)},[],!1,null,null,null);t.default=f.exports},M34a:function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r("/Tr7");function o(e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var t=Object(n.a)(e);return t.setHours(0,0,0,0),t}},XAIm:function(e,t,r){"use strict";t.a={props:{selectedFromDay:{type:Date,required:!1},selectedToDay:{type:Date,required:!1}}}},YLtl:function(t,r){t.exports=e},d60l:function(e,t,r){"use strict";r.r(t),r.d(t,"PICKER_DATE_UNITS",function(){return a}),r.d(t,"GRANULARITY_IDS",function(){return i}),r.d(t,"YEAR_GRID_CONSTANTS",function(){return u}),r.d(t,"DAY_GRID_CONSTANTS",function(){return c}),r.d(t,"MONTH_GRID_CONSTANTS",function(){return s}),r.d(t,"FOCUSABLE_INPUT_FIELDS",function(){return l}),r.d(t,"isDayUnavailable",function(){return d}),r.d(t,"isBefore",function(){return f}),r.d(t,"isAfter",function(){return p}),r.d(t,"isEqual",function(){return h}),r.d(t,"isWithinInterval",function(){return m});var n=r("/Tr7"),o=r("M34a"),a={day:"day",month:"month",year:"year"},i={day:"day",week:"week",month:"month",quarter:"quarter",year:"year"},u={MAX_YEAR:2099,MIN_YEAR:1970,YEARS_IN_GRID:16},c={TOTAL_DAYS_IN_WEEK:7,MONDAY_INDEX_IN_WEEK:1},s={NUMBER_OF_MONTHS_IN_GREGORIAN_CALENDAR:12},l={FROM_DATE:"FROM_DATE",TO_DATE:"TO_DATE"},d=function(e,t){return f(t,e.earliestDate)||p(t,e.latestDate)},f=function(e,t){return function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),o=Object(n.a)(t);return r.getTime()<o.getTime()}(Object(o.a)(e),Object(o.a)(t))},p=function(e,t){return function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),o=Object(n.a)(t);return r.getTime()>o.getTime()}(Object(o.a)(e),Object(o.a)(t))},h=function(e,t){return function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=Object(n.a)(e),o=Object(n.a)(t);return r.getTime()===o.getTime()}(Object(o.a)(e),Object(o.a)(t))},m=function(e,t){var r=t.start,a=t.end;return function(e,t){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=t||{},o=Object(n.a)(e).getTime(),a=Object(n.a)(r.start).getTime(),i=Object(n.a)(r.end).getTime();if(!(a<=i))throw new RangeError("Invalid interval");return a<=o&&o<=i}(Object(o.a)(e),{start:Object(o.a)(r),end:Object(o.a)(a)})}},i4Qp:function(e,t,r){"use strict";function n(e){var t={type:String,validator:function(t){if(e.checkUndefined&&void 0===t)return!0;var r=Object.values(e.enumDictionary);if(r.includes(t))return!0;var n=r.map(function(e){return"«".concat(e,"»")}).join(", ");return console.warn("".concat(e.componentName," [component] :: Unsupported value («").concat(t,"») for «").concat(e.propertyName,"» property. Use one of ").concat(n)),!1}};return"defaultValue"in e&&(t.default=e.defaultValue),"required"in e&&(t.required=!!e.required),t}r.d(t,"a",function(){return n})},qSxj:function(e,t,r){"use strict";var n=r("d60l"),o=r("i4Qp");t.a={props:{granularityId:Object(o.a)({componentName:"GeoCalendarGranularityId",propertyName:"granularityId",enumDictionary:n.GRANULARITY_IDS,required:!0})}}}},t.c=n,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(t){return e[t]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=28);function t(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return r[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r,n});