@saasquatch/mint-components 2.1.10-59 → 2.1.10-60

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.
@@ -19,7 +19,7 @@ const useRegistrationFormState = require('./useRegistrationFormState-4fe5b770.js
19
19
  const sqmPortalRegistrationFormView = require('./sqm-portal-registration-form-view-a45f7a52.js');
20
20
  const reRender = require('./re-render-72a0ef45.js');
21
21
  const useChildElements = require('./useChildElements-041127d7.js');
22
- require('./luxon-c1ad356a.js');
22
+ const luxon = require('./luxon-c1ad356a.js');
23
23
  const index$1 = require('./index-8c6255f5.js');
24
24
  const imageUrl = require('./imageUrl-a7880cab.js');
25
25
  const emailRegistrationView = require('./email-registration-view-306c8878.js');
@@ -8128,7 +8128,8 @@ function UserAttributeView(props) {
8128
8128
  const sheet = JSS.createStyleSheet(style);
8129
8129
  const styleString = sheet.toString();
8130
8130
  const loadingSkeleton = (index.h("sqm-skeleton", { width: "200px", height: "20px" }));
8131
- return (props.value && (index.h(index.Host, null,
8131
+ const hasValue = props.value !== null && props.value !== undefined && props.value !== "";
8132
+ return (hasValue && (index.h(index.Host, null,
8132
8133
  index.h("style", null, styleString),
8133
8134
  index.h("p", { class: sheet.classes.P, part: "sqm-base" }, props.loading ? loadingSkeleton : props.value))));
8134
8135
  }
@@ -8148,7 +8149,10 @@ function useUserAttribute(props) {
8148
8149
  const res = index_module.wn(GET_CUSTOM_FIELDS, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
8149
8150
  const loading = res.loading;
8150
8151
  const customFields = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.customFields;
8151
- const value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
8152
+ let value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
8153
+ if (props.value === "lastSeenDate" && typeof value === "number") {
8154
+ value = luxon.luxon.DateTime.fromMillis(value).toLocaleString(luxon.luxon.DateTime.DATE_MED);
8155
+ }
8152
8156
  return {
8153
8157
  loading,
8154
8158
  value,
@@ -13,7 +13,8 @@ export function UserAttributeView(props) {
13
13
  const sheet = createStyleSheet(style);
14
14
  const styleString = sheet.toString();
15
15
  const loadingSkeleton = (h("sqm-skeleton", { width: "200px", height: "20px" }));
16
- return (props.value && (h(Host, null,
16
+ const hasValue = props.value !== null && props.value !== undefined && props.value !== "";
17
+ return (hasValue && (h(Host, null,
17
18
  h("style", null, styleString),
18
19
  h("p", { class: sheet.classes.P, part: "sqm-base" }, props.loading ? loadingSkeleton : props.value))));
19
20
  }
@@ -7,7 +7,7 @@ import { useUserAttribute } from "./useUserAttribute";
7
7
  /**
8
8
  * @uiName User Attribute
9
9
  * @exampleGroup Advanced
10
- * @example User Attribute - <sqm-user-attribute value="firstName"></sqm-user-attribute>
10
+ * @example User Attribute - <sqm-user-attribute value="lastSeenDate"></sqm-user-attribute>
11
11
  */
12
12
  export class UserAttribute {
13
13
  constructor() {
@@ -1,5 +1,6 @@
1
1
  import { useQuery, useUserIdentity } from "@saasquatch/component-boilerplate";
2
2
  import { gql } from "graphql-request";
3
+ import { DateTime } from "luxon";
3
4
  const GET_CUSTOM_FIELDS = gql `
4
5
  query getCustomFields {
5
6
  viewer {
@@ -15,7 +16,10 @@ export function useUserAttribute(props) {
15
16
  const res = useQuery(GET_CUSTOM_FIELDS, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
16
17
  const loading = res.loading;
17
18
  const customFields = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.customFields;
18
- const value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
19
+ let value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
20
+ if (props.value === "lastSeenDate" && typeof value === "number") {
21
+ value = DateTime.fromMillis(value).toLocaleString(DateTime.DATE_MED);
22
+ }
19
23
  return {
20
24
  loading,
21
25
  value,
@@ -15,7 +15,7 @@ import { R as REGISTRATION_FORM_STATE_CONTEXT, a as useRegistrationForm } from '
15
15
  import { P as PortalRegistrationFormView } from './sqm-portal-registration-form-view-79265df5.js';
16
16
  import { a as useRequestRerender } from './re-render-f30aeb6b.js';
17
17
  import { u as useChildElements } from './useChildElements-9bccfb72.js';
18
- import './luxon-1be92a8e.js';
18
+ import { l as luxon } from './luxon-1be92a8e.js';
19
19
  import { p as pathToRegexp } from './index-ffa26b43.js';
20
20
  import { o as optimizeCloudinaryUrl } from './imageUrl-4775f17b.js';
21
21
  import { E as EmailRegistrationView } from './email-registration-view-4cdb4129.js';
@@ -8124,7 +8124,8 @@ function UserAttributeView(props) {
8124
8124
  const sheet = createStyleSheet(style);
8125
8125
  const styleString = sheet.toString();
8126
8126
  const loadingSkeleton = (h$1("sqm-skeleton", { width: "200px", height: "20px" }));
8127
- return (props.value && (h$1(Host, null,
8127
+ const hasValue = props.value !== null && props.value !== undefined && props.value !== "";
8128
+ return (hasValue && (h$1(Host, null,
8128
8129
  h$1("style", null, styleString),
8129
8130
  h$1("p", { class: sheet.classes.P, part: "sqm-base" }, props.loading ? loadingSkeleton : props.value))));
8130
8131
  }
@@ -8144,7 +8145,10 @@ function useUserAttribute(props) {
8144
8145
  const res = wn(GET_CUSTOM_FIELDS, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
8145
8146
  const loading = res.loading;
8146
8147
  const customFields = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.viewer) === null || _b === void 0 ? void 0 : _b.customFields;
8147
- const value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
8148
+ let value = customFields === null || customFields === void 0 ? void 0 : customFields[props.value];
8149
+ if (props.value === "lastSeenDate" && typeof value === "number") {
8150
+ value = luxon.DateTime.fromMillis(value).toLocaleString(luxon.DateTime.DATE_MED);
8151
+ }
8148
8152
  return {
8149
8153
  loading,
8150
8154
  value,