diff --git a/packages/uni-h5/dist/uni-h5.cjs.js b/packages/uni-h5/dist/uni-h5.cjs.js index d9864b70b92511ee6f4ffabc0ecd901abf9de71a..7b01385173856c7b0075f78925c227ccc0e7293b 100644 --- a/packages/uni-h5/dist/uni-h5.cjs.js +++ b/packages/uni-h5/dist/uni-h5.cjs.js @@ -1626,7 +1626,7 @@ function getTempCanvas(width = 0, height = 0) { tempCanvas.height = height; return tempCanvas; } -const props$q = { +const props$r = { canvasId: { type: String, default: "" @@ -1646,7 +1646,7 @@ var index$B = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$q, + props: props$r, computed: { id() { return this.canvasId; @@ -2104,7 +2104,7 @@ function useMethods(props2, canvasRef, actionsWaiting) { }); } const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); -const props$p = { +const props$q = { name: { type: String, default: "" @@ -2112,7 +2112,7 @@ const props$p = { }; var index$A = /* @__PURE__ */ defineBuiltInComponent({ name: "CheckboxGroup", - props: props$p, + props: props$q, emits: ["change"], setup(props2, { emit: emit2, @@ -2164,7 +2164,7 @@ function useProvideCheckGroup(props2, trigger) { } return getFieldsValue; } -const props$o = { +const props$p = { checked: { type: [Boolean, String], default: false @@ -2188,7 +2188,7 @@ const props$o = { }; var index$z = /* @__PURE__ */ defineBuiltInComponent({ name: "Checkbox", - props: props$o, + props: props$p, setup(props2, { slots }) { @@ -2255,7 +2255,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) { let resetTimer; function iosHideKeyboard() { } -const props$n = { +const props$o = { cursorSpacing: { type: [Number, String], default: 0 @@ -2427,7 +2427,7 @@ function useQuill(props2, rootRef, trigger) { useContextInfo(); useSubscribe(); } -const props$m = /* @__PURE__ */ shared.extend({}, props$n, { +const props$n = /* @__PURE__ */ shared.extend({}, props$o, { id: { type: String, default: "" @@ -2455,7 +2455,7 @@ const props$m = /* @__PURE__ */ shared.extend({}, props$n, { }); var index$y = /* @__PURE__ */ defineBuiltInComponent({ name: "Editor", - props: props$m, + props: props$n, emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1], setup(props2, { emit: emit2 @@ -2541,7 +2541,7 @@ var index$x = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$l = { +const props$m = { src: { type: String, default: "" @@ -2580,7 +2580,7 @@ const IMAGE_MODES = { }; var index$w = /* @__PURE__ */ defineBuiltInComponent({ name: "Image", - props: props$l, + props: props$m, setup(props2, { emit: emit2 }) { @@ -2829,7 +2829,7 @@ const UniViewJSBridgeSubscribe = function() { function getValueString(value) { return value === null ? "" : String(value); } -const props$k = /* @__PURE__ */ shared.extend({}, { +const props$l = /* @__PURE__ */ shared.extend({}, { name: { type: String, default: "" @@ -2898,7 +2898,7 @@ const props$k = /* @__PURE__ */ shared.extend({}, { type: Boolean, default: false } -}, props$n); +}, props$o); const emit = [ "input", "focus", @@ -3093,7 +3093,7 @@ function useField(props2, rootRef, emit2, beforeInput) { trigger }; } -const props$j = /* @__PURE__ */ shared.extend({}, props$k, { +const props$k = /* @__PURE__ */ shared.extend({}, props$l, { placeholderClass: { type: String, default: "input-placeholder" @@ -3105,7 +3105,7 @@ const props$j = /* @__PURE__ */ shared.extend({}, props$k, { }); var Input = /* @__PURE__ */ defineBuiltInComponent({ name: "Input", - props: props$j, + props: props$k, emits: ["confirm", ...emit], setup(props2, { emit: emit2 @@ -4555,7 +4555,7 @@ const VALUES = { backgroundColor: "#EBEBEB", activeMode: "backwards" }; -const props$i = { +const props$j = { percent: { type: [Number, String], default: 0, @@ -4604,7 +4604,7 @@ const props$i = { }; var index$s = /* @__PURE__ */ defineBuiltInComponent({ name: "Progress", - props: props$i, + props: props$j, setup(props2) { const state = useProgressState(props2); _activeAnimation(state, props2); @@ -4675,7 +4675,7 @@ function _activeAnimation(state, props2) { } } const uniRadioGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); -const props$h = { +const props$i = { name: { type: String, default: "" @@ -4683,7 +4683,7 @@ const props$h = { }; var index$r = /* @__PURE__ */ defineBuiltInComponent({ name: "RadioGroup", - props: props$h, + props: props$i, setup(props2, { emit: emit2, slots @@ -4760,7 +4760,7 @@ function useProvideRadioGroup(props2, trigger) { } return fields2; } -const props$g = { +const props$h = { checked: { type: [Boolean, String], default: false @@ -4784,7 +4784,7 @@ const props$g = { }; var index$q = /* @__PURE__ */ defineBuiltInComponent({ name: "Radio", - props: props$g, + props: props$h, setup(props2, { slots }) { @@ -5104,7 +5104,7 @@ function processClickEvent(node, elem, triggerItemClick) { }, true); } } -const props$f = { +const props$g = { nodes: { type: [Array, String], default: function() { @@ -5117,7 +5117,7 @@ var index$p = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$f, + props: props$g, emits: ["click", "touchstart", "touchmove", "touchcancel", "touchend", "longpress"], setup(props2, { emit: emit2, @@ -5148,7 +5148,7 @@ var index$p = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$e = { +const props$f = { scrollX: { type: [Boolean, String], default: false @@ -5211,7 +5211,7 @@ var index$o = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$e, + props: props$f, emits: ["scroll", "scrolltoupper", "scrolltolower", "refresherrefresh", "refresherrestore", "refresherpulling", "refresherabort", "update:refresherTriggered"], setup(props2, { emit: emit2, @@ -5479,7 +5479,7 @@ function useScrollViewLoader(props2, state, scrollTopNumber, scrollLeftNumber, t } }); } -const props$d = { +const props$e = { name: { type: String, default: "" @@ -5535,7 +5535,7 @@ const props$d = { }; var index$n = /* @__PURE__ */ defineBuiltInComponent({ name: "Slider", - props: props$d, + props: props$e, emits: ["changing", "change"], setup(props2, { emit: emit2 @@ -5697,7 +5697,7 @@ var computeController = { return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); } }; -const props$c = { +const props$d = { indicatorDots: { type: [Boolean, String], default: false @@ -6075,7 +6075,7 @@ function useLayout(props2, state, swiperContexts, slideFrameRef, emit2, trigger) } var index$m = /* @__PURE__ */ defineBuiltInComponent({ name: "Swiper", - props: props$c, + props: props$d, emits: ["change", "transition", "animationfinish", "update:current", "update:currentItemId"], setup(props2, { slots, @@ -6173,7 +6173,7 @@ var index$m = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$b = { +const props$c = { itemId: { type: String, default: "" @@ -6181,7 +6181,7 @@ const props$b = { }; var index$l = /* @__PURE__ */ defineBuiltInComponent({ name: "SwiperItem", - props: props$b, + props: props$c, setup(props2, { slots }) { @@ -6198,7 +6198,7 @@ var index$l = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$a = { +const props$b = { name: { type: String, default: "" @@ -6226,7 +6226,7 @@ const props$a = { }; var index$k = /* @__PURE__ */ defineBuiltInComponent({ name: "Switch", - props: props$a, + props: props$b, emits: ["change"], setup(props2, { emit: emit2 @@ -6370,7 +6370,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$9 = /* @__PURE__ */ shared.extend({}, props$k, { +const props$a = /* @__PURE__ */ shared.extend({}, props$l, { placeholderClass: { type: String, default: "input-placeholder" @@ -6387,7 +6387,7 @@ const props$9 = /* @__PURE__ */ shared.extend({}, props$k, { let fixMargin = false; var index$i = /* @__PURE__ */ defineBuiltInComponent({ name: "Textarea", - props: props$9, + props: props$a, emit: ["confirm", "linechange", ...emit], setup(props2, { emit: emit2 @@ -7450,7 +7450,7 @@ function useContext(play, pause, seek, sendDanmu, playbackRate, requestFullScree useContextInfo(); useSubscribe(); } -const props$8 = { +const props$9 = { id: { type: String, default: "" @@ -7536,7 +7536,7 @@ const props$8 = { }; var index$e = /* @__PURE__ */ defineBuiltInComponent({ name: "Video", - props: props$8, + props: props$9, emits: ["fullscreenchange", "progress", "loadedmetadata", "waiting", "error", "play", "pause", "ended", "timeupdate"], setup(props2, { emit: emit2, @@ -7757,7 +7757,7 @@ const onWebInvokeAppService = ({ name, arg }) => { } }; const Invoke = /* @__PURE__ */ uniShared.once(() => UniServiceJSBridge.on(uniShared.ON_WEB_INVOKE_APP_SERVICE, onWebInvokeAppService)); -const props$7 = { +const props$8 = { src: { type: String, default: "" @@ -7766,7 +7766,7 @@ const props$7 = { var index$d = /* @__PURE__ */ defineBuiltInComponent({ inheritAttrs: false, name: "WebView", - props: props$7, + props: props$8, setup(props2) { Invoke(); const rootRef = vue.ref(null); @@ -7789,7 +7789,7 @@ var index$d = /* @__PURE__ */ defineBuiltInComponent({ } }); const ICON_PATH_ORIGIN = "data:image/png;base64,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"; -const props$6 = { +const props$7 = { id: { type: [Number, String], default: "" @@ -7872,7 +7872,7 @@ function useMarkerLabelStyle(id) { } var MapMarker = /* @__PURE__ */ defineSystemComponent({ name: "MapMarker", - props: props$6, + props: props$7, setup(props2) { const id = String(Number(props2.id) !== NaN ? props2.id : ""); const onMapReady = vue.inject("onMapReady"); @@ -8107,7 +8107,7 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$5 = { +const props$6 = { points: { type: Array, require: true @@ -8153,7 +8153,7 @@ const props$5 = { }; var MapPolyline = /* @__PURE__ */ defineSystemComponent({ name: "MapPolyline", - props: props$5, + props: props$6, setup(props2) { const onMapReady = vue.inject("onMapReady"); let polyline; @@ -8205,7 +8205,7 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$4 = { +const props$5 = { latitude: { type: [Number, String], require: true @@ -8237,7 +8237,7 @@ const props$4 = { }; var MapCircle = /* @__PURE__ */ defineSystemComponent({ name: "MapCircle", - props: props$4, + props: props$5, setup(props2) { const onMapReady = vue.inject("onMapReady"); let circle; @@ -8283,7 +8283,7 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$3 = { +const props$4 = { id: { type: [Number, String], default: "" @@ -8303,7 +8303,7 @@ const props$3 = { }; var MapControl = /* @__PURE__ */ defineSystemComponent({ name: "MapControl", - props: props$3, + props: props$4, setup(props2) { const onMapReady = vue.inject("onMapReady"); let control; @@ -8379,6 +8379,135 @@ var MapLocation = /* @__PURE__ */ defineSystemComponent({ }; } }); +var props$3 = { + dashArray: { + type: Array, + default: () => [0, 0] + }, + points: { + type: Array, + required: true + }, + strokeWidth: { + type: Number, + default: 1 + }, + strokeColor: { + type: String, + default: "#000000" + }, + fillColor: { + type: String, + default: "#00000000" + }, + zIndex: { + type: Number, + default: 0 + } +}; +function hexToRgba(hex) { + if (!hex) { + return { + r: 0, + g: 0, + b: 0, + a: 0 + }; + } + let tmpHex = hex.slice(1); + const tmpHexLen = tmpHex.length; + if (![3, 4, 6, 8].includes(tmpHexLen)) { + return { + r: 0, + g: 0, + b: 0, + a: 0 + }; + } + if (tmpHexLen === 3 || tmpHexLen === 4) { + tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1"); + } + let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g); + const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16); + if (!sa) { + return { r, g: g2, b, a: 1 }; + } + return { + r, + g: g2, + b, + a: (`0x100${sa}` - 65536) / 255 + }; +} +var MapPolygon = defineSystemComponent({ + name: "MapPolygon", + props: props$3, + setup(props2) { + let polygonIns; + const onMapReady = vue.inject("onMapReady"); + onMapReady((map, maps, trigger) => { + function drawPolygon() { + const { + points, + strokeWidth, + strokeColor, + dashArray, + fillColor, + zIndex + } = props2; + const path = points.map((item) => { + const { + latitude, + longitude + } = item; + return new maps.LatLng(latitude, longitude); + }); + const { + r: fcR, + g: fcG, + b: fcB, + a: fcA + } = hexToRgba(fillColor); + const { + r: scR, + g: scG, + b: scB, + a: scA + } = hexToRgba(strokeColor); + const polygonOptions = { + clickable: true, + cursor: "crosshair", + editable: false, + map, + fillColor: "", + path, + strokeColor: "", + strokeDashStyle: dashArray.some((item) => item > 0) ? "dash" : "solid", + strokeWeight: strokeWidth, + visible: true, + zIndex + }; + if (maps.Color) { + polygonOptions.fillColor = new maps.Color(fcR, fcG, fcB, fcA); + polygonOptions.strokeColor = new maps.Color(scR, scG, scB, scA); + } else { + polygonOptions.fillColor = `rgb(${fcR}, ${fcG}, ${fcB})`; + polygonOptions.fillOpacity = fcA; + polygonOptions.strokeColor = `rgb(${scR}, ${scG}, ${scB})`; + polygonOptions.strokeOpacity = scA; + } + if (polygonIns) { + polygonIns.setOptions(polygonOptions); + return; + } + polygonIns = new maps.Polygon(polygonOptions); + } + drawPolygon(); + vue.watch(props2, drawPolygon); + }); + return () => null; + } +}); const props$2 = { id: { type: String, @@ -8435,6 +8564,10 @@ const props$2 = { default() { return []; } + }, + polygons: { + type: Array, + default: () => [] } }; function getPoints(points) { @@ -8630,7 +8763,7 @@ var index$c = /* @__PURE__ */ defineBuiltInComponent({ "style": "width: 100%; height: 100%; position: relative; overflow: hidden" }, null, 512), props2.markers.map((item) => item.id && vue.createVNode(MapMarker, vue.mergeProps({ "key": item.id - }, item), null, 16)), props2.polyline.map((item) => vue.createVNode(MapPolyline, item, null, 16)), props2.circles.map((item) => vue.createVNode(MapCircle, item, null, 16)), props2.controls.map((item) => vue.createVNode(MapControl, item, null, 16)), props2.showLocation && vue.createVNode(MapLocation, null, null), vue.createVNode("div", { + }, item), null, 16)), props2.polyline.map((item) => vue.createVNode(MapPolyline, item, null, 16)), props2.circles.map((item) => vue.createVNode(MapCircle, item, null, 16)), props2.controls.map((item) => vue.createVNode(MapControl, item, null, 16)), props2.showLocation && vue.createVNode(MapLocation, null, null), props2.polygons.map((item) => vue.createVNode(MapPolygon, item, null, 16)), vue.createVNode("div", { "style": "position: absolute;top: 0;width: 100%;height: 100%;overflow: hidden;pointer-events: none;" }, [slots.default && slots.default()])], 8, ["id"]); }; @@ -10404,40 +10537,6 @@ function createRightWindowTsx(rightWindow, layoutState, windowState) { }, windowState), null, 16)])], 12, ["data-show"]), [[vue.vShow, layoutState.showRightWindow || layoutState.apiShowRightWindow]]); } } -function hexToRgba(hex) { - let r; - let g2; - let b; - hex = hex.replace("#", ""); - if (hex.length === 6) { - r = hex.substring(0, 2); - g2 = hex.substring(2, 4); - b = hex.substring(4, 6); - } else if (hex.length === 3) { - r = hex.substring(0, 1); - g2 = hex.substring(1, 2); - b = hex.substring(2, 3); - } else { - return { r: 0, g: 0, b: 0 }; - } - if (r.length === 1) { - r += r; - } - if (g2.length === 1) { - g2 += g2; - } - if (b.length === 1) { - b += b; - } - r = parseInt(r, 16); - g2 = parseInt(g2, 16); - b = parseInt(b, 16); - return { - r, - g: g2, - b - }; -} function usePageHeadTransparentBackgroundColor(backgroundColor) { const { r, g: g2, b } = hexToRgba(backgroundColor); return `rgba(${r},${g2},${b},0)`; diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index d4f364739550aa5dbf60cfc0df7f0ac8f84fd673..5425f0dd4540e773da3a037d3c1044f441d6b300 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -6416,7 +6416,7 @@ function getTempCanvas(width = 0, height = 0) { tempCanvas.height = height; return tempCanvas; } -const props$x = { +const props$y = { canvasId: { type: String, default: "" @@ -6436,7 +6436,7 @@ var index$w = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$x, + props: props$y, computed: { id() { return this.canvasId; @@ -6897,7 +6897,7 @@ function useMethods(props2, canvasRef, actionsWaiting) { }); } const uniCheckGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); -const props$w = { +const props$x = { name: { type: String, default: "" @@ -6905,7 +6905,7 @@ const props$w = { }; var index$v = /* @__PURE__ */ defineBuiltInComponent({ name: "CheckboxGroup", - props: props$w, + props: props$x, emits: ["change"], setup(props2, { emit: emit2, @@ -6957,7 +6957,7 @@ function useProvideCheckGroup(props2, trigger) { } return getFieldsValue; } -const props$v = { +const props$w = { checked: { type: [Boolean, String], default: false @@ -6981,7 +6981,7 @@ const props$v = { }; var index$u = /* @__PURE__ */ defineBuiltInComponent({ name: "Checkbox", - props: props$v, + props: props$w, setup(props2, { slots }) { @@ -7058,7 +7058,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) { let resetTimer; function iosHideKeyboard() { } -const props$u = { +const props$v = { cursorSpacing: { type: [Number, String], default: 0 @@ -7835,7 +7835,7 @@ function useQuill(props2, rootRef, trigger) { } }, id2, true); } -const props$t = /* @__PURE__ */ extend({}, props$u, { +const props$u = /* @__PURE__ */ extend({}, props$v, { id: { type: String, default: "" @@ -7863,7 +7863,7 @@ const props$t = /* @__PURE__ */ extend({}, props$u, { }); var index$t = /* @__PURE__ */ defineBuiltInComponent({ name: "Editor", - props: props$t, + props: props$u, emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1], setup(props2, { emit: emit2 @@ -7950,7 +7950,7 @@ var index$s = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$s = { +const props$t = { src: { type: String, default: "" @@ -7989,7 +7989,7 @@ const IMAGE_MODES = { }; var index$r = /* @__PURE__ */ defineBuiltInComponent({ name: "Image", - props: props$s, + props: props$t, setup(props2, { emit: emit2 }) { @@ -8303,7 +8303,7 @@ const UniViewJSBridgeSubscribe = function() { function getValueString(value) { return value === null ? "" : String(value); } -const props$r = /* @__PURE__ */ extend({}, { +const props$s = /* @__PURE__ */ extend({}, { name: { type: String, default: "" @@ -8372,7 +8372,7 @@ const props$r = /* @__PURE__ */ extend({}, { type: Boolean, default: false } -}, props$u); +}, props$v); const emit = [ "input", "focus", @@ -8576,7 +8576,7 @@ function useField(props2, rootRef, emit2, beforeInput) { trigger }; } -const props$q = /* @__PURE__ */ extend({}, props$r, { +const props$r = /* @__PURE__ */ extend({}, props$s, { placeholderClass: { type: String, default: "input-placeholder" @@ -8588,7 +8588,7 @@ const props$q = /* @__PURE__ */ extend({}, props$r, { }); var Input = /* @__PURE__ */ defineBuiltInComponent({ name: "Input", - props: props$q, + props: props$r, emits: ["confirm", ...emit], setup(props2, { emit: emit2 @@ -11141,7 +11141,7 @@ const VALUES = { backgroundColor: "#EBEBEB", activeMode: "backwards" }; -const props$p = { +const props$q = { percent: { type: [Number, String], default: 0, @@ -11190,7 +11190,7 @@ const props$p = { }; var index$p = /* @__PURE__ */ defineBuiltInComponent({ name: "Progress", - props: props$p, + props: props$q, setup(props2) { const state2 = useProgressState(props2); _activeAnimation(state2, props2); @@ -11261,7 +11261,7 @@ function _activeAnimation(state2, props2) { } } const uniRadioGroupKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniCheckGroup" : "ucg"); -const props$o = { +const props$p = { name: { type: String, default: "" @@ -11269,7 +11269,7 @@ const props$o = { }; var index$o = /* @__PURE__ */ defineBuiltInComponent({ name: "RadioGroup", - props: props$o, + props: props$p, setup(props2, { emit: emit2, slots @@ -11352,7 +11352,7 @@ function useProvideRadioGroup(props2, trigger) { } return fields2; } -const props$n = { +const props$o = { checked: { type: [Boolean, String], default: false @@ -11376,7 +11376,7 @@ const props$n = { }; var index$n = /* @__PURE__ */ defineBuiltInComponent({ name: "Radio", - props: props$n, + props: props$o, setup(props2, { slots }) { @@ -11706,7 +11706,7 @@ function processClickEvent(node, elem, triggerItemClick) { }, true); } } -const props$m = { +const props$n = { nodes: { type: [Array, String], default: function() { @@ -11719,7 +11719,7 @@ var index$m = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$m, + props: props$n, emits: ["click", "touchstart", "touchmove", "touchcancel", "touchend", "longpress"], setup(props2, { emit: emit2, @@ -11754,7 +11754,7 @@ var index$m = /* @__PURE__ */ defineBuiltInComponent({ } }); const passiveOptions = /* @__PURE__ */ passive(true); -const props$l = { +const props$m = { scrollX: { type: [Boolean, String], default: false @@ -11817,7 +11817,7 @@ var ScrollView = /* @__PURE__ */ defineBuiltInComponent({ compatConfig: { MODE: 3 }, - props: props$l, + props: props$m, emits: ["scroll", "scrolltoupper", "scrolltolower", "refresherrefresh", "refresherrestore", "refresherpulling", "refresherabort", "update:refresherTriggered"], setup(props2, { emit: emit2, @@ -12236,7 +12236,7 @@ function useScrollViewLoader(props2, state2, scrollTopNumber, scrollLeftNumber, } }); } -const props$k = { +const props$l = { name: { type: String, default: "" @@ -12292,7 +12292,7 @@ const props$k = { }; var index$l = /* @__PURE__ */ defineBuiltInComponent({ name: "Slider", - props: props$k, + props: props$l, emits: ["changing", "change"], setup(props2, { emit: emit2 @@ -12460,7 +12460,7 @@ var computeController = { return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m); } }; -const props$j = { +const props$k = { indicatorDots: { type: [Boolean, String], default: false @@ -12944,7 +12944,7 @@ function useLayout(props2, state2, swiperContexts, slideFrameRef, emit2, trigger } var Swiper = /* @__PURE__ */ defineBuiltInComponent({ name: "Swiper", - props: props$j, + props: props$k, emits: ["change", "transition", "animationfinish", "update:current", "update:currentItemId"], setup(props2, { slots, @@ -13042,7 +13042,7 @@ var Swiper = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$i = { +const props$j = { itemId: { type: String, default: "" @@ -13050,7 +13050,7 @@ const props$i = { }; var SwiperItem = /* @__PURE__ */ defineBuiltInComponent({ name: "SwiperItem", - props: props$i, + props: props$j, setup(props2, { slots }) { @@ -13099,7 +13099,7 @@ var SwiperItem = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$h = { +const props$i = { name: { type: String, default: "" @@ -13127,7 +13127,7 @@ const props$h = { }; var index$k = /* @__PURE__ */ defineBuiltInComponent({ name: "Switch", - props: props$h, + props: props$i, emits: ["change"], setup(props2, { emit: emit2 @@ -13280,7 +13280,7 @@ var index$j = /* @__PURE__ */ defineBuiltInComponent({ }; } }); -const props$g = /* @__PURE__ */ extend({}, props$r, { +const props$h = /* @__PURE__ */ extend({}, props$s, { placeholderClass: { type: String, default: "input-placeholder" @@ -13301,7 +13301,7 @@ function setFixMargin() { } var index$i = /* @__PURE__ */ defineBuiltInComponent({ name: "Textarea", - props: props$g, + props: props$h, emit: ["confirm", "linechange", ...emit], setup(props2, { emit: emit2 @@ -14758,7 +14758,7 @@ function useContext(play, pause, seek, sendDanmu, playbackRate, requestFullScree } }, id2, true); } -const props$f = { +const props$g = { id: { type: String, default: "" @@ -14844,7 +14844,7 @@ const props$f = { }; var index$e = /* @__PURE__ */ defineBuiltInComponent({ name: "Video", - props: props$f, + props: props$g, emits: ["fullscreenchange", "progress", "loadedmetadata", "waiting", "error", "play", "pause", "ended", "timeupdate"], setup(props2, { emit: emit2, @@ -15065,7 +15065,7 @@ const onWebInvokeAppService = ({ name, arg }) => { } }; const Invoke = /* @__PURE__ */ once(() => UniServiceJSBridge.on(ON_WEB_INVOKE_APP_SERVICE, onWebInvokeAppService)); -const props$e = { +const props$f = { src: { type: String, default: "" @@ -15074,7 +15074,7 @@ const props$e = { var index$d = /* @__PURE__ */ defineBuiltInComponent({ inheritAttrs: false, name: "WebView", - props: props$e, + props: props$f, setup(props2) { Invoke(); const rootRef = ref(null); @@ -15319,7 +15319,7 @@ function loadMaps(libraries, callback) { document.body.appendChild(script); } } -const props$d = { +const props$e = { id: { type: [Number, String], default: "" @@ -15405,7 +15405,7 @@ function useMarkerLabelStyle(id2) { } var MapMarker = /* @__PURE__ */ defineSystemComponent({ name: "MapMarker", - props: props$d, + props: props$e, setup(props2) { const id2 = String(Number(props2.id) !== NaN ? props2.id : ""); const onMapReady = inject("onMapReady"); @@ -15653,7 +15653,7 @@ var MapMarker = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$c = { +const props$d = { points: { type: Array, require: true @@ -15699,7 +15699,7 @@ const props$c = { }; var MapPolyline = /* @__PURE__ */ defineSystemComponent({ name: "MapPolyline", - props: props$c, + props: props$d, setup(props2) { const onMapReady = inject("onMapReady"); let polyline; @@ -15752,7 +15752,7 @@ var MapPolyline = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$b = { +const props$c = { latitude: { type: [Number, String], require: true @@ -15784,7 +15784,7 @@ const props$b = { }; var MapCircle = /* @__PURE__ */ defineSystemComponent({ name: "MapCircle", - props: props$b, + props: props$c, setup(props2) { const onMapReady = inject("onMapReady"); let circle; @@ -15831,7 +15831,7 @@ var MapCircle = /* @__PURE__ */ defineSystemComponent({ }; } }); -const props$a = { +const props$b = { id: { type: [Number, String], default: "" @@ -15851,7 +15851,7 @@ const props$a = { }; var MapControl = /* @__PURE__ */ defineSystemComponent({ name: "MapControl", - props: props$a, + props: props$b, setup(props2) { const onMapReady = inject("onMapReady"); let control; @@ -16426,7 +16426,7 @@ function usePopup(props2, { }); return visible; } -const props$9 = { +const props$a = { title: { type: String, default: "" @@ -16468,7 +16468,7 @@ const props$9 = { } }; var modal = /* @__PURE__ */ defineComponent({ - props: props$9, + props: props$a, setup(props2, { emit: emit2 }) { @@ -16976,7 +16976,7 @@ function usePreventScroll() { onMounted(() => preventScroll(true)); onUnmounted(() => preventScroll(false)); } -const props$8 = { +const props$9 = { src: { type: String, default: "" @@ -16984,7 +16984,7 @@ const props$8 = { }; var ImageView = /* @__PURE__ */ defineSystemComponent({ name: "ImageView", - props: props$8, + props: props$9, setup(props2) { const state2 = reactive({ direction: "none" @@ -17074,7 +17074,7 @@ var ImageView = /* @__PURE__ */ defineSystemComponent({ function _isSlot$2(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } -const props$7 = { +const props$8 = { urls: { type: Array, default() { @@ -17093,7 +17093,7 @@ function getIndex(props2) { } var ImagePreview = /* @__PURE__ */ defineSystemComponent({ name: "ImagePreview", - props: props$7, + props: props$8, emits: ["close"], setup(props2, { emit: emit2 @@ -17845,7 +17845,7 @@ const getLocation = /* @__PURE__ */ defineAsyncApi(API_GET_LOCATION, ({ type, al }); }, GetLocationProtocol, GetLocationOptions); const ICON_PATH_NAV = "M28 17c-6.49396875 0-12.13721875 2.57040625-15 6.34840625V5.4105l6.29859375 6.29859375c0.387875 0.387875 1.02259375 0.387875 1.4105 0 0.387875-0.387875 0.387875-1.02259375 0-1.4105L12.77853125 2.36803125a0.9978125 0.9978125 0 0 0-0.0694375-0.077125c-0.1944375-0.1944375-0.45090625-0.291375-0.70721875-0.290875l-0.00184375-0.0000625-0.00184375 0.0000625c-0.2563125-0.0005-0.51278125 0.09640625-0.70721875 0.290875a0.9978125 0.9978125 0 0 0-0.0694375 0.077125l-7.930625 7.9305625c-0.387875 0.387875-0.387875 1.02259375 0 1.4105 0.387875 0.387875 1.02259375 0.387875 1.4105 0L11 5.4105V29c0 0.55 0.45 1 1 1s1-0.45 1-1c0-5.52284375 6.71571875-10 15-10 0.55228125 0 1-0.44771875 1-1 0-0.55228125-0.44771875-1-1-1z"; -const props$6 = { +const props$7 = { latitude: { type: Number }, @@ -17902,7 +17902,7 @@ function useState$2(props2) { } var LocationView = /* @__PURE__ */ defineSystemComponent({ name: "LocationView", - props: props$6, + props: props$7, emits: ["close"], setup(props2, { emit: emit2 @@ -18010,7 +18010,7 @@ const openLocation = /* @__PURE__ */ defineAsyncApi(API_OPEN_LOCATION, (args, { function _isSlot$1(s) { return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s); } -const props$5 = { +const props$6 = { latitude: { type: Number }, @@ -18156,7 +18156,7 @@ function useList(state2) { } var LoctaionPicker = /* @__PURE__ */ defineSystemComponent({ name: "LoctaionPicker", - props: props$5, + props: props$6, emits: ["close"], setup(props2, { emit: emit2 @@ -18441,7 +18441,7 @@ const preloadPage = /* @__PURE__ */ defineAsyncApi(API_PRELOAD_PAGE, ({ url }, { reject(`${url} ${String(err)}`); }); }, PreloadPageProtocol); -const props$4 = { +const props$5 = { title: { type: String, default: "" @@ -18471,7 +18471,7 @@ const props$4 = { const ToastIconClassName = "uni-toast__icon"; var Toast = /* @__PURE__ */ defineComponent({ name: "Toast", - props: props$4, + props: props$5, setup(props2) { initI18nShowToastMsgsOnce(); initI18nShowLoadingMsgsOnce(); @@ -18691,7 +18691,7 @@ function usePopupStyle(props2) { popupStyle }; } -const props$3 = { +const props$4 = { title: { type: String, default: "" @@ -18721,7 +18721,7 @@ const props$3 = { }; var actionSheet = /* @__PURE__ */ defineComponent({ name: "ActionSheet", - props: props$3, + props: props$4, emits: ["close"], setup(props2, { emit: emit2 @@ -20025,6 +20025,138 @@ var MapLocation = /* @__PURE__ */ defineSystemComponent({ }; } }); +var props$3 = { + dashArray: { + type: Array, + default: () => [0, 0] + }, + points: { + type: Array, + required: true + }, + strokeWidth: { + type: Number, + default: 1 + }, + strokeColor: { + type: String, + default: "#000000" + }, + fillColor: { + type: String, + default: "#00000000" + }, + zIndex: { + type: Number, + default: 0 + } +}; +function hexToRgba(hex) { + if (!hex) { + return { + r: 0, + g: 0, + b: 0, + a: 0 + }; + } + let tmpHex = hex.slice(1); + const tmpHexLen = tmpHex.length; + if (![3, 4, 6, 8].includes(tmpHexLen)) { + return { + r: 0, + g: 0, + b: 0, + a: 0 + }; + } + if (tmpHexLen === 3 || tmpHexLen === 4) { + tmpHex = tmpHex.replace(/(\w{1})/g, "$1$1"); + } + let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g); + const r = parseInt(sr, 16), g2 = parseInt(sg, 16), b = parseInt(sb, 16); + if (!sa) { + return { r, g: g2, b, a: 1 }; + } + return { + r, + g: g2, + b, + a: (`0x100${sa}` - 65536) / 255 + }; +} +var MapPolygon = defineSystemComponent({ + name: "MapPolygon", + props: props$3, + setup(props2) { + let polygonIns; + const onMapReady = inject("onMapReady"); + onMapReady((map, maps2, trigger) => { + function drawPolygon() { + const { + points, + strokeWidth, + strokeColor, + dashArray, + fillColor, + zIndex + } = props2; + const path = points.map((item) => { + const { + latitude, + longitude + } = item; + return new maps2.LatLng(latitude, longitude); + }); + const { + r: fcR, + g: fcG, + b: fcB, + a: fcA + } = hexToRgba(fillColor); + const { + r: scR, + g: scG, + b: scB, + a: scA + } = hexToRgba(strokeColor); + const polygonOptions = { + clickable: true, + cursor: "crosshair", + editable: false, + map, + fillColor: "", + path, + strokeColor: "", + strokeDashStyle: dashArray.some((item) => item > 0) ? "dash" : "solid", + strokeWeight: strokeWidth, + visible: true, + zIndex + }; + if (maps2.Color) { + polygonOptions.fillColor = new maps2.Color(fcR, fcG, fcB, fcA); + polygonOptions.strokeColor = new maps2.Color(scR, scG, scB, scA); + } else { + polygonOptions.fillColor = `rgb(${fcR}, ${fcG}, ${fcB})`; + polygonOptions.fillOpacity = fcA; + polygonOptions.strokeColor = `rgb(${scR}, ${scG}, ${scB})`; + polygonOptions.strokeOpacity = scA; + } + if (polygonIns) { + polygonIns.setOptions(polygonOptions); + return; + } + polygonIns = new maps2.Polygon(polygonOptions); + } + drawPolygon(); + watch(props2, drawPolygon); + }); + onUnmounted(() => { + polygonIns.setMap(null); + }); + return () => null; + } +}); const props$2 = { id: { type: String, @@ -20081,6 +20213,10 @@ const props$2 = { default() { return []; } + }, + polygons: { + type: Array, + default: () => [] } }; function getPoints(points) { @@ -20391,7 +20527,7 @@ var Map$1 = /* @__PURE__ */ defineBuiltInComponent({ "style": "width: 100%; height: 100%; position: relative; overflow: hidden" }, null, 512), props2.markers.map((item) => item.id && createVNode(MapMarker, mergeProps({ "key": item.id - }, item), null, 16)), props2.polyline.map((item) => createVNode(MapPolyline, item, null, 16)), props2.circles.map((item) => createVNode(MapCircle, item, null, 16)), props2.controls.map((item) => createVNode(MapControl, item, null, 16)), props2.showLocation && createVNode(MapLocation, null, null), createVNode("div", { + }, item), null, 16)), props2.polyline.map((item) => createVNode(MapPolyline, item, null, 16)), props2.circles.map((item) => createVNode(MapCircle, item, null, 16)), props2.controls.map((item) => createVNode(MapControl, item, null, 16)), props2.showLocation && createVNode(MapLocation, null, null), props2.polygons.map((item) => createVNode(MapPolygon, item, null, 16)), createVNode("div", { "style": "position: absolute;top: 0;width: 100%;height: 100%;overflow: hidden;pointer-events: none;" }, [slots.default && slots.default()])], 8, ["id"]); }; @@ -21254,40 +21390,6 @@ const UniServiceJSBridge$1 = /* @__PURE__ */ extend(ServiceJSBridge, { UniViewJSBridge.subscribeHandler(event, args, pageId); } }); -function hexToRgba(hex) { - let r; - let g2; - let b; - hex = hex.replace("#", ""); - if (hex.length === 6) { - r = hex.substring(0, 2); - g2 = hex.substring(2, 4); - b = hex.substring(4, 6); - } else if (hex.length === 3) { - r = hex.substring(0, 1); - g2 = hex.substring(1, 2); - b = hex.substring(2, 3); - } else { - return { r: 0, g: 0, b: 0 }; - } - if (r.length === 1) { - r += r; - } - if (g2.length === 1) { - g2 += g2; - } - if (b.length === 1) { - b += b; - } - r = parseInt(r, 16); - g2 = parseInt(g2, 16); - b = parseInt(b, 16); - return { - r, - g: g2, - b - }; -} function usePageHeadTransparentBackgroundColor(backgroundColor) { const { r, g: g2, b } = hexToRgba(backgroundColor); return `rgba(${r},${g2},${b},0)`;