ublo-lib 1.12.8 → 1.12.10

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.
@@ -6,6 +6,7 @@ declare type ItemProps = {
6
6
  path: string;
7
7
  page: string;
8
8
  subs?: ItemProps[];
9
+ exclusions: string[];
9
10
  };
10
11
  declare type BreadcrumbProps = {
11
12
  breadcrumb: ItemProps;
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/common/components/breadcrumb.tsx"],"names":[],"mappings":";AAGA,aAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF,aAAK,eAAe,GAAG;IACrB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA0CF,QAAA,MAAM,UAAU,+BAAqC,eAAe,gBAInE,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/common/components/breadcrumb.tsx"],"names":[],"mappings":";AAGA,aAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG;IACrB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAqDF,QAAA,MAAM,UAAU,+BAAqC,eAAe,gBAInE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,23 +1,24 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from "ublo/link";
3
- const Item = ({ page, path, itemTitle, nextItem, isCurrent }) => {
3
+ const Item = ({ name, page, path, itemTitle, nextItem, isCurrent, exclusions, }) => {
4
4
  const hasTemplate = page !== undefined;
5
5
  const isExternalUrl = /^((http|https):\/\/)/.test(path);
6
6
  const noHref = isCurrent || !hasTemplate;
7
+ const isExcluded = !isCurrent && exclusions.includes(name);
7
8
  const Tag = isExternalUrl ? "a" : noHref ? "span" : Link;
8
9
  const linkProps = { title: itemTitle, page, as: path };
9
10
  const spanProps = { dangerouslySetInnerHTML: { __html: itemTitle } };
10
11
  const anchorProps = { ...spanProps, href: path };
11
12
  const props = isExternalUrl ? anchorProps : noHref ? spanProps : linkProps;
12
- return (_jsxs(_Fragment, { children: [_jsx(Tag, { className: "breadcrumb__item", ...props }), nextItem] }));
13
+ return (_jsxs(_Fragment, { children: [!isExcluded && _jsx(Tag, { className: "breadcrumb__item", ...props }), nextItem] }));
13
14
  };
14
15
  const Items = ({ rawItem, exclusions }) => {
15
- const { next, title, path, page, shortTitle } = rawItem;
16
+ const { next, name, title, path, page, shortTitle } = rawItem;
16
17
  const isCurrent = next === undefined;
17
18
  const isNextExcluded = !isCurrent && exclusions.includes(next.name);
18
19
  const itemToRender = isNextExcluded ? next.next : next;
19
20
  const nextItem = !isCurrent ? (_jsx(Items, { rawItem: itemToRender, exclusions: exclusions })) : null;
20
- return (_jsx(Item, { page: page, path: path, itemTitle: shortTitle || title, nextItem: nextItem, isCurrent: isCurrent }));
21
+ return (_jsx(Item, { name: name, page: page, path: path, itemTitle: shortTitle || title, nextItem: nextItem, isCurrent: isCurrent, exclusions: exclusions }));
21
22
  };
22
23
  const Breadcrumb = ({ breadcrumb, exclusions = [] }) => (_jsx("div", { className: "breadcrumb", children: _jsx(Items, { rawItem: breadcrumb, exclusions: exclusions }) }));
23
24
  export default Breadcrumb;
@@ -54,7 +54,8 @@ const CustomContactForm = ({
54
54
  data,
55
55
  fields,
56
56
  subjectPrefix: subject?.prefix,
57
- subjectSuffix: subject?.suffix
57
+ subjectSuffix: subject?.suffix,
58
+ kind
58
59
  });
59
60
  if (error) {
60
61
  snackbar.show({
@@ -131,7 +132,7 @@ const CustomContactForm = ({
131
132
  settings: settings,
132
133
  presets: presets?.values
133
134
  }, key))
134
- }, formKey), _jsxs("div", {
135
+ }), _jsxs("div", {
135
136
  className: styles.bottom,
136
137
  children: [presets?.allowReset && _jsx(Button, {
137
138
  className: styles.resetButton,
@@ -154,6 +155,6 @@ const CustomContactForm = ({
154
155
  children: Messages.get(lang, "sending")
155
156
  })]
156
157
  })]
157
- });
158
+ }, formKey);
158
159
  };
159
160
  export default React.memo(CustomContactFormWithSnackbar);
@@ -25,14 +25,7 @@ export const getInitialFormState = (fields, presets) => Object.keys(fields).redu
25
25
  } = field;
26
26
  if (type === "title") return acc;
27
27
  if (key === "subject") {
28
- const value = presets?.[key] ?? "";
29
- return {
30
- ...acc,
31
- [key]: {
32
- value,
33
- valid: true
34
- }
35
- };
28
+ return acc;
36
29
  }
37
30
  if (type === "checkbox") {
38
31
  const value = presets?.[key] ?? false;
@@ -92,7 +85,8 @@ export const send = async ({
92
85
  data,
93
86
  fields,
94
87
  subjectPrefix,
95
- subjectSuffix
88
+ subjectSuffix,
89
+ kind
96
90
  }) => {
97
91
  const endpoint = `https://contacts.valraiso.net/api/contact/${site}`;
98
92
  const dataKeys = Object.keys(data);
@@ -116,6 +110,9 @@ export const send = async ({
116
110
  if (subjectSuffix) {
117
111
  formData.append("subjectSuffix", subjectSuffix);
118
112
  }
113
+ if (kind) {
114
+ formData.append("kind", kind);
115
+ }
119
116
  const response = await fetch(endpoint, {
120
117
  method: "POST",
121
118
  body: formData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.12.8",
3
+ "version": "1.12.10",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "leaflet": "^1.9.1",