@nextgis/paint
Advanced tools
Comparing version 1.9.4 to 1.11.0
@@ -1,2 +0,2 @@ | ||
/** Bundle of @nextgis/paint; version: 1.9.4; author: NextGIS */ | ||
/** Bundle of @nextgis/paint; version: 1.11.0; author: NextGIS */ | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@nextgis/properties-filter");function r(t){return!!Array.isArray(t)}function o(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return"function"==typeof t}const i={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[o,...n]=r;let e=o;Array.isArray(o)&&(e=s(t,o));const i=n.splice(-1,n.length%2)[0];for(let t=0;t<n.length-1;t+=2){if(n[t]===e)return n[t+1]}return i}};function s(t,r){const[o,...n]=r,e=i[o];if(e)return e(t,n)}function c(t){return r=>s(r,t)}const f=["iconSize","iconAnchor"];function p(t){let o=!1;const n={};for(const e in t)if(-1===f.indexOf(e)){const i=e,s=t[i];r(s)&&(o=!0,n[i]=c(s))}if(o)return r=>{const o={};for(const t in n)o[t]=n[t](r);return{...t,...o}}}exports.createExpressionCallback=p,exports.isBasePaint=function(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)},exports.isExpression=r,exports.isIcon=function(t){return"icon"===t.type||"html"in t},exports.isPaint=n,exports.isPaintCallback=e,exports.isPropertiesPaint=o,exports.preparePaint=function r(n,i,s){if(!n)throw new Error("paint is empty");let c={...i};if(e(n)){const t=t=>{const o=r(n(t),i,s);return o.type=n.type,o};return t.type=n.type,t}if(o(n))return o=>r(function(r){let o={};const n=[];return r.forEach((t=>{t&&(Array.isArray(t)?n.push(t):o=t)})),r=>{const e=n.find((o=>t.featureFilter(r,o[0])));return e?{...o,...e[1]}:o}}(n)(o),i,s);if("get-paint"===n.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(n,s);t&&(c=r(t,i,s))}else{if("icon"===n.type)return n;{const t=p(n);if(t)return o=>r(t(o),i,s);c={...c,...n},c.fill=void 0===c.fill||c.fill,c.stroke=void 0!==c.stroke?c.stroke:!c.fill||!(!c.strokeColor&&!c.strokeOpacity)}}return e(c)||("color"in c&&(c.strokeColor||(c.strokeColor=c.color),c.fillColor||(c.fillColor=c.color)),"opacity"in c&&(void 0===c.strokeOpacity&&(c.strokeOpacity=c.opacity),void 0===c.fillOpacity&&(c.fillOpacity=c.opacity))),c}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@nextgis/properties-filter");function r(t){return!!Array.isArray(t)}function o(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return"function"==typeof t}const i={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[o,...n]=r;let e=o;Array.isArray(o)&&(e=s(t,o));const i=n.splice(-1,n.length%2)[0];for(let s=0;s<n.length-1;s+=2){if(n[s]===e)return n[s+1]}return i}};function s(t,r){const[o,...n]=r,e=i[o];if(e)return e(t,n)}function c(t){return r=>s(r,t)}const f=["iconSize","iconAnchor"];function p(t){let o=!1;const n={};for(const e in t)if(-1===f.indexOf(e)){const i=e,s=t[i];r(s)&&(o=!0,n[i]=c(s))}if(o)return r=>{const o={};for(const t in n)o[t]=n[t](r);return{...t,...o}}}exports.createExpressionCallback=p,exports.isBasePaint=function(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)},exports.isExpression=r,exports.isIcon=function(t){return"icon"===t.type||"html"in t},exports.isPaint=n,exports.isPaintCallback=e,exports.isPropertiesPaint=o,exports.preparePaint=function r(n,i,s){if(!n)throw new Error("paint is empty");let c={...i};if(e(n)){const t=t=>{const o=r(n(t),i,s);return o.type=n.type,o};return t.type=n.type,t}if(o(n))return o=>r(function(r){let o={};const n=[];return r.forEach((t=>{t&&(Array.isArray(t)?n.push(t):o=t)})),r=>{const e=n.find((o=>t.featureFilter(r,o[0])));return e?{...o,...e[1]}:o}}(n)(o),i,s);if("get-paint"===n.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(n,s);t&&(c=r(t,i,s))}else{if("icon"===n.type)return n;{const t=p(n);if(t)return o=>r(t(o),i,s);c={...c,...n},c.fill=void 0===c.fill||c.fill,c.stroke=void 0!==c.stroke?c.stroke:!c.fill||!(!c.strokeColor&&!c.strokeOpacity)}}return e(c)||("color"in c&&(c.strokeColor||(c.strokeColor=c.color),c.fillColor||(c.fillColor=c.color)),"opacity"in c&&(void 0===c.strokeOpacity&&(c.strokeOpacity=c.opacity),void 0===c.fillOpacity&&(c.fillOpacity=c.opacity))),c}; | ||
//# sourceMappingURL=paint.cjs.prod.js.map |
@@ -1,2 +0,2 @@ | ||
/** Bundle of @nextgis/paint; version: 1.9.4; author: NextGIS */ | ||
/** Bundle of @nextgis/paint; version: 1.11.0; author: NextGIS */ | ||
function isExpression(value) { | ||
@@ -3,0 +3,0 @@ if (Array.isArray(value)) { |
@@ -1,2 +0,2 @@ | ||
function t(t){return!!Array.isArray(t)}function r(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function o(t){return"function"==typeof t}function i(t){return"icon"===t.type||"html"in t}const c={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[n,...e]=r;let o=n;Array.isArray(n)&&(o=f(t,n));const i=e.splice(-1,e.length%2)[0];for(let t=0;t<e.length-1;t+=2){if(e[t]===o)return e[t+1]}return i}};function f(t,r){const[n,...e]=r,o=c[n];if(o)return o(t,e)}function l(t){return r=>f(r,t)}const s=["iconSize","iconAnchor"];function u(r){let n=!1;const e={};for(const o in r)if(-1===s.indexOf(o)){const i=o,c=r[i];t(c)&&(n=!0,e[i]=l(c))}if(n)return t=>{const n={};for(const r in e)n[r]=e[r](t);return{...r,...n}}}function p(t,r,n){if((r=String(r))===(t=String(t)))return!0;if(n&&r.toUpperCase()===t.toUpperCase())return!0;const e=`^${o=r,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(e,n?"i":"").exec(t)}const y={gt:(t,r)=>t>r,lt:(t,r)=>t<r,ge:(t,r)=>t>=r,le:(t,r)=>t<=r,eq:(t,r)=>t===r,ne:(t,r)=>t!==r,in:(t,r)=>-1!==r.indexOf(t),notin:(t,r)=>-1===r.indexOf(t),like:(t,r)=>p(t,r),ilike:(t,r)=>p(t,r,!0)};function a(t,r){const n={...t.properties};return!!n&&(n.$id=t.id,g(n,r))}function g(t,r){const n="string"==typeof r[0]?r[0]:"all",e=r=>{if(3===(n=r).length&&"string"==typeof n[0]&&"string"==typeof n[1]){const[n,e,o]=r,i=y[e];if(i){if(("like"===e||"ilike"===e)&&"string"==typeof n){let r="";const e=n.replace(/^%?(\w+)%?$/,((e,i)=>(r=t[i],n.replace(i,o))));return i(r,e)}return i(t[n],o)}return!1}return g(t,r);var n},o=r.filter((t=>Array.isArray(t)));return"any"===n?o.some(e):o.every(e)}function k(t,n,e){if(!t)throw new Error("paint is empty");let i={...n};if(o(t)){const r=r=>{const o=k(t(r),n,e);return o.type=t.type,o};return r.type=t.type,r}if(r(t))return r=>k(function(t){let r={};const n=[];return t.forEach((t=>{t&&(Array.isArray(t)?n.push(t):r=t)})),t=>{const e=n.find((r=>a(t,r[0])));return e?{...r,...e[1]}:r}}(t)(r),n,e);if("get-paint"===t.type){const r=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const n=r[t.from];if(n)return n(t.options)}}(t,e);r&&(i=k(r,n,e))}else{if("icon"===t.type)return t;{const r=u(t);if(r)return t=>k(r(t),n,e);i={...i,...t},i.fill=void 0===i.fill||i.fill,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity)}}return o(i)||("color"in i&&(i.strokeColor||(i.strokeColor=i.color),i.fillColor||(i.fillColor=i.color)),"opacity"in i&&(void 0===i.strokeOpacity&&(i.strokeOpacity=i.opacity),void 0===i.fillOpacity&&(i.fillOpacity=i.opacity))),i}export{u as createExpressionCallback,e as isBasePaint,t as isExpression,i as isIcon,n as isPaint,o as isPaintCallback,r as isPropertiesPaint,k as preparePaint}; | ||
function t(t){return!!Array.isArray(t)}function r(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function e(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function o(t){return"function"==typeof t}function i(t){return"icon"===t.type||"html"in t}const c={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[n,...e]=r;let o=n;Array.isArray(n)&&(o=f(t,n));const i=e.splice(-1,e.length%2)[0];for(let c=0;c<e.length-1;c+=2){if(e[c]===o)return e[c+1]}return i}};function f(t,r){const[n,...e]=r,o=c[n];if(o)return o(t,e)}function l(t){return r=>f(r,t)}const s=["iconSize","iconAnchor"];function u(r){let n=!1;const e={};for(const o in r)if(-1===s.indexOf(o)){const i=o,c=r[i];t(c)&&(n=!0,e[i]=l(c))}if(n)return t=>{const n={};for(const r in e)n[r]=e[r](t);return{...r,...n}}}function p(t,r,n){if((r=String(r))===(t=String(t)))return!0;if(n&&r.toUpperCase()===t.toUpperCase())return!0;const e=`^${o=r,o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var o;return null!==new RegExp(e,n?"i":"").exec(t)}const y={gt:(t,r)=>t>r,lt:(t,r)=>t<r,ge:(t,r)=>t>=r,le:(t,r)=>t<=r,eq:(t,r)=>t===r,ne:(t,r)=>t!==r,in:(t,r)=>-1!==r.indexOf(t),notin:(t,r)=>-1===r.indexOf(t),like:(t,r)=>p(t,r),ilike:(t,r)=>p(t,r,!0)};function a(t,r){const n={...t.properties};return!!n&&(n.$id=t.id,g(n,r))}function g(t,r){const n="string"==typeof r[0]?r[0]:"all",e=r=>{if(3===(n=r).length&&"string"==typeof n[0]&&"string"==typeof n[1]){const[n,e,o]=r,i=y[e];if(i){if(("like"===e||"ilike"===e)&&"string"==typeof n){let r="";const e=n.replace(/^%?(\w+)%?$/,((e,i)=>(r=t[i],n.replace(i,o))));return i(r,e)}return i(t[n],o)}return!1}return g(t,r);var n},o=r.filter((t=>Array.isArray(t)));return"any"===n?o.some(e):o.every(e)}function k(t,n,e){if(!t)throw new Error("paint is empty");let i={...n};if(o(t)){const r=r=>{const o=k(t(r),n,e);return o.type=t.type,o};return r.type=t.type,r}if(r(t))return r=>k(function(t){let r={};const n=[];return t.forEach((t=>{t&&(Array.isArray(t)?n.push(t):r=t)})),t=>{const e=n.find((r=>a(t,r[0])));return e?{...r,...e[1]}:r}}(t)(r),n,e);if("get-paint"===t.type){const r=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const n=r[t.from];if(n)return n(t.options)}}(t,e);r&&(i=k(r,n,e))}else{if("icon"===t.type)return t;{const r=u(t);if(r)return t=>k(r(t),n,e);i={...i,...t},i.fill=void 0===i.fill||i.fill,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity)}}return o(i)||("color"in i&&(i.strokeColor||(i.strokeColor=i.color),i.fillColor||(i.fillColor=i.color)),"opacity"in i&&(void 0===i.strokeOpacity&&(i.strokeOpacity=i.opacity),void 0===i.fillOpacity&&(i.fillOpacity=i.opacity))),i}export{u as createExpressionCallback,e as isBasePaint,t as isExpression,i as isIcon,n as isPaint,o as isPaintCallback,r as isPropertiesPaint,k as preparePaint}; | ||
//# sourceMappingURL=paint.esm-browser.prod.js.map |
@@ -1,2 +0,2 @@ | ||
/** Bundle of @nextgis/paint; version: 1.9.4; author: NextGIS */ | ||
/** Bundle of @nextgis/paint; version: 1.11.0; author: NextGIS */ | ||
import { featureFilter } from '@nextgis/properties-filter'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import{featureFilter as t}from"@nextgis/properties-filter";function r(t){return!!Array.isArray(t)}function o(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function i(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function e(t){return"function"==typeof t}function c(t){return"icon"===t.type||"html"in t}const f={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[o,...n]=r;let i=o;Array.isArray(o)&&(i=s(t,o));const e=n.splice(-1,n.length%2)[0];for(let t=0;t<n.length-1;t+=2){if(n[t]===i)return n[t+1]}return e}};function s(t,r){const[o,...n]=r,i=f[o];if(i)return i(t,n)}function u(t){return r=>s(r,t)}const p=["iconSize","iconAnchor"];function l(t){let o=!1;const n={};for(const i in t)if(-1===p.indexOf(i)){const e=i,c=t[e];r(c)&&(o=!0,n[e]=u(c))}if(o)return r=>{const o={};for(const t in n)o[t]=n[t](r);return{...t,...o}}}function y(r,n,i){if(!r)throw new Error("paint is empty");let c={...n};if(e(r)){const t=t=>{const o=y(r(t),n,i);return o.type=r.type,o};return t.type=r.type,t}if(o(r))return o=>y(function(r){let o={};const n=[];return r.forEach((t=>{t&&(Array.isArray(t)?n.push(t):o=t)})),r=>{const i=n.find((o=>t(r,o[0])));return i?{...o,...i[1]}:o}}(r)(o),n,i);if("get-paint"===r.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(r,i);t&&(c=y(t,n,i))}else{if("icon"===r.type)return r;{const t=l(r);if(t)return r=>y(t(r),n,i);c={...c,...r},c.fill=void 0===c.fill||c.fill,c.stroke=void 0!==c.stroke?c.stroke:!c.fill||!(!c.strokeColor&&!c.strokeOpacity)}}return e(c)||("color"in c&&(c.strokeColor||(c.strokeColor=c.color),c.fillColor||(c.fillColor=c.color)),"opacity"in c&&(void 0===c.strokeOpacity&&(c.strokeOpacity=c.opacity),void 0===c.fillOpacity&&(c.fillOpacity=c.opacity))),c}export{l as createExpressionCallback,i as isBasePaint,r as isExpression,c as isIcon,n as isPaint,e as isPaintCallback,o as isPropertiesPaint,y as preparePaint}; | ||
import{featureFilter as t}from"@nextgis/properties-filter";function r(t){return!!Array.isArray(t)}function o(t){return!!Array.isArray(t)}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function i(t){return!!n(t)&&("get-paint"!==t.type&&"icon"!==t.type)}function e(t){return"function"==typeof t}function c(t){return"icon"===t.type||"html"in t}const f={get:function(t,r){return t.properties&&t.properties[r[0]]},match:function(t,r){const[o,...n]=r;let i=o;Array.isArray(o)&&(i=s(t,o));const e=n.splice(-1,n.length%2)[0];for(let c=0;c<n.length-1;c+=2){if(n[c]===i)return n[c+1]}return e}};function s(t,r){const[o,...n]=r,i=f[o];if(i)return i(t,n)}function u(t){return r=>s(r,t)}const p=["iconSize","iconAnchor"];function l(t){let o=!1;const n={};for(const i in t)if(-1===p.indexOf(i)){const e=i,c=t[e];r(c)&&(o=!0,n[e]=u(c))}if(o)return r=>{const o={};for(const t in n)o[t]=n[t](r);return{...t,...o}}}function y(r,n,i){if(!r)throw new Error("paint is empty");let c={...n};if(e(r)){const t=t=>{const o=y(r(t),n,i);return o.type=r.type,o};return t.type=r.type,t}if(o(r))return o=>y(function(r){let o={};const n=[];return r.forEach((t=>{t&&(Array.isArray(t)?n.push(t):o=t)})),r=>{const i=n.find((o=>t(r,o[0])));return i?{...o,...i[1]}:o}}(r)(o),n,i);if("get-paint"===r.type){const t=function(t,r){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&r){const o=r[t.from];if(o)return o(t.options)}}(r,i);t&&(c=y(t,n,i))}else{if("icon"===r.type)return r;{const t=l(r);if(t)return r=>y(t(r),n,i);c={...c,...r},c.fill=void 0===c.fill||c.fill,c.stroke=void 0!==c.stroke?c.stroke:!c.fill||!(!c.strokeColor&&!c.strokeOpacity)}}return e(c)||("color"in c&&(c.strokeColor||(c.strokeColor=c.color),c.fillColor||(c.fillColor=c.color)),"opacity"in c&&(void 0===c.strokeOpacity&&(c.strokeOpacity=c.opacity),void 0===c.fillOpacity&&(c.fillOpacity=c.opacity))),c}export{l as createExpressionCallback,i as isBasePaint,r as isExpression,c as isIcon,n as isPaint,e as isPaintCallback,o as isPropertiesPaint,y as preparePaint}; | ||
//# sourceMappingURL=paint.esm-bundler.prod.js.map |
@@ -1,2 +0,2 @@ | ||
/** Bundle of @nextgis/paint; version: 1.9.4; author: NextGIS */ | ||
/** Bundle of @nextgis/paint; version: 1.11.0; author: NextGIS */ | ||
var Paint = (function (exports) { | ||
@@ -141,3 +141,3 @@ 'use strict'; | ||
return true; | ||
var re = ("^" + reEscape(a) + "$").replace(/%/g, '.*').replace('_', '.'); | ||
var re = "^".concat(reEscape(a), "$").replace(/%/g, '.*').replace('_', '.'); | ||
return new RegExp(re, iLike ? 'i' : '').exec(b) !== null; | ||
@@ -144,0 +144,0 @@ } |
@@ -16,3 +16,3 @@ var Paint=function(r){"use strict";function n(r){return!!Array.isArray(r)}function t(r){return!!Array.isArray(r)}function e(r){return"[object Object]"===Object.prototype.toString.call(r)}function i(r){return"function"==typeof r} | ||
***************************************************************************** */ | ||
var o=function(){return(o=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r}).apply(this,arguments)};var u={get:function(r,n){return r.properties&&r.properties[n[0]]},match:function(r,n){var t=n[0],e=n.slice(1),i=t;Array.isArray(t)&&(i=f(r,t));for(var o=e.splice(-1,e.length%2)[0],u=0;u<e.length-1;u+=2){if(e[u]===i)return e[u+1]}return o}};function f(r,n){var t=n[0],e=n.slice(1),i=u[t];if(i)return i(r,e)}function c(r){return function(n){return f(n,r)}}var a=["iconSize","iconAnchor"];function p(r){var t=!1,e={};for(var i in r)if(-1===a.indexOf(i)){var u=i,f=r[u];n(f)&&(t=!0,e[u]=c(f))}if(t)return function(n){var t={};for(var i in e)t[i]=e[i](n);return o(o({},r),t)}}function l(r,n,t){if((n=String(n))===(r=String(r)))return!0;if(t&&n.toUpperCase()===r.toUpperCase())return!0;var e,i=("^"+(e=n,e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")+"$")).replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,t?"i":"").exec(r)}var s={gt:function(r,n){return r>n},lt:function(r,n){return r<n},ge:function(r,n){return r>=n},le:function(r,n){return r<=n},eq:function(r,n){return r===n},ne:function(r,n){return r!==n},in:function(r,n){return-1!==n.indexOf(r)},notin:function(r,n){return-1===n.indexOf(r)},like:function(r,n){return l(r,n)},ilike:function(r,n){return l(r,n,!0)}};function y(r,n){var t=o({},r.properties);return!!t&&(t.$id=r.id,v(t,n))}function v(r,n){var t="string"==typeof n[0]?n[0]:"all",e=function(n){if(3===(c=n).length&&"string"==typeof c[0]&&"string"==typeof c[1]){var t=n[0],e=n[1],i=n[2],o=s[e];if(o){if(("like"===e||"ilike"===e)&&"string"==typeof t){var u="",f=t.replace(/^%?(\w+)%?$/,(function(n,e){return u=r[e],t.replace(e,i)}));return o(u,f)}return o(r[t],i)}return!1}return v(r,n);var c},i=n.filter((function(r){return Array.isArray(r)}));return"any"===t?i.some(e):i.every(e)}return r.createExpressionCallback=p,r.isBasePaint=function(r){return!!e(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isExpression=n,r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=e,r.isPaintCallback=i,r.isPropertiesPaint=t,r.preparePaint=function r(n,e,u){if(!n)throw new Error("paint is empty");var f=o({},e);if(i(n)){var c=function(t){var i=r(n(t),e,u);return i.type=n.type,i};return c.type=n.type,c}if(t(n))return function(t){return r((i={},f=[],n.forEach((function(r){r&&(Array.isArray(r)?f.push(r):i=r)})),function(r){var n=f.find((function(n){return y(r,n[0])}));return n?o(o({},i),n[1]):i})(t),e,u);var i,f};if("get-paint"===n.type){var a=function(r,n){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&n){var t=n[r.from];if(t)return t(r.options)}}(n,u);a&&(f=r(a,e,u))}else{if("icon"===n.type)return n;var l=p(n);if(l)return function(n){return r(l(n),e,u)};(f=o(o({},f),n)).fill=void 0===f.fill||f.fill,f.stroke=void 0!==f.stroke?f.stroke:!f.fill||!(!f.strokeColor&&!f.strokeOpacity)}return i(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f},Object.defineProperty(r,"__esModule",{value:!0}),r}({}); | ||
var o=function(){return(o=Object.assign||function(r){for(var n,t=1,e=arguments.length;t<e;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r}).apply(this,arguments)};var u={get:function(r,n){return r.properties&&r.properties[n[0]]},match:function(r,n){var t=n[0],e=n.slice(1),i=t;Array.isArray(t)&&(i=f(r,t));for(var o=e.splice(-1,e.length%2)[0],u=0;u<e.length-1;u+=2){if(e[u]===i)return e[u+1]}return o}};function f(r,n){var t=n[0],e=n.slice(1),i=u[t];if(i)return i(r,e)}function c(r){return function(n){return f(n,r)}}var a=["iconSize","iconAnchor"];function p(r){var t=!1,e={};for(var i in r)if(-1===a.indexOf(i)){var u=i,f=r[u];n(f)&&(t=!0,e[u]=c(f))}if(t)return function(n){var t={};for(var i in e)t[i]=e[i](n);return o(o({},r),t)}}function l(r,n,t){if((n=String(n))===(r=String(r)))return!0;if(t&&n.toUpperCase()===r.toUpperCase())return!0;var e,i="^".concat((e=n,e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,t?"i":"").exec(r)}var s={gt:function(r,n){return r>n},lt:function(r,n){return r<n},ge:function(r,n){return r>=n},le:function(r,n){return r<=n},eq:function(r,n){return r===n},ne:function(r,n){return r!==n},in:function(r,n){return-1!==n.indexOf(r)},notin:function(r,n){return-1===n.indexOf(r)},like:function(r,n){return l(r,n)},ilike:function(r,n){return l(r,n,!0)}};function y(r,n){var t=o({},r.properties);return!!t&&(t.$id=r.id,v(t,n))}function v(r,n){var t="string"==typeof n[0]?n[0]:"all",e=function(n){if(3===(c=n).length&&"string"==typeof c[0]&&"string"==typeof c[1]){var t=n[0],e=n[1],i=n[2],o=s[e];if(o){if(("like"===e||"ilike"===e)&&"string"==typeof t){var u="",f=t.replace(/^%?(\w+)%?$/,(function(n,e){return u=r[e],t.replace(e,i)}));return o(u,f)}return o(r[t],i)}return!1}return v(r,n);var c},i=n.filter((function(r){return Array.isArray(r)}));return"any"===t?i.some(e):i.every(e)}return r.createExpressionCallback=p,r.isBasePaint=function(r){return!!e(r)&&("get-paint"!==r.type&&"icon"!==r.type)},r.isExpression=n,r.isIcon=function(r){return"icon"===r.type||"html"in r},r.isPaint=e,r.isPaintCallback=i,r.isPropertiesPaint=t,r.preparePaint=function r(n,e,u){if(!n)throw new Error("paint is empty");var f=o({},e);if(i(n)){var c=function(t){var i=r(n(t),e,u);return i.type=n.type,i};return c.type=n.type,c}if(t(n))return function(t){return r((i={},f=[],n.forEach((function(r){r&&(Array.isArray(r)?f.push(r):i=r)})),function(r){var n=f.find((function(n){return y(r,n[0])}));return n?o(o({},i),n[1]):i})(t),e,u);var i,f};if("get-paint"===n.type){var a=function(r,n){if("function"==typeof r.from)return r.from(r.options);if("string"==typeof r.from&&n){var t=n[r.from];if(t)return t(r.options)}}(n,u);a&&(f=r(a,e,u))}else{if("icon"===n.type)return n;var l=p(n);if(l)return function(n){return r(l(n),e,u)};(f=o(o({},f),n)).fill=void 0===f.fill||f.fill,f.stroke=void 0!==f.stroke?f.stroke:!f.fill||!(!f.strokeColor&&!f.strokeOpacity)}return i(f)||("color"in f&&(f.strokeColor||(f.strokeColor=f.color),f.fillColor||(f.fillColor=f.color)),"opacity"in f&&(void 0===f.strokeOpacity&&(f.strokeOpacity=f.opacity),void 0===f.fillOpacity&&(f.fillOpacity=f.opacity))),f},Object.defineProperty(r,"__esModule",{value:!0}),r}({}); | ||
//# sourceMappingURL=paint.global.prod.js.map |
{ | ||
"name": "@nextgis/paint", | ||
"version": "1.9.4", | ||
"version": "1.11.0", | ||
"description": "Create style for vector layer", | ||
@@ -11,7 +11,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"@nextgis/properties-filter": "^1.9.4", | ||
"@nextgis/properties-filter": "^1.11.0", | ||
"geojson": "^0.5.0" | ||
}, | ||
"devDependencies": { | ||
"@nextgis/build-tools": "^1.8.4" | ||
"@nextgis/build-tools": "^1.11.0" | ||
}, | ||
@@ -52,3 +52,3 @@ "buildOptions": { | ||
}, | ||
"gitHead": "f541d1cc46b1a76d81f5e714505b338cb3df8610" | ||
"gitHead": "bdfc366ae514294b93c19d96dce9fd77f3c4a5c2" | ||
} |
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
171235