@saasquatch/mint-components 2.1.10-56 → 2.1.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.
- package/dist/cjs/{ShadowViewAddon-a26deae6.js → ShadowViewAddon-c97e80de.js} +422 -19
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/{sqm-big-stat_46.cjs.entry.js → sqm-big-stat_45.cjs.entry.js} +264 -89
- package/dist/cjs/sqm-code-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
- package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-portal-container-view-70a47420.js → sqm-portal-container-view-757f921b.js} +5 -6
- package/dist/cjs/{sqm-portal-email-verification-view-c81fe7f1.js → sqm-portal-email-verification-view-abb773a7.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/sqm-portal-forgot-password_6.cjs.entry.js +5 -5
- package/dist/cjs/{sqm-portal-profile-view-639337e3.js → sqm-portal-profile-view-3515e1e5.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-registration-form-view-020f661c.js → sqm-portal-registration-form-view-a45f7a52.js} +1 -1
- package/dist/cjs/{sqm-portal-reset-password-view-6b1acd90.js → sqm-portal-reset-password-view-a767b044.js} +1 -1
- package/dist/cjs/sqm-portal-reset-password.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-verify-email-view-424e406a.js → sqm-portal-verify-email-view-717d0633.js} +1 -1
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table-customer-note-cell.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +168 -59
- package/dist/cjs/{sqm-text-span-view-f274fdf2.js → sqm-text-span-view-b9e10f5d.js} +1 -1
- package/dist/cjs/sqm-text-span.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/sqm-password-field/sqm-password-field.js +1 -0
- package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +6 -7
- package/dist/collection/components/sqm-portal-google-login/sqm-portal-google-login.js +1 -1
- package/dist/collection/components/sqm-portal-login/sqm-portal-login.js +1 -1
- package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
- package/dist/collection/components/sqm-share-link/ShareLink.stories.js +136 -11
- package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
- package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +192 -0
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +935 -48
- package/dist/collection/components/sqm-share-link/useShareLink.js +227 -14
- package/dist/collection/components/sqm-stencilbook/sqm-stencilbook.js +0 -2
- package/dist/collection/components/sqm-text-span/sqm-text-span-view.js +1 -1
- package/dist/esm/{ShadowViewAddon-47f1e579.js → ShadowViewAddon-33f1a8f7.js} +424 -22
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/{sqm-big-stat_46.entry.js → sqm-big-stat_45.entry.js} +265 -89
- package/dist/esm/sqm-code-verification.entry.js +1 -1
- package/dist/esm/sqm-email-verification.entry.js +1 -1
- package/dist/esm/sqm-empty_4.entry.js +1 -1
- package/dist/esm/{sqm-portal-container-view-a8c708cd.js → sqm-portal-container-view-200c9df8.js} +6 -7
- package/dist/esm/{sqm-portal-email-verification-view-426370f1.js → sqm-portal-email-verification-view-04528277.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/sqm-portal-forgot-password_6.entry.js +5 -5
- package/dist/esm/{sqm-portal-profile-view-f015fd6a.js → sqm-portal-profile-view-b5ea620f.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
- package/dist/esm/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
- package/dist/esm/sqm-portal-reset-password.entry.js +2 -2
- package/dist/esm/{sqm-portal-verify-email-view-1a638fae.js → sqm-portal-verify-email-view-c61536b7.js} +1 -1
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-rewards-table-customer-note-cell.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +168 -59
- package/dist/esm/{sqm-text-span-view-738acfb3.js → sqm-text-span-view-72f43dff.js} +1 -1
- package/dist/esm/sqm-text-span.entry.js +1 -1
- package/dist/esm-es5/ShadowViewAddon-33f1a8f7.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -0
- package/dist/esm-es5/sqm-code-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-container-view-200c9df8.js +1 -0
- package/dist/esm-es5/{sqm-portal-email-verification-view-426370f1.js → sqm-portal-email-verification-view-04528277.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-forgot-password_6.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-f015fd6a.js → sqm-portal-profile-view-b5ea620f.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-registration-form-view-2f4936ef.js → sqm-portal-registration-form-view-79265df5.js} +1 -1
- package/dist/esm-es5/{sqm-portal-reset-password-view-cfbc0eb0.js → sqm-portal-reset-password-view-f84c04cf.js} +1 -1
- package/dist/esm-es5/sqm-portal-reset-password.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-verify-email-view-1a638fae.js → sqm-portal-verify-email-view-c61536b7.js} +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table-customer-note-cell.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/{sqm-text-span-view-738acfb3.js → sqm-text-span-view-72f43dff.js} +1 -1
- package/dist/esm-es5/sqm-text-span.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-ab0ea688.system.entry.js → p-00b235c5.system.entry.js} +1 -1
- package/dist/mint-components/p-08930b83.js +499 -0
- package/dist/mint-components/p-0b1e90fe.system.js +1 -0
- package/dist/mint-components/p-1021a49f.system.entry.js +1 -0
- package/dist/mint-components/{p-25558a33.entry.js → p-13292317.entry.js} +1 -1
- package/dist/mint-components/{p-d65991d0.entry.js → p-13d1b10d.entry.js} +1 -1
- package/dist/mint-components/{p-d4570314.entry.js → p-1d92c169.entry.js} +1 -1
- package/dist/mint-components/{p-7161e1a6.js → p-2668335b.js} +1 -1
- package/dist/mint-components/{p-6e512063.entry.js → p-3af3e2c1.entry.js} +1 -1
- package/dist/mint-components/{p-5ff7b000.entry.js → p-40bad95a.entry.js} +1 -1
- package/dist/mint-components/{p-f35d856a.system.js → p-43c31fd5.system.js} +1 -1
- package/dist/mint-components/p-5bc5c61e.entry.js +1 -0
- package/dist/mint-components/{p-dac20392.system.js → p-686dd5eb.system.js} +1 -1
- package/dist/mint-components/{p-7b909aa5.system.js → p-7562cd98.system.js} +1 -1
- package/dist/mint-components/p-76271ec4.entry.js +9 -0
- package/dist/mint-components/p-78b40f71.system.js +1 -0
- package/dist/mint-components/{p-cb0a5990.entry.js → p-7939e4af.entry.js} +1 -1
- package/dist/mint-components/{p-e6ace3ab.js → p-832aea99.js} +1 -1
- package/dist/mint-components/{p-a7f52290.entry.js → p-8784539d.entry.js} +21 -29
- package/dist/mint-components/{p-b9f57e84.system.entry.js → p-8899ff38.system.entry.js} +1 -1
- package/dist/mint-components/{p-fbe00c97.system.entry.js → p-892797eb.system.entry.js} +1 -1
- package/dist/mint-components/{p-d997001a.js → p-8962e023.js} +1 -1
- package/dist/mint-components/{p-dd368927.system.entry.js → p-9390586b.system.entry.js} +1 -1
- package/dist/mint-components/{p-3c46b4dd.system.js → p-a4825ec2.system.js} +1 -1
- package/dist/mint-components/{p-058aefe1.entry.js → p-af407cce.entry.js} +1 -1
- package/dist/mint-components/{p-56ca7e3c.js → p-b3ad957c.js} +1 -1
- package/dist/mint-components/{p-70570e4d.system.entry.js → p-b96e90a2.system.entry.js} +1 -1
- package/dist/mint-components/{p-c67f8558.system.entry.js → p-bba16a46.system.entry.js} +1 -1
- package/dist/mint-components/{p-669d52c4.js → p-bee4af5d.js} +1 -1
- package/dist/mint-components/p-c3c8d4ee.system.entry.js +1 -0
- package/dist/mint-components/{p-cabf6326.js → p-c813ec64.js} +1 -1
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/{p-18133026.system.entry.js → p-d3b1ab20.system.entry.js} +1 -1
- package/dist/mint-components/{p-692e14c5.system.js → p-d55c50af.system.js} +1 -1
- package/dist/mint-components/p-dd12c32a.system.entry.js +1 -0
- package/dist/mint-components/p-e30abc44.js +1 -0
- package/dist/mint-components/{p-fb5c9802.entry.js → p-e506bf7f.entry.js} +1 -1
- package/dist/mint-components/{p-aefc6c4f.system.entry.js → p-e9485160.system.entry.js} +1 -1
- package/dist/mint-components/{p-f0baeed0.entry.js → p-f6528f8a.entry.js} +1 -1
- package/dist/mint-components/{p-5141769d.system.entry.js → p-f7ca4cc4.system.entry.js} +1 -1
- package/dist/mint-components/{p-e4f17c21.system.js → p-f8026ed6.system.js} +1 -1
- package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +9 -0
- package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
- package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +41 -0
- package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +195 -2
- package/dist/types/components/sqm-share-link/useShareLink.d.ts +33 -4
- package/dist/types/components.d.ts +349 -74
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/docs/stats.json +122783 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/collection/components/sqm-user-attribute/UserAttribute.stories.js +0 -25
- package/dist/collection/components/sqm-user-attribute/sqm-user-attribute-view.js +0 -19
- package/dist/collection/components/sqm-user-attribute/sqm-user-attribute.js +0 -163
- package/dist/collection/components/sqm-user-attribute/useUserAttribute.js +0 -26
- package/dist/esm-es5/ShadowViewAddon-47f1e579.js +0 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +0 -1
- package/dist/esm-es5/sqm-portal-container-view-a8c708cd.js +0 -1
- package/dist/mint-components/p-0a3d4374.system.entry.js +0 -1
- package/dist/mint-components/p-217dedde.js +0 -463
- package/dist/mint-components/p-2cce6e14.entry.js +0 -9
- package/dist/mint-components/p-55676213.entry.js +0 -1
- package/dist/mint-components/p-8fb1708b.system.entry.js +0 -1
- package/dist/mint-components/p-b699f76e.system.js +0 -1
- package/dist/mint-components/p-b6a1e2ac.js +0 -1
- package/dist/mint-components/p-ce050888.system.js +0 -1
- package/dist/mint-components/p-e3497e0e.system.entry.js +0 -1
- package/dist/types/components/sqm-user-attribute/UserAttribute.stories.d.ts +0 -7
- package/dist/types/components/sqm-user-attribute/sqm-user-attribute-view.d.ts +0 -8
- package/dist/types/components/sqm-user-attribute/sqm-user-attribute.d.ts +0 -42
- package/dist/types/components/sqm-user-attribute/useUserAttribute.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasquatch/mint-components",
|
|
3
3
|
"title": "Mint Components",
|
|
4
|
-
"version": "2.1.10
|
|
4
|
+
"version": "2.1.10",
|
|
5
5
|
"description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
|
|
6
6
|
"icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
|
|
7
7
|
"raisins": "docs/raisins.json",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"workbox-build": "4.3.1"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@raisins/stencil-docs-target": "^1.2.
|
|
74
|
+
"@raisins/stencil-docs-target": "^1.2.1",
|
|
75
75
|
"@saasquatch/component-boilerplate": "^1.6.10",
|
|
76
76
|
"@saasquatch/dom-context-hooks": "^1.0.5",
|
|
77
77
|
"@saasquatch/shoelace": "^1.0.0",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
export default {
|
|
3
|
-
title: "Components/User Attribute",
|
|
4
|
-
};
|
|
5
|
-
export const Default = () => {
|
|
6
|
-
return (h("sqm-user-attribute", { demoData: {
|
|
7
|
-
loading: false,
|
|
8
|
-
value: "impact.com",
|
|
9
|
-
} }));
|
|
10
|
-
};
|
|
11
|
-
export const Loading = () => {
|
|
12
|
-
return (h("sqm-user-attribute", { demoData: {
|
|
13
|
-
loading: true,
|
|
14
|
-
value: "impact.com",
|
|
15
|
-
} }));
|
|
16
|
-
};
|
|
17
|
-
export const WithCustomStyles = () => {
|
|
18
|
-
return (h("sqm-user-attribute", { demoData: {
|
|
19
|
-
loading: false,
|
|
20
|
-
value: "impact.com",
|
|
21
|
-
fontsize: "24px",
|
|
22
|
-
color: "#4CAF50",
|
|
23
|
-
fontweight: "bold",
|
|
24
|
-
} }));
|
|
25
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { createStyleSheet } from "../../styling/JSS";
|
|
3
|
-
export function UserAttributeView(props) {
|
|
4
|
-
const style = {
|
|
5
|
-
P: {
|
|
6
|
-
margin: "0",
|
|
7
|
-
padding: "0",
|
|
8
|
-
fontSize: props.fontsize || "inherit",
|
|
9
|
-
fontWeight: props.fontweight || "inherit",
|
|
10
|
-
color: props.color || "var(--sqm-text)",
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
const sheet = createStyleSheet(style);
|
|
14
|
-
const styleString = sheet.toString();
|
|
15
|
-
const loadingSkeleton = (h("sqm-skeleton", { width: "200px", height: "20px" }));
|
|
16
|
-
return (props.value && (h(Host, null,
|
|
17
|
-
h("style", null, styleString),
|
|
18
|
-
h("p", { class: sheet.classes.P, part: "sqm-base" }, props.loading ? loadingSkeleton : props.value))));
|
|
19
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { isDemo } from "@saasquatch/component-boilerplate";
|
|
2
|
-
import { withHooks } from "@saasquatch/stencil-hooks";
|
|
3
|
-
import { Component, h, Prop, State } from "@stencil/core";
|
|
4
|
-
import deepmerge from "deepmerge";
|
|
5
|
-
import { UserAttributeView, } from "./sqm-user-attribute-view";
|
|
6
|
-
import { useUserAttribute } from "./useUserAttribute";
|
|
7
|
-
/**
|
|
8
|
-
* @uiName User Attribute
|
|
9
|
-
* @exampleGroup Advanced
|
|
10
|
-
* @example User Attribute - <sqm-user-attribute value="firstName" loading-text="..."></sqm-user-attribute>
|
|
11
|
-
*/
|
|
12
|
-
export class UserAttribute {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.ignored = true;
|
|
15
|
-
withHooks(this);
|
|
16
|
-
}
|
|
17
|
-
disconnectedCallback() { }
|
|
18
|
-
render() {
|
|
19
|
-
const props = isDemo() ? useCustomFieldsDemo(this) : useUserAttribute(this);
|
|
20
|
-
return h(UserAttributeView, Object.assign({}, props));
|
|
21
|
-
}
|
|
22
|
-
static get is() { return "sqm-user-attribute"; }
|
|
23
|
-
static get encapsulation() { return "shadow"; }
|
|
24
|
-
static get properties() { return {
|
|
25
|
-
"value": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"mutable": false,
|
|
28
|
-
"complexType": {
|
|
29
|
-
"original": "string",
|
|
30
|
-
"resolved": "string",
|
|
31
|
-
"references": {}
|
|
32
|
-
},
|
|
33
|
-
"required": false,
|
|
34
|
-
"optional": false,
|
|
35
|
-
"docs": {
|
|
36
|
-
"tags": [{
|
|
37
|
-
"text": "Custom field key",
|
|
38
|
-
"name": "uiName"
|
|
39
|
-
}, {
|
|
40
|
-
"text": "customFieldSelector",
|
|
41
|
-
"name": "uiWidget"
|
|
42
|
-
}],
|
|
43
|
-
"text": "The custom field key to display."
|
|
44
|
-
},
|
|
45
|
-
"attribute": "value",
|
|
46
|
-
"reflect": false
|
|
47
|
-
},
|
|
48
|
-
"fontsize": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"mutable": false,
|
|
51
|
-
"complexType": {
|
|
52
|
-
"original": "string",
|
|
53
|
-
"resolved": "string",
|
|
54
|
-
"references": {}
|
|
55
|
-
},
|
|
56
|
-
"required": false,
|
|
57
|
-
"optional": true,
|
|
58
|
-
"docs": {
|
|
59
|
-
"tags": [{
|
|
60
|
-
"text": "Font size",
|
|
61
|
-
"name": "uiName"
|
|
62
|
-
}, {
|
|
63
|
-
"text": "Style",
|
|
64
|
-
"name": "uiGroup"
|
|
65
|
-
}],
|
|
66
|
-
"text": "Font size in pixels."
|
|
67
|
-
},
|
|
68
|
-
"attribute": "fontsize",
|
|
69
|
-
"reflect": false
|
|
70
|
-
},
|
|
71
|
-
"color": {
|
|
72
|
-
"type": "string",
|
|
73
|
-
"mutable": false,
|
|
74
|
-
"complexType": {
|
|
75
|
-
"original": "string",
|
|
76
|
-
"resolved": "string",
|
|
77
|
-
"references": {}
|
|
78
|
-
},
|
|
79
|
-
"required": false,
|
|
80
|
-
"optional": true,
|
|
81
|
-
"docs": {
|
|
82
|
-
"tags": [{
|
|
83
|
-
"text": "Color",
|
|
84
|
-
"name": "uiName"
|
|
85
|
-
}, {
|
|
86
|
-
"text": "color",
|
|
87
|
-
"name": "uiWidget"
|
|
88
|
-
}, {
|
|
89
|
-
"text": "color",
|
|
90
|
-
"name": "format"
|
|
91
|
-
}, {
|
|
92
|
-
"text": "Style",
|
|
93
|
-
"name": "uiGroup"
|
|
94
|
-
}],
|
|
95
|
-
"text": ""
|
|
96
|
-
},
|
|
97
|
-
"attribute": "color",
|
|
98
|
-
"reflect": false
|
|
99
|
-
},
|
|
100
|
-
"fontweight": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"mutable": false,
|
|
103
|
-
"complexType": {
|
|
104
|
-
"original": "string",
|
|
105
|
-
"resolved": "string",
|
|
106
|
-
"references": {}
|
|
107
|
-
},
|
|
108
|
-
"required": false,
|
|
109
|
-
"optional": true,
|
|
110
|
-
"docs": {
|
|
111
|
-
"tags": [{
|
|
112
|
-
"text": "Font weight",
|
|
113
|
-
"name": "uiName"
|
|
114
|
-
}, {
|
|
115
|
-
"text": "Style",
|
|
116
|
-
"name": "uiGroup"
|
|
117
|
-
}],
|
|
118
|
-
"text": ""
|
|
119
|
-
},
|
|
120
|
-
"attribute": "fontweight",
|
|
121
|
-
"reflect": false
|
|
122
|
-
},
|
|
123
|
-
"demoData": {
|
|
124
|
-
"type": "unknown",
|
|
125
|
-
"mutable": false,
|
|
126
|
-
"complexType": {
|
|
127
|
-
"original": "DemoData<UserAttributeViewProps>",
|
|
128
|
-
"resolved": "{ loading?: boolean; value?: string; fontsize?: string; color?: string; fontweight?: string; }",
|
|
129
|
-
"references": {
|
|
130
|
-
"DemoData": {
|
|
131
|
-
"location": "import",
|
|
132
|
-
"path": "../../global/demo"
|
|
133
|
-
},
|
|
134
|
-
"UserAttributeViewProps": {
|
|
135
|
-
"location": "import",
|
|
136
|
-
"path": "./sqm-user-attribute-view"
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"required": false,
|
|
141
|
-
"optional": true,
|
|
142
|
-
"docs": {
|
|
143
|
-
"tags": [{
|
|
144
|
-
"text": undefined,
|
|
145
|
-
"name": "undocumented"
|
|
146
|
-
}, {
|
|
147
|
-
"text": "object",
|
|
148
|
-
"name": "uiType"
|
|
149
|
-
}],
|
|
150
|
-
"text": ""
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}; }
|
|
154
|
-
static get states() { return {
|
|
155
|
-
"ignored": {}
|
|
156
|
-
}; }
|
|
157
|
-
}
|
|
158
|
-
function useCustomFieldsDemo(props) {
|
|
159
|
-
return deepmerge({
|
|
160
|
-
loading: false,
|
|
161
|
-
value: "Custom Field Value",
|
|
162
|
-
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
163
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useQuery, useUserIdentity } from "@saasquatch/component-boilerplate";
|
|
2
|
-
import { gql } from "graphql-request";
|
|
3
|
-
const GET_CUSTOM_FIELDS = gql `
|
|
4
|
-
query getCustomFields {
|
|
5
|
-
viewer {
|
|
6
|
-
... on User {
|
|
7
|
-
customFields
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
export function useUserAttribute(props) {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const user = useUserIdentity();
|
|
15
|
-
const res = useQuery(GET_CUSTOM_FIELDS, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
16
|
-
const loading = res.loading;
|
|
17
|
-
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
|
-
return {
|
|
20
|
-
loading,
|
|
21
|
-
value,
|
|
22
|
-
fontsize: props.fontsize,
|
|
23
|
-
color: props.color,
|
|
24
|
-
fontweight: props.fontweight,
|
|
25
|
-
};
|
|
26
|
-
}
|