@brikka/locations 1.0.11 → 1.0.13
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/dist/index.cjs +20 -21
- package/dist/index.d.ts +2 -21
- package/dist/index.js +5 -5
- package/dist/lib/AddLocationButton.d.ts +11 -0
- package/dist/lib/SidebarMapsCard.d.ts +8 -0
- package/package.json +17 -25
- package/dist/index.d.cts +0 -21
package/dist/index.cjs
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var jsxRuntime = require('@soperio/jsx-runtime');
|
|
3
4
|
var admin = require('@compill/admin');
|
|
4
5
|
var form = require('@compill/form');
|
|
5
6
|
var formMaps = require('@compill/form-maps');
|
|
6
7
|
var hooks = require('@compill/hooks');
|
|
7
8
|
var js = require('@mdi/js');
|
|
8
9
|
var Yup = require('yup');
|
|
9
|
-
var jsxRuntime = require('@soperio/jsx-runtime');
|
|
10
10
|
var components = require('@compill/components');
|
|
11
11
|
var next = require('@compill/next');
|
|
12
12
|
var ui = require('@valerya/ui');
|
|
13
13
|
var layout = require('@brikka/layout');
|
|
14
14
|
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
function _interopNamespaceDefault(e) {
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
25
26
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n.default = e;
|
|
30
|
-
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
n.default = e;
|
|
29
|
+
return Object.freeze(n);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
var Yup__namespace = /*#__PURE__*/
|
|
32
|
+
var Yup__namespace = /*#__PURE__*/_interopNamespaceDefault(Yup);
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
var editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
|
|
34
|
+
const editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
|
|
37
35
|
formMaps.mapsHelper("location", `Search a ${locationTypeLabel}`, lat, lng, mapZoom),
|
|
38
36
|
form.FormHelper.condition("location", (location) => location != null && Object.keys(location).length > 0, form.FormHelper.array(
|
|
39
37
|
form.FormHelper.divider(),
|
|
@@ -41,11 +39,11 @@ var editForm = (lat, lng, mapZoom, locationTypeLabel) => form.FormHelper.array(
|
|
|
41
39
|
form.FormHelper.input("map.addressStreet", "Address", false, void 0, { disabled: true })
|
|
42
40
|
))
|
|
43
41
|
);
|
|
44
|
-
|
|
42
|
+
const editInitialValues = () => ({
|
|
45
43
|
type: "google",
|
|
46
44
|
location: {}
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
const editSchema = Yup__namespace.object().shape({
|
|
49
47
|
// name: Yup.string().required("Please set a name for your organisation"),
|
|
50
48
|
// type: Yup.string().required("Please select a type"),
|
|
51
49
|
});
|
|
@@ -75,6 +73,7 @@ function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel = "locati
|
|
|
75
73
|
)
|
|
76
74
|
] });
|
|
77
75
|
}
|
|
76
|
+
|
|
78
77
|
function SidebarMapsCard({ title, location }) {
|
|
79
78
|
const copy = hooks.useCopyToClipboard(location?.address ?? location?.name ?? "", "Address copied!");
|
|
80
79
|
const googleMapsLink = `https://www.google.com/maps/search/?api=1&query=${location?.lat},${location?.lng}`;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Location } from '@compill/models';
|
|
4
|
-
|
|
5
|
-
interface NewLocationButtonProps extends ButtonBarButtonProps {
|
|
6
|
-
api: API<Location>;
|
|
7
|
-
lat: number;
|
|
8
|
-
lng: number;
|
|
9
|
-
mapZoom: number;
|
|
10
|
-
locationTypeLabel?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
|
|
13
|
-
|
|
14
|
-
interface SidebarMapsCardProps {
|
|
15
|
-
location?: Location;
|
|
16
|
-
}
|
|
17
|
-
declare function SidebarMapsCard({ title, location }: {
|
|
18
|
-
title?: string;
|
|
19
|
-
} & SidebarMapsCardProps): JSX.Element | null;
|
|
20
|
-
|
|
21
|
-
export { NewLocationButton, type NewLocationButtonProps, SidebarMapsCard };
|
|
1
|
+
export * from "./lib/AddLocationButton";
|
|
2
|
+
export * from "./lib/SidebarMapsCard";
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from '@soperio/jsx-runtime';
|
|
1
2
|
import { ButtonBarButton, ItemEditDialog } from '@compill/admin';
|
|
2
3
|
import { FormHelper } from '@compill/form';
|
|
3
4
|
import { mapsHelper } from '@compill/form-maps';
|
|
4
5
|
import { useModal, useCopyToClipboard } from '@compill/hooks';
|
|
5
6
|
import { mdiPlus, mdiMapMarker, mdiContentCopy } from '@mdi/js';
|
|
6
7
|
import * as Yup from 'yup';
|
|
7
|
-
import { jsxs, Fragment, jsx } from '@soperio/jsx-runtime';
|
|
8
8
|
import { FlexCenter } from '@compill/components';
|
|
9
9
|
import { NextImageFill } from '@compill/next';
|
|
10
10
|
import { IconButton } from '@valerya/ui';
|
|
11
11
|
import { SidebarCard } from '@brikka/layout';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
var editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
|
|
13
|
+
const editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
|
|
15
14
|
mapsHelper("location", `Search a ${locationTypeLabel}`, lat, lng, mapZoom),
|
|
16
15
|
FormHelper.condition("location", (location) => location != null && Object.keys(location).length > 0, FormHelper.array(
|
|
17
16
|
FormHelper.divider(),
|
|
@@ -19,11 +18,11 @@ var editForm = (lat, lng, mapZoom, locationTypeLabel) => FormHelper.array(
|
|
|
19
18
|
FormHelper.input("map.addressStreet", "Address", false, void 0, { disabled: true })
|
|
20
19
|
))
|
|
21
20
|
);
|
|
22
|
-
|
|
21
|
+
const editInitialValues = () => ({
|
|
23
22
|
type: "google",
|
|
24
23
|
location: {}
|
|
25
24
|
});
|
|
26
|
-
|
|
25
|
+
const editSchema = Yup.object().shape({
|
|
27
26
|
// name: Yup.string().required("Please set a name for your organisation"),
|
|
28
27
|
// type: Yup.string().required("Please select a type"),
|
|
29
28
|
});
|
|
@@ -53,6 +52,7 @@ function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel = "locati
|
|
|
53
52
|
)
|
|
54
53
|
] });
|
|
55
54
|
}
|
|
55
|
+
|
|
56
56
|
function SidebarMapsCard({ title, location }) {
|
|
57
57
|
const copy = useCopyToClipboard(location?.address ?? location?.name ?? "", "Address copied!");
|
|
58
58
|
const googleMapsLink = `https://www.google.com/maps/search/?api=1&query=${location?.lat},${location?.lng}`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonBarButtonProps } from "@compill/admin";
|
|
2
|
+
import { API } from "@compill/api";
|
|
3
|
+
import { Location } from "@compill/models";
|
|
4
|
+
export interface NewLocationButtonProps extends ButtonBarButtonProps {
|
|
5
|
+
api: API<Location>;
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
mapZoom: number;
|
|
9
|
+
locationTypeLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brikka/locations",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"module": "./dist/index.js",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
9
8
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"require": "./dist/index.cjs"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
9
|
"devDependencies": {
|
|
18
10
|
"eslint": "^9.38.0",
|
|
19
11
|
"typescript": "5.9.2",
|
|
@@ -28,19 +20,19 @@
|
|
|
28
20
|
"dependencies": {
|
|
29
21
|
"@mdi/js": "^7.4.47",
|
|
30
22
|
"yup": "^1.1.0",
|
|
31
|
-
"@soperio/
|
|
32
|
-
"@
|
|
33
|
-
"@compill/
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@compill/
|
|
37
|
-
"@
|
|
38
|
-
"@compill/
|
|
39
|
-
"@compill/
|
|
40
|
-
"@compill/
|
|
41
|
-
"@compill/
|
|
42
|
-
"@compill/
|
|
43
|
-
"@compill/models": "1.0.
|
|
23
|
+
"@soperio/jsx-runtime": "1.0.24",
|
|
24
|
+
"@brikka/layout": "1.0.87",
|
|
25
|
+
"@compill/admin": "1.0.109",
|
|
26
|
+
"@soperio/react": "1.0.24",
|
|
27
|
+
"@valerya/ui": "1.0.27",
|
|
28
|
+
"@compill/auth": "1.0.84",
|
|
29
|
+
"@compill/components": "1.0.57",
|
|
30
|
+
"@compill/api": "1.0.64",
|
|
31
|
+
"@compill/form": "1.0.74",
|
|
32
|
+
"@compill/form-maps": "1.0.21",
|
|
33
|
+
"@compill/hooks": "1.0.50",
|
|
34
|
+
"@compill/next": "1.0.64",
|
|
35
|
+
"@compill/models": "1.0.19"
|
|
44
36
|
},
|
|
45
37
|
"publishConfig": {
|
|
46
38
|
"access": "public"
|
|
@@ -49,7 +41,7 @@
|
|
|
49
41
|
"dist"
|
|
50
42
|
],
|
|
51
43
|
"scripts": {
|
|
52
|
-
"build": "
|
|
44
|
+
"build": "rimraf dist && rollup -c && tsc -p tsconfig.build.json",
|
|
53
45
|
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
54
46
|
"lint": "eslint . --max-warnings 0",
|
|
55
47
|
"check-types": "tsc --noEmit"
|
package/dist/index.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ButtonBarButtonProps } from '@compill/admin';
|
|
2
|
-
import { API } from '@compill/api';
|
|
3
|
-
import { Location } from '@compill/models';
|
|
4
|
-
|
|
5
|
-
interface NewLocationButtonProps extends ButtonBarButtonProps {
|
|
6
|
-
api: API<Location>;
|
|
7
|
-
lat: number;
|
|
8
|
-
lng: number;
|
|
9
|
-
mapZoom: number;
|
|
10
|
-
locationTypeLabel?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function NewLocationButton({ api, lat, lng, mapZoom, locationTypeLabel, ...props }: NewLocationButtonProps): JSX.Element;
|
|
13
|
-
|
|
14
|
-
interface SidebarMapsCardProps {
|
|
15
|
-
location?: Location;
|
|
16
|
-
}
|
|
17
|
-
declare function SidebarMapsCard({ title, location }: {
|
|
18
|
-
title?: string;
|
|
19
|
-
} & SidebarMapsCardProps): JSX.Element | null;
|
|
20
|
-
|
|
21
|
-
export { NewLocationButton, type NewLocationButtonProps, SidebarMapsCard };
|