@vulcanjs/react-ui 0.6.6-alpha.4 → 0.6.6-y.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Datatable/DatatableFilter.d.ts +1 -1
- package/dist/components/Datatable/DatatableFilter.d.ts.map +1 -1
- package/dist/components/Datatable/others/NewButton.d.ts +1 -1
- package/dist/components/Datatable/others/NewButton.d.ts.map +1 -1
- package/dist/components/LoadingButton.d.ts +1 -1
- package/dist/components/LoadingButton.d.ts.map +1 -1
- package/dist/components/VulcanComponents/defaultVulcanComponents/formComponents.d.ts.map +1 -1
- package/dist/components/VulcanComponents/defaultVulcanComponents/index.d.ts +2 -2
- package/dist/components/VulcanComponents/typings.d.ts +6 -5
- package/dist/components/VulcanComponents/typings.d.ts.map +1 -1
- package/dist/components/core/Button.d.ts +4 -0
- package/dist/components/core/Button.d.ts.map +1 -0
- package/dist/components/core/Loading.d.ts +3 -0
- package/dist/components/core/Loading.d.ts.map +1 -0
- package/dist/components/form/Form/fields.d.ts +1 -1
- package/dist/components/form/FormComponent.d.ts +3 -3
- package/dist/components/form/FormComponentInner.d.ts +3 -6
- package/dist/components/form/core/Form/Form.d.ts +4 -0
- package/dist/components/form/core/Form/Form.d.ts.map +1 -0
- package/dist/components/form/core/Form/fields.d.ts +22 -0
- package/dist/components/form/core/Form/fields.d.ts.map +1 -0
- package/dist/components/form/core/Form/index.d.ts +3 -0
- package/dist/components/form/core/Form/index.d.ts.map +1 -0
- package/dist/components/form/core/Form/typings.d.ts +76 -0
- package/dist/components/form/core/Form/typings.d.ts.map +1 -0
- package/dist/components/form/core/Form/utils.d.ts +2 -0
- package/dist/components/form/core/Form/utils.d.ts.map +1 -0
- package/dist/components/form/core/FormComponent.d.ts +31 -0
- package/dist/components/form/core/FormComponent.d.ts.map +1 -0
- package/dist/components/form/core/FormComponentInner.d.ts +32 -0
- package/dist/components/form/core/FormComponentInner.d.ts.map +1 -0
- package/dist/components/form/core/FormComponentLoader.d.ts +15 -0
- package/dist/components/form/core/FormComponentLoader.d.ts.map +1 -0
- package/dist/components/form/core/FormContainer.d.ts +18 -0
- package/dist/components/form/core/FormContainer.d.ts.map +1 -0
- package/dist/components/form/core/FormContext.d.ts +25 -0
- package/dist/components/form/core/FormContext.d.ts.map +1 -0
- package/dist/components/form/core/FormGroup.d.ts +30 -0
- package/dist/components/form/core/FormGroup.d.ts.map +1 -0
- package/dist/components/form/core/index.d.ts +7 -0
- package/dist/components/form/core/index.d.ts.map +1 -0
- package/dist/components/form/elements/FieldErrors.d.ts +5 -0
- package/dist/components/form/elements/FieldErrors.d.ts.map +1 -0
- package/dist/components/form/elements/FormElement.d.ts +4 -0
- package/dist/components/form/elements/FormElement.d.ts.map +1 -0
- package/dist/components/form/elements/FormError.d.ts +11 -0
- package/dist/components/form/elements/FormError.d.ts.map +1 -0
- package/dist/components/form/elements/FormErrors.d.ts +3 -0
- package/dist/components/form/elements/FormErrors.d.ts.map +1 -0
- package/dist/components/form/elements/FormLayout.d.ts +10 -0
- package/dist/components/form/elements/FormLayout.d.ts.map +1 -0
- package/dist/components/form/elements/FormSubmit.d.ts +38 -0
- package/dist/components/form/elements/FormSubmit.d.ts.map +1 -0
- package/dist/components/form/elements/index.d.ts +7 -0
- package/dist/components/form/elements/index.d.ts.map +1 -0
- package/dist/components/form/hooks/useBlockTransition/block.d.ts +4 -0
- package/dist/components/form/hooks/useBlockTransition/block.d.ts.map +1 -0
- package/dist/components/form/hooks/useBlockTransition/useBlockTransition.d.ts +5 -0
- package/dist/components/form/hooks/useBlockTransition/useBlockTransition.d.ts.map +1 -0
- package/dist/components/form/hooks/useWarnOnUnsaved/index.d.ts +2 -0
- package/dist/components/form/hooks/useWarnOnUnsaved/index.d.ts.map +1 -0
- package/dist/components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.d.ts +5 -0
- package/dist/components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +4 -3
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/AutocompleteMultiple.d.ts +1 -1
- package/dist/components/form/inputs/AutocompleteMultiple.d.ts.map +1 -1
- package/dist/components/form/inputs/BasicInputs.d.ts +3 -7
- package/dist/components/form/inputs/BasicInputs.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkboxgroup.d.ts +1 -1
- package/dist/components/form/inputs/Checkboxgroup.d.ts.map +1 -1
- package/dist/components/form/inputs/FormItem.d.ts +4 -0
- package/dist/components/form/inputs/FormItem.d.ts.map +1 -0
- package/dist/components/form/inputs/FormOptionLabel.d.ts +7 -0
- package/dist/components/form/inputs/FormOptionLabel.d.ts.map +1 -0
- package/dist/components/form/inputs/RadioGroup.d.ts +4 -0
- package/dist/components/form/inputs/RadioGroup.d.ts.map +1 -0
- package/dist/components/form/inputs/SelectInputs.d.ts +5 -0
- package/dist/components/form/inputs/SelectInputs.d.ts.map +1 -0
- package/dist/components/form/inputs/consts.d.ts +1 -1
- package/dist/components/form/inputs/consts.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +8 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -0
- package/dist/components/form/intl/FormIntl.d.ts +15 -0
- package/dist/components/form/intl/FormIntl.d.ts.map +1 -0
- package/dist/components/form/nested/FormNestedArray.d.ts +26 -0
- package/dist/components/form/nested/FormNestedArray.d.ts.map +1 -0
- package/dist/components/form/nested/FormNestedArrayLayout.d.ts +18 -0
- package/dist/components/form/nested/FormNestedArrayLayout.d.ts.map +1 -0
- package/dist/components/form/nested/FormNestedDivider.d.ts +13 -0
- package/dist/components/form/nested/FormNestedDivider.d.ts.map +1 -0
- package/dist/components/form/nested/FormNestedItem.d.ts +52 -0
- package/dist/components/form/nested/FormNestedItem.d.ts.map +1 -0
- package/dist/components/form/nested/FormNestedObject.d.ts +35 -0
- package/dist/components/form/nested/FormNestedObject.d.ts.map +1 -0
- package/dist/components/form/nested/index.d.ts +6 -0
- package/dist/components/form/nested/index.d.ts.map +1 -0
- package/dist/components/form/utils/formFragments.d.ts +16 -0
- package/dist/components/form/utils/formFragments.d.ts.map +1 -0
- package/dist/components/form/utils/path_utils.d.ts +6 -0
- package/dist/components/form/utils/path_utils.d.ts.map +1 -0
- package/dist/components/form/utils/schema_utils.d.ts +14 -0
- package/dist/components/form/utils/schema_utils.d.ts.map +1 -0
- package/dist/components/form/utils/ui_utils.d.ts +3 -0
- package/dist/components/form/utils/ui_utils.d.ts.map +1 -0
- package/dist/components/form/utils/utils.d.ts +17 -0
- package/dist/components/form/utils/utils.d.ts.map +1 -0
- package/dist/index.js +792 -712
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/form/FieldErrors.d.ts.map +0 -1
- package/dist/components/form/Form/Form.d.ts.map +0 -1
- package/dist/components/form/Form/fields.d.ts.map +0 -1
- package/dist/components/form/Form/index.d.ts.map +0 -1
- package/dist/components/form/Form/typings.d.ts.map +0 -1
- package/dist/components/form/Form/utils.d.ts.map +0 -1
- package/dist/components/form/FormComponent.d.ts.map +0 -1
- package/dist/components/form/FormComponentInner.d.ts.map +0 -1
- package/dist/components/form/FormComponentLoader.d.ts.map +0 -1
- package/dist/components/form/FormContainer.d.ts.map +0 -1
- package/dist/components/form/FormContext.d.ts.map +0 -1
- package/dist/components/form/FormElement.d.ts.map +0 -1
- package/dist/components/form/FormError.d.ts.map +0 -1
- package/dist/components/form/FormErrors.d.ts.map +0 -1
- package/dist/components/form/FormGroup.d.ts.map +0 -1
- package/dist/components/form/FormIntl.d.ts.map +0 -1
- package/dist/components/form/FormLayout.d.ts.map +0 -1
- package/dist/components/form/FormNestedArray.d.ts.map +0 -1
- package/dist/components/form/FormNestedArrayLayout.d.ts.map +0 -1
- package/dist/components/form/FormNestedDivider.d.ts.map +0 -1
- package/dist/components/form/FormNestedItem.d.ts.map +0 -1
- package/dist/components/form/FormNestedObject.d.ts.map +0 -1
- package/dist/components/form/FormOptionLabel.d.ts.map +0 -1
- package/dist/components/form/FormSubmit.d.ts.map +0 -1
- package/dist/components/form/core/Button.d.ts.map +0 -1
- package/dist/components/form/core/Loading.d.ts.map +0 -1
- package/dist/components/form/modules/formFragments.d.ts.map +0 -1
- package/dist/components/form/modules/path_utils.d.ts.map +0 -1
- package/dist/components/form/modules/schema_utils.d.ts.map +0 -1
- package/dist/components/form/modules/utils.d.ts.map +0 -1
- package/dist/components/form/ui_utils.d.ts.map +0 -1
- package/dist/components/form/useBlockTransition/block.d.ts.map +0 -1
- package/dist/components/form/useBlockTransition/useBlockTransition.d.ts.map +0 -1
- package/dist/components/form/useWarnOnUnsaved/index.d.ts.map +0 -1
- package/dist/components/form/useWarnOnUnsaved/useWarnOnUnsaved.d.ts.map +0 -1
package/dist/index.js
CHANGED
@@ -5872,7 +5872,7 @@ init_esm_shims();
|
|
5872
5872
|
// components/form/index.ts
|
5873
5873
|
init_esm_shims();
|
5874
5874
|
|
5875
|
-
// components/form/FormContainer.tsx
|
5875
|
+
// components/form/core/FormContainer.tsx
|
5876
5876
|
init_esm_shims();
|
5877
5877
|
import React5 from "react";
|
5878
5878
|
|
@@ -8169,7 +8169,7 @@ var extras = {
|
|
8169
8169
|
gql["default"] = gql;
|
8170
8170
|
var lib_default = gql;
|
8171
8171
|
|
8172
|
-
// components/form/
|
8172
|
+
// components/form/utils/formFragments.ts
|
8173
8173
|
init_esm_shims();
|
8174
8174
|
import _uniq from "lodash/uniq.js";
|
8175
8175
|
import _intersection from "lodash/intersection.js";
|
@@ -8311,7 +8311,7 @@ var getFormFragments = /* @__PURE__ */ __name(({ formType = "new", model, fields
|
|
8311
8311
|
}, "getFormFragments");
|
8312
8312
|
var formFragments_default = getFormFragments;
|
8313
8313
|
|
8314
|
-
// components/form/FormContainer.tsx
|
8314
|
+
// components/form/core/FormContainer.tsx
|
8315
8315
|
import { getFragmentName as getFragmentName2 } from "@vulcanjs/graphql";
|
8316
8316
|
import { capitalize as capitalize2 } from "@vulcanjs/utils";
|
8317
8317
|
import { useSingle, useCreate, useUpdate, useDelete } from "@vulcanjs/react-hooks";
|
@@ -8374,7 +8374,7 @@ var withVulcanComponents = /* @__PURE__ */ __name((C) => (props) => {
|
|
8374
8374
|
}, props));
|
8375
8375
|
}, "withVulcanComponents");
|
8376
8376
|
|
8377
|
-
// components/form/FormContainer.tsx
|
8377
|
+
// components/form/core/FormContainer.tsx
|
8378
8378
|
import { debugVulcan } from "@vulcanjs/utils";
|
8379
8379
|
|
8380
8380
|
// components/VulcanCurrentUser/Consumer.tsx
|
@@ -8393,7 +8393,7 @@ var VulcanCurrentUserContext = React4.createContext({
|
|
8393
8393
|
var VulcanCurrentUserConsumer = VulcanCurrentUserContext.Consumer;
|
8394
8394
|
var useVulcanCurrentUser = /* @__PURE__ */ __name(() => useContext2(VulcanCurrentUserContext), "useVulcanCurrentUser");
|
8395
8395
|
|
8396
|
-
// components/form/FormContainer.tsx
|
8396
|
+
// components/form/core/FormContainer.tsx
|
8397
8397
|
function _extends2() {
|
8398
8398
|
_extends2 = Object.assign || function(target) {
|
8399
8399
|
for (var i = 1; i < arguments.length; i++) {
|
@@ -8546,10 +8546,10 @@ var FormContainer = /* @__PURE__ */ __name((props) => {
|
|
8546
8546
|
}, "FormContainer");
|
8547
8547
|
var SmartForm = FormContainer;
|
8548
8548
|
|
8549
|
-
// components/form/Form/index.ts
|
8549
|
+
// components/form/core/Form/index.ts
|
8550
8550
|
init_esm_shims();
|
8551
8551
|
|
8552
|
-
// components/form/Form/Form.tsx
|
8552
|
+
// components/form/core/Form/Form.tsx
|
8553
8553
|
init_esm_shims();
|
8554
8554
|
import React7, { useEffect as useEffect2, useRef as useRef2, useState } from "react";
|
8555
8555
|
import { runCallbacks, getErrors } from "@vulcanjs/core";
|
@@ -8571,11 +8571,11 @@ import update from "lodash/update.js";
|
|
8571
8571
|
import without from "lodash/without.js";
|
8572
8572
|
import isEmpty from "lodash/isEmpty.js";
|
8573
8573
|
|
8574
|
-
// components/form/
|
8574
|
+
// components/form/utils/schema_utils.ts
|
8575
8575
|
init_esm_shims();
|
8576
8576
|
import { canCreateField, canUpdateField } from "@vulcanjs/permissions";
|
8577
8577
|
|
8578
|
-
// components/form/
|
8578
|
+
// components/form/utils/utils.ts
|
8579
8579
|
init_esm_shims();
|
8580
8580
|
import merge from "lodash/merge.js";
|
8581
8581
|
import find from "lodash/find.js";
|
@@ -8583,7 +8583,7 @@ import isPlainObject from "lodash/isPlainObject.js";
|
|
8583
8583
|
import set from "lodash/set.js";
|
8584
8584
|
import size from "lodash/size.js";
|
8585
8585
|
|
8586
|
-
// components/form/
|
8586
|
+
// components/form/utils/path_utils.ts
|
8587
8587
|
init_esm_shims();
|
8588
8588
|
import toPath from "lodash/toPath.js";
|
8589
8589
|
import initial from "lodash/initial.js";
|
@@ -8593,7 +8593,7 @@ var splitPath = /* @__PURE__ */ __name((string) => toPath(string), "splitPath");
|
|
8593
8593
|
var joinPath = /* @__PURE__ */ __name((array) => array.reduce((string, item) => string + (Number.isNaN(Number(item)) ? `${string === "" ? "" : "."}${item}` : `[${item}]`), ""), "joinPath");
|
8594
8594
|
var getParentPath = flow(splitPath, initial, joinPath);
|
8595
8595
|
|
8596
|
-
// components/form/
|
8596
|
+
// components/form/utils/utils.ts
|
8597
8597
|
var isEmptyValue = /* @__PURE__ */ __name((value) => typeof value === "undefined" || value === null || value === "" || Array.isArray(value) && value.length === 0, "isEmptyValue");
|
8598
8598
|
var getFieldType = /* @__PURE__ */ __name((fieldSchema) => fieldSchema.type, "getFieldType");
|
8599
8599
|
var getNullValue = /* @__PURE__ */ __name((datatype) => {
|
@@ -8611,7 +8611,7 @@ var getNullValue = /* @__PURE__ */ __name((datatype) => {
|
|
8611
8611
|
}
|
8612
8612
|
}, "getNullValue");
|
8613
8613
|
|
8614
|
-
// components/form/
|
8614
|
+
// components/form/utils/schema_utils.ts
|
8615
8615
|
var getInsertableFields = /* @__PURE__ */ __name(function(schema, user) {
|
8616
8616
|
const fields = Object.keys(schema).filter(function(fieldName) {
|
8617
8617
|
var field = schema[fieldName];
|
@@ -8781,7 +8781,7 @@ var formProperties = [
|
|
8781
8781
|
"fieldProperties"
|
8782
8782
|
];
|
8783
8783
|
|
8784
|
-
// components/form/FormContext.tsx
|
8784
|
+
// components/form/core/FormContext.tsx
|
8785
8785
|
init_esm_shims();
|
8786
8786
|
import React6, { useContext as useContext3 } from "react";
|
8787
8787
|
var FormContext = /* @__PURE__ */ React6.createContext(void 0);
|
@@ -8792,7 +8792,7 @@ var useFormContext = /* @__PURE__ */ __name(() => {
|
|
8792
8792
|
return formContext;
|
8793
8793
|
}, "useFormContext");
|
8794
8794
|
|
8795
|
-
// components/form/Form/fields.ts
|
8795
|
+
// components/form/core/Form/fields.ts
|
8796
8796
|
init_esm_shims();
|
8797
8797
|
import uniq from "lodash/uniq.js";
|
8798
8798
|
import compact2 from "lodash/compact.js";
|
@@ -9015,7 +9015,7 @@ var getFieldGroups = /* @__PURE__ */ __name((props, state, context, mutableField
|
|
9015
9015
|
return groupsWithFields;
|
9016
9016
|
}, "getFieldGroups");
|
9017
9017
|
|
9018
|
-
// components/form/Form/utils.ts
|
9018
|
+
// components/form/core/Form/utils.ts
|
9019
9019
|
init_esm_shims();
|
9020
9020
|
import find2 from "lodash/find.js";
|
9021
9021
|
import isEqualWith from "lodash/isEqualWith.js";
|
@@ -9029,17 +9029,17 @@ var isNotSameDocument = /* @__PURE__ */ __name((initialDocument, changedDocument
|
|
9029
9029
|
return typeof changedValue !== "undefined";
|
9030
9030
|
}, "isNotSameDocument");
|
9031
9031
|
|
9032
|
-
// components/form/useWarnOnUnsaved/index.ts
|
9032
|
+
// components/form/hooks/useWarnOnUnsaved/index.ts
|
9033
9033
|
init_esm_shims();
|
9034
9034
|
|
9035
|
-
// components/form/useWarnOnUnsaved/useWarnOnUnsaved.ts
|
9035
|
+
// components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.ts
|
9036
9036
|
init_esm_shims();
|
9037
9037
|
|
9038
|
-
// components/form/useBlockTransition/useBlockTransition.ts
|
9038
|
+
// components/form/hooks/useBlockTransition/useBlockTransition.ts
|
9039
9039
|
init_esm_shims();
|
9040
9040
|
import { useEffect, useRef } from "react";
|
9041
9041
|
|
9042
|
-
// components/form/useBlockTransition/block.ts
|
9042
|
+
// components/form/hooks/useBlockTransition/block.ts
|
9043
9043
|
init_esm_shims();
|
9044
9044
|
import debug from "debug";
|
9045
9045
|
var debugTransitions = debug("vn:route-transition");
|
@@ -9072,7 +9072,7 @@ var block = /* @__PURE__ */ __name((setConfirmationMessage, onUnblock) => {
|
|
9072
9072
|
return unblock;
|
9073
9073
|
}, "block");
|
9074
9074
|
|
9075
|
-
// components/form/useBlockTransition/useBlockTransition.ts
|
9075
|
+
// components/form/hooks/useBlockTransition/useBlockTransition.ts
|
9076
9076
|
import debug2 from "debug";
|
9077
9077
|
var debugTransitions2 = debug2("vn:router-transitions");
|
9078
9078
|
var useBlockTransition = /* @__PURE__ */ __name(({ shouldBlock, getBlockedMessage }) => {
|
@@ -9111,7 +9111,7 @@ var useBlockTransition = /* @__PURE__ */ __name(({ shouldBlock, getBlockedMessag
|
|
9111
9111
|
]);
|
9112
9112
|
}, "useBlockTransition");
|
9113
9113
|
|
9114
|
-
// components/form/useWarnOnUnsaved/useWarnOnUnsaved.ts
|
9114
|
+
// components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.ts
|
9115
9115
|
import debug3 from "debug";
|
9116
9116
|
import { useIntlContext } from "@vulcanjs/react-i18n";
|
9117
9117
|
var debugTransitions3 = debug3("vn:route-transitions");
|
@@ -9131,7 +9131,7 @@ var useWarnOnUnsaved = /* @__PURE__ */ __name(({ isChanged, warnUnsavedChanges }
|
|
9131
9131
|
});
|
9132
9132
|
}, "useWarnOnUnsaved");
|
9133
9133
|
|
9134
|
-
// components/form/Form/Form.tsx
|
9134
|
+
// components/form/core/Form/Form.tsx
|
9135
9135
|
function _extends3() {
|
9136
9136
|
_extends3 = Object.assign || function(target) {
|
9137
9137
|
for (var i = 1; i < arguments.length; i++) {
|
@@ -9594,7 +9594,7 @@ var Form = /* @__PURE__ */ __name((props) => {
|
|
9594
9594
|
}, formGroupProps(group)))))));
|
9595
9595
|
}, "Form");
|
9596
9596
|
|
9597
|
-
// components/form/Form/typings.ts
|
9597
|
+
// components/form/core/Form/typings.ts
|
9598
9598
|
init_esm_shims();
|
9599
9599
|
|
9600
9600
|
// components/VulcanComponents/index.ts
|
@@ -9602,7 +9602,7 @@ init_esm_shims();
|
|
9602
9602
|
|
9603
9603
|
// components/VulcanComponents/Provider.tsx
|
9604
9604
|
init_esm_shims();
|
9605
|
-
import
|
9605
|
+
import React65 from "react";
|
9606
9606
|
|
9607
9607
|
// components/VulcanComponents/defaultVulcanComponents/index.ts
|
9608
9608
|
init_esm_shims();
|
@@ -9610,9 +9610,27 @@ init_esm_shims();
|
|
9610
9610
|
// components/VulcanComponents/defaultVulcanComponents/formComponents.ts
|
9611
9611
|
init_esm_shims();
|
9612
9612
|
|
9613
|
-
// components/form/
|
9613
|
+
// components/form/elements/index.ts
|
9614
|
+
init_esm_shims();
|
9615
|
+
|
9616
|
+
// components/form/elements/FieldErrors.tsx
|
9614
9617
|
init_esm_shims();
|
9615
9618
|
import React8 from "react";
|
9619
|
+
var FieldErrors = /* @__PURE__ */ __name(({ errors }) => {
|
9620
|
+
const VulcanComponents = useVulcanComponents();
|
9621
|
+
return /* @__PURE__ */ React8.createElement("ul", {
|
9622
|
+
className: "form-input-errors"
|
9623
|
+
}, errors.map((error, index) => /* @__PURE__ */ React8.createElement("li", {
|
9624
|
+
key: index
|
9625
|
+
}, /* @__PURE__ */ React8.createElement(VulcanComponents.FormError, {
|
9626
|
+
error,
|
9627
|
+
errorContext: "field"
|
9628
|
+
}))));
|
9629
|
+
}, "FieldErrors");
|
9630
|
+
|
9631
|
+
// components/form/elements/FormError.tsx
|
9632
|
+
init_esm_shims();
|
9633
|
+
import React9 from "react";
|
9616
9634
|
import get3 from "lodash/get.js";
|
9617
9635
|
function _extends4() {
|
9618
9636
|
_extends4 = Object.assign || function(target) {
|
@@ -9658,7 +9676,7 @@ var FormError = /* @__PURE__ */ __name(({ error, errorContext }) => {
|
|
9658
9676
|
values: exception.data
|
9659
9677
|
});
|
9660
9678
|
}
|
9661
|
-
return /* @__PURE__ */
|
9679
|
+
return /* @__PURE__ */ React9.createElement(VulcanComponents.FormattedMessage, _extends4({
|
9662
9680
|
html: true
|
9663
9681
|
}, messageProps));
|
9664
9682
|
}, "FormError");
|
@@ -9666,15 +9684,158 @@ FormError.defaultProps = {
|
|
9666
9684
|
errorContext: ""
|
9667
9685
|
};
|
9668
9686
|
|
9669
|
-
// components/form/
|
9687
|
+
// components/form/elements/FormErrors.tsx
|
9688
|
+
init_esm_shims();
|
9689
|
+
import React10 from "react";
|
9690
|
+
var FormErrors = /* @__PURE__ */ __name(() => {
|
9691
|
+
const VulcanComponents = useVulcanComponents();
|
9692
|
+
const { errors } = useFormContext();
|
9693
|
+
return /* @__PURE__ */ React10.createElement("div", {
|
9694
|
+
className: "form-errors"
|
9695
|
+
}, !!errors.length && /* @__PURE__ */ React10.createElement(VulcanComponents.Alert, {
|
9696
|
+
className: "flash-message",
|
9697
|
+
variant: "danger"
|
9698
|
+
}, /* @__PURE__ */ React10.createElement("ul", null, errors.map((error, index) => /* @__PURE__ */ React10.createElement("li", {
|
9699
|
+
key: index
|
9700
|
+
}, /* @__PURE__ */ React10.createElement(VulcanComponents.FormError, {
|
9701
|
+
error,
|
9702
|
+
errorContext: "form"
|
9703
|
+
}))))));
|
9704
|
+
}, "FormErrors");
|
9705
|
+
|
9706
|
+
// components/form/elements/FormSubmit.tsx
|
9707
|
+
init_esm_shims();
|
9708
|
+
var import_prop_types = __toESM(require_prop_types(), 1);
|
9709
|
+
import React11 from "react";
|
9710
|
+
import { canDeleteDocument } from "@vulcanjs/permissions";
|
9711
|
+
var FormSubmit = /* @__PURE__ */ __name(({
|
9712
|
+
submitLabel,
|
9713
|
+
cancelLabel,
|
9714
|
+
cancelCallback,
|
9715
|
+
revertLabel,
|
9716
|
+
revertCallback,
|
9717
|
+
document,
|
9718
|
+
deleteDocument,
|
9719
|
+
model,
|
9720
|
+
currentUser
|
9721
|
+
}) => {
|
9722
|
+
const VulcanComponents = useVulcanComponents();
|
9723
|
+
const { clearForm } = useFormContext();
|
9724
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
9725
|
+
className: "form-submit"
|
9726
|
+
}, /* @__PURE__ */ React11.createElement(VulcanComponents.Button, {
|
9727
|
+
type: "submit",
|
9728
|
+
variant: "primary"
|
9729
|
+
}, submitLabel ? submitLabel : /* @__PURE__ */ React11.createElement(VulcanComponents.FormattedMessage, {
|
9730
|
+
id: "forms.submit",
|
9731
|
+
defaultMessage: "Submit"
|
9732
|
+
})), cancelCallback ? /* @__PURE__ */ React11.createElement("a", {
|
9733
|
+
className: "form-cancel",
|
9734
|
+
onClick: (e) => {
|
9735
|
+
e.preventDefault();
|
9736
|
+
cancelCallback(document);
|
9737
|
+
}
|
9738
|
+
}, cancelLabel ? cancelLabel : /* @__PURE__ */ React11.createElement(VulcanComponents.FormattedMessage, {
|
9739
|
+
id: "forms.cancel",
|
9740
|
+
defaultMessage: "Cancel"
|
9741
|
+
})) : null, revertCallback ? /* @__PURE__ */ React11.createElement("a", {
|
9742
|
+
className: "form-cancel",
|
9743
|
+
onClick: (e) => {
|
9744
|
+
e.preventDefault();
|
9745
|
+
clearForm();
|
9746
|
+
revertCallback(document);
|
9747
|
+
}
|
9748
|
+
}, revertLabel ? revertLabel : /* @__PURE__ */ React11.createElement(VulcanComponents.FormattedMessage, {
|
9749
|
+
id: "forms.revert",
|
9750
|
+
defaultMessage: "Revert"
|
9751
|
+
})) : null, deleteDocument && canDeleteDocument({
|
9752
|
+
user: currentUser,
|
9753
|
+
document,
|
9754
|
+
model
|
9755
|
+
}) ? /* @__PURE__ */ React11.createElement("div", null, /* @__PURE__ */ React11.createElement("hr", null), /* @__PURE__ */ React11.createElement(VulcanComponents.Button, {
|
9756
|
+
variant: "link",
|
9757
|
+
onClick: deleteDocument,
|
9758
|
+
className: `delete-link ${model.name}-delete-link`
|
9759
|
+
}, /* @__PURE__ */ React11.createElement(VulcanComponents.Icon, {
|
9760
|
+
name: "close"
|
9761
|
+
}), " ", /* @__PURE__ */ React11.createElement(VulcanComponents.FormattedMessage, {
|
9762
|
+
id: "forms.delete",
|
9763
|
+
defaultMessage: "Delete"
|
9764
|
+
}))) : null);
|
9765
|
+
}, "FormSubmit");
|
9766
|
+
FormSubmit.propTypes = {
|
9767
|
+
submitLabel: import_prop_types.default.node,
|
9768
|
+
cancelLabel: import_prop_types.default.node,
|
9769
|
+
cancelCallback: import_prop_types.default.func,
|
9770
|
+
revertLabel: import_prop_types.default.node,
|
9771
|
+
revertCallback: import_prop_types.default.func,
|
9772
|
+
document: import_prop_types.default.object,
|
9773
|
+
deleteDocument: import_prop_types.default.func,
|
9774
|
+
collectionName: import_prop_types.default.string,
|
9775
|
+
classes: import_prop_types.default.object
|
9776
|
+
};
|
9777
|
+
|
9778
|
+
// components/form/elements/FormLayout.tsx
|
9779
|
+
init_esm_shims();
|
9780
|
+
import React12 from "react";
|
9781
|
+
function _extends5() {
|
9782
|
+
_extends5 = Object.assign || function(target) {
|
9783
|
+
for (var i = 1; i < arguments.length; i++) {
|
9784
|
+
var source = arguments[i];
|
9785
|
+
for (var key in source) {
|
9786
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
9787
|
+
target[key] = source[key];
|
9788
|
+
}
|
9789
|
+
}
|
9790
|
+
}
|
9791
|
+
return target;
|
9792
|
+
};
|
9793
|
+
return _extends5.apply(this, arguments);
|
9794
|
+
}
|
9795
|
+
__name(_extends5, "_extends");
|
9796
|
+
var FormLayout = /* @__PURE__ */ __name(({ commonProps, formProps, repeatErrors, submitProps, children }) => {
|
9797
|
+
const VulcanComponents = useVulcanComponents();
|
9798
|
+
return /* @__PURE__ */ React12.createElement(VulcanComponents.FormElement, _extends5({}, formProps), /* @__PURE__ */ React12.createElement(VulcanComponents.FormErrors, _extends5({}, commonProps)), children, repeatErrors && /* @__PURE__ */ React12.createElement(VulcanComponents.FormErrors, _extends5({}, commonProps)), /* @__PURE__ */ React12.createElement(VulcanComponents.FormSubmit, _extends5({}, commonProps, submitProps)));
|
9799
|
+
}, "FormLayout");
|
9800
|
+
|
9801
|
+
// components/form/elements/FormElement.tsx
|
9670
9802
|
init_esm_shims();
|
9671
|
-
import
|
9803
|
+
import React13 from "react";
|
9804
|
+
function _extends6() {
|
9805
|
+
_extends6 = Object.assign || function(target) {
|
9806
|
+
for (var i = 1; i < arguments.length; i++) {
|
9807
|
+
var source = arguments[i];
|
9808
|
+
for (var key in source) {
|
9809
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
9810
|
+
target[key] = source[key];
|
9811
|
+
}
|
9812
|
+
}
|
9813
|
+
}
|
9814
|
+
return target;
|
9815
|
+
};
|
9816
|
+
return _extends6.apply(this, arguments);
|
9817
|
+
}
|
9818
|
+
__name(_extends6, "_extends");
|
9819
|
+
var FormElement = /* @__PURE__ */ React13.forwardRef((_a, ref) => {
|
9820
|
+
var _b = _a, { children } = _b, otherProps = __objRest(_b, ["children"]);
|
9821
|
+
const { submitForm } = useFormContext();
|
9822
|
+
return /* @__PURE__ */ React13.createElement("form", _extends6({}, otherProps, {
|
9823
|
+
onSubmit: submitForm,
|
9824
|
+
ref
|
9825
|
+
}), children);
|
9826
|
+
});
|
9827
|
+
|
9828
|
+
// components/form/core/index.ts
|
9829
|
+
init_esm_shims();
|
9830
|
+
|
9831
|
+
// components/form/core/FormComponent.tsx
|
9832
|
+
init_esm_shims();
|
9833
|
+
import React14, { useEffect as useEffect3, useState as useState2 } from "react";
|
9672
9834
|
import get4 from "lodash/get.js";
|
9673
|
-
import
|
9835
|
+
import SimpleSchema from "simpl-schema";
|
9674
9836
|
|
9675
9837
|
// components/form/inputs/consts.ts
|
9676
9838
|
init_esm_shims();
|
9677
|
-
import SimpleSchema from "simpl-schema";
|
9678
9839
|
var standardInputs = [
|
9679
9840
|
"number",
|
9680
9841
|
"url",
|
@@ -9712,13 +9873,13 @@ var allVulcanInputs = [
|
|
9712
9873
|
...derivedInputs
|
9713
9874
|
];
|
9714
9875
|
var getAutoInputFromType = /* @__PURE__ */ __name((fieldType) => {
|
9715
|
-
const autoType = fieldType === Number
|
9876
|
+
const autoType = fieldType === Number ? "number" : fieldType === Boolean ? "checkbox" : fieldType === Date ? "date" : "text";
|
9716
9877
|
return autoType;
|
9717
9878
|
}, "getAutoInputFromType");
|
9718
9879
|
|
9719
|
-
// components/form/FormComponent.tsx
|
9720
|
-
function
|
9721
|
-
|
9880
|
+
// components/form/core/FormComponent.tsx
|
9881
|
+
function _extends7() {
|
9882
|
+
_extends7 = Object.assign || function(target) {
|
9722
9883
|
for (var i = 1; i < arguments.length; i++) {
|
9723
9884
|
var source = arguments[i];
|
9724
9885
|
for (var key in source) {
|
@@ -9729,9 +9890,9 @@ function _extends5() {
|
|
9729
9890
|
}
|
9730
9891
|
return target;
|
9731
9892
|
};
|
9732
|
-
return
|
9893
|
+
return _extends7.apply(this, arguments);
|
9733
9894
|
}
|
9734
|
-
__name(
|
9895
|
+
__name(_extends7, "_extends");
|
9735
9896
|
var getCharacterCounts = /* @__PURE__ */ __name((value, max) => {
|
9736
9897
|
const characterCount = value && value.length ? value.length : 0;
|
9737
9898
|
return {
|
@@ -9758,7 +9919,7 @@ var isArrayField = /* @__PURE__ */ __name((type) => {
|
|
9758
9919
|
return type === Array;
|
9759
9920
|
}, "isArrayField");
|
9760
9921
|
var isObjectField = /* @__PURE__ */ __name((type) => {
|
9761
|
-
return type instanceof
|
9922
|
+
return type instanceof SimpleSchema;
|
9762
9923
|
}, "isObjectField");
|
9763
9924
|
var getInputName = /* @__PURE__ */ __name((fieldType, input) => {
|
9764
9925
|
if (input)
|
@@ -9859,7 +10020,7 @@ var FormComponent = /* @__PURE__ */ __name((props) => {
|
|
9859
10020
|
}
|
9860
10021
|
if (type === Number && value != null) {
|
9861
10022
|
value = Number(value);
|
9862
|
-
} else if (type ===
|
10023
|
+
} else if (type === SimpleSchema.Integer && value != null) {
|
9863
10024
|
value = parseInt(value);
|
9864
10025
|
}
|
9865
10026
|
if (value !== getValue()) {
|
@@ -9906,16 +10067,16 @@ var FormComponent = /* @__PURE__ */ __name((props) => {
|
|
9906
10067
|
}, "clearField");
|
9907
10068
|
const FormComponents = useVulcanComponents();
|
9908
10069
|
if (intlInput) {
|
9909
|
-
return /* @__PURE__ */
|
10070
|
+
return /* @__PURE__ */ React14.createElement(FormComponents.FormIntl, _extends7({}, props));
|
9910
10071
|
} else if (!input && nestedInput) {
|
9911
10072
|
if (isArrayField(type)) {
|
9912
|
-
return /* @__PURE__ */
|
10073
|
+
return /* @__PURE__ */ React14.createElement(FormComponents.FormNestedArray, _extends7({}, props, {
|
9913
10074
|
formComponents: FormComponents,
|
9914
10075
|
errors: getErrors2(),
|
9915
10076
|
value: getValue()
|
9916
10077
|
}));
|
9917
10078
|
} else if (isObjectField(type)) {
|
9918
|
-
return /* @__PURE__ */
|
10079
|
+
return /* @__PURE__ */ React14.createElement(FormComponents.FormNestedObject, _extends7({}, props, {
|
9919
10080
|
formComponents: FormComponents,
|
9920
10081
|
errors: getErrors2(),
|
9921
10082
|
value: getValue()
|
@@ -9938,17 +10099,17 @@ var FormComponent = /* @__PURE__ */ __name((props) => {
|
|
9938
10099
|
if (!query && typeof options === "function") {
|
9939
10100
|
fciProps.options = options(fciProps);
|
9940
10101
|
}
|
9941
|
-
const fci = /* @__PURE__ */
|
9942
|
-
return query ? /* @__PURE__ */
|
10102
|
+
const fci = /* @__PURE__ */ React14.createElement(FormComponents.FormComponentInner, _extends7({}, fciProps));
|
10103
|
+
return query ? /* @__PURE__ */ React14.createElement(FormComponents.FormComponentLoader, _extends7({}, fciProps), fci) : fci;
|
9943
10104
|
}, "FormComponent");
|
9944
10105
|
var FormComponent_default = FormComponent;
|
9945
10106
|
|
9946
|
-
// components/form/FormComponentInner.tsx
|
10107
|
+
// components/form/core/FormComponentInner.tsx
|
9947
10108
|
init_esm_shims();
|
9948
|
-
import
|
10109
|
+
import React15 from "react";
|
9949
10110
|
import { useIntlContext as useIntlContext3 } from "@vulcanjs/react-i18n";
|
9950
10111
|
|
9951
|
-
// components/form/ui_utils.ts
|
10112
|
+
// components/form/utils/ui_utils.ts
|
9952
10113
|
init_esm_shims();
|
9953
10114
|
import pick3 from "lodash/pick.js";
|
9954
10115
|
var whitelistInputProps = /* @__PURE__ */ __name((props) => {
|
@@ -9963,13 +10124,19 @@ var whitelistInputProps = /* @__PURE__ */ __name((props) => {
|
|
9963
10124
|
"disabled",
|
9964
10125
|
"placeholder"
|
9965
10126
|
];
|
9966
|
-
|
10127
|
+
const value = props.value;
|
10128
|
+
let safeValue;
|
10129
|
+
if (value === null)
|
10130
|
+
safeValue = void 0;
|
10131
|
+
return __spreadProps(__spreadValues({}, pick3(props, whitelist)), {
|
10132
|
+
value: safeValue
|
10133
|
+
});
|
9967
10134
|
}, "whitelistInputProps");
|
9968
10135
|
|
9969
|
-
// components/form/FormComponentInner.tsx
|
10136
|
+
// components/form/core/FormComponentInner.tsx
|
9970
10137
|
import classNames from "classnames";
|
9971
|
-
function
|
9972
|
-
|
10138
|
+
function _extends8() {
|
10139
|
+
_extends8 = Object.assign || function(target) {
|
9973
10140
|
for (var i = 1; i < arguments.length; i++) {
|
9974
10141
|
var source = arguments[i];
|
9975
10142
|
for (var key in source) {
|
@@ -9980,21 +10147,21 @@ function _extends6() {
|
|
9980
10147
|
}
|
9981
10148
|
return target;
|
9982
10149
|
};
|
9983
|
-
return
|
10150
|
+
return _extends8.apply(this, arguments);
|
9984
10151
|
}
|
9985
|
-
__name(
|
10152
|
+
__name(_extends8, "_extends");
|
9986
10153
|
var FormComponentInner = /* @__PURE__ */ __name((props) => {
|
9987
10154
|
const intl = useIntlContext3();
|
9988
10155
|
const { inputType: inputType1, disabled, clearField } = props;
|
9989
10156
|
const renderClear = /* @__PURE__ */ __name(() => {
|
9990
10157
|
if (clearableInputs.includes(inputType1) && !disabled) {
|
9991
|
-
return /* @__PURE__ */
|
10158
|
+
return /* @__PURE__ */ React15.createElement("button", {
|
9992
10159
|
className: "form-component-clear",
|
9993
10160
|
title: intl.formatMessage({
|
9994
10161
|
id: "forms.clear_field"
|
9995
10162
|
}),
|
9996
10163
|
onClick: clearField
|
9997
|
-
}, /* @__PURE__ */
|
10164
|
+
}, /* @__PURE__ */ React15.createElement("span", null, "\u2715"));
|
9998
10165
|
}
|
9999
10166
|
}, "renderClear");
|
10000
10167
|
const getProperties = /* @__PURE__ */ __name(() => {
|
@@ -10037,20 +10204,20 @@ var FormComponentInner = /* @__PURE__ */ __name((props) => {
|
|
10037
10204
|
});
|
10038
10205
|
const properties1 = getProperties();
|
10039
10206
|
const FormInput = formInput;
|
10040
|
-
return /* @__PURE__ */
|
10207
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
10041
10208
|
className: inputClass
|
10042
|
-
}, /* @__PURE__ */
|
10209
|
+
}, /* @__PURE__ */ React15.createElement(FormInput, _extends8({}, properties1)), hasErrors ? /* @__PURE__ */ React15.createElement(FormComponents.FieldErrors, {
|
10043
10210
|
errors
|
10044
|
-
}) : null, renderClear(), showCharsRemaining && /* @__PURE__ */
|
10211
|
+
}) : null, renderClear(), showCharsRemaining && /* @__PURE__ */ React15.createElement("div", {
|
10045
10212
|
className: classNames("form-control-limit", {
|
10046
10213
|
danger: charsRemaining < 10
|
10047
10214
|
})
|
10048
10215
|
}, charsRemaining));
|
10049
10216
|
}, "FormComponentInner");
|
10050
10217
|
|
10051
|
-
// components/form/FormComponentLoader.tsx
|
10218
|
+
// components/form/core/FormComponentLoader.tsx
|
10052
10219
|
init_esm_shims();
|
10053
|
-
import
|
10220
|
+
import React16, { useEffect as useEffect4 } from "react";
|
10054
10221
|
import { useLazyQuery } from "@apollo/client";
|
10055
10222
|
import isEmpty2 from "lodash/isEmpty.js";
|
10056
10223
|
var FormComponentLoader = /* @__PURE__ */ __name((props) => {
|
@@ -10079,9 +10246,9 @@ var FormComponentLoader = /* @__PURE__ */ __name((props) => {
|
|
10079
10246
|
throw new Error(error.toString());
|
10080
10247
|
}
|
10081
10248
|
if (loading) {
|
10082
|
-
return /* @__PURE__ */
|
10249
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
10083
10250
|
className: "form-component-loader"
|
10084
|
-
}, /* @__PURE__ */
|
10251
|
+
}, /* @__PURE__ */ React16.createElement(VulcanComponents.Loading, null));
|
10085
10252
|
}
|
10086
10253
|
const extraProps = {
|
10087
10254
|
data,
|
@@ -10095,50 +10262,23 @@ var FormComponentLoader = /* @__PURE__ */ __name((props) => {
|
|
10095
10262
|
data
|
10096
10263
|
}));
|
10097
10264
|
}
|
10098
|
-
if (!/* @__PURE__ */
|
10265
|
+
if (!/* @__PURE__ */ React16.isValidElement(children)) {
|
10099
10266
|
throw new Error("Children of FormComponentLoader must be a React element, got " + children);
|
10100
10267
|
}
|
10101
|
-
const fci = /* @__PURE__ */
|
10102
|
-
return /* @__PURE__ */
|
10268
|
+
const fci = /* @__PURE__ */ React16.cloneElement(children, extraProps);
|
10269
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
10103
10270
|
className: "form-component-loader"
|
10104
10271
|
}, fci);
|
10105
10272
|
}, "FormComponentLoader");
|
10106
10273
|
FormComponentLoader.propTypes = {};
|
10107
10274
|
|
10108
|
-
// components/form/
|
10109
|
-
init_esm_shims();
|
10110
|
-
import React12 from "react";
|
10111
|
-
function _extends7() {
|
10112
|
-
_extends7 = Object.assign || function(target) {
|
10113
|
-
for (var i = 1; i < arguments.length; i++) {
|
10114
|
-
var source = arguments[i];
|
10115
|
-
for (var key in source) {
|
10116
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
10117
|
-
target[key] = source[key];
|
10118
|
-
}
|
10119
|
-
}
|
10120
|
-
}
|
10121
|
-
return target;
|
10122
|
-
};
|
10123
|
-
return _extends7.apply(this, arguments);
|
10124
|
-
}
|
10125
|
-
__name(_extends7, "_extends");
|
10126
|
-
var FormElement = /* @__PURE__ */ React12.forwardRef((_a, ref) => {
|
10127
|
-
var _b = _a, { children } = _b, otherProps = __objRest(_b, ["children"]);
|
10128
|
-
const { submitForm } = useFormContext();
|
10129
|
-
return /* @__PURE__ */ React12.createElement("form", _extends7({}, otherProps, {
|
10130
|
-
onSubmit: submitForm,
|
10131
|
-
ref
|
10132
|
-
}), children);
|
10133
|
-
});
|
10134
|
-
|
10135
|
-
// components/form/FormGroup.tsx
|
10275
|
+
// components/form/core/FormGroup.tsx
|
10136
10276
|
init_esm_shims();
|
10137
|
-
import
|
10277
|
+
import React17, { useState as useState3 } from "react";
|
10138
10278
|
import _some from "lodash/some.js";
|
10139
10279
|
import { isAdmin } from "@vulcanjs/permissions";
|
10140
|
-
function
|
10141
|
-
|
10280
|
+
function _extends9() {
|
10281
|
+
_extends9 = Object.assign || function(target) {
|
10142
10282
|
for (var i = 1; i < arguments.length; i++) {
|
10143
10283
|
var source = arguments[i];
|
10144
10284
|
for (var key in source) {
|
@@ -10149,14 +10289,14 @@ function _extends8() {
|
|
10149
10289
|
}
|
10150
10290
|
return target;
|
10151
10291
|
};
|
10152
|
-
return
|
10292
|
+
return _extends9.apply(this, arguments);
|
10153
10293
|
}
|
10154
|
-
__name(
|
10294
|
+
__name(_extends9, "_extends");
|
10155
10295
|
var FormGroupLayout = /* @__PURE__ */ __name((_a) => {
|
10156
10296
|
var _b = _a, { anchorName, collapsed, hasErrors, group, document, toggle } = _b, props = __objRest(_b, ["anchorName", "collapsed", "hasErrors", "group", "document", "toggle"]);
|
10157
|
-
return /* @__PURE__ */
|
10297
|
+
return /* @__PURE__ */ React17.createElement("fieldset", _extends9({}, props));
|
10158
10298
|
}, "FormGroupLayout");
|
10159
|
-
var FormGroupHeader = /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
10299
|
+
var FormGroupHeader = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React17.createElement("h2", _extends9({}, props)), "FormGroupHeader");
|
10160
10300
|
var FormGroup = /* @__PURE__ */ __name((props) => {
|
10161
10301
|
const { name: name2, label, group, fields, hidden, document, currentUser, disabled, itemProperties, prefilledProps, formType } = props;
|
10162
10302
|
const { errors, clearFieldErrors } = useFormContext();
|
@@ -10169,7 +10309,7 @@ var FormGroup = /* @__PURE__ */ __name((props) => {
|
|
10169
10309
|
const isHidden = typeof hidden === "function" ? hidden(__spreadProps(__spreadValues({}, props), {
|
10170
10310
|
document
|
10171
10311
|
})) : hidden || false;
|
10172
|
-
const heading = /* @__PURE__ */
|
10312
|
+
const heading = /* @__PURE__ */ React17.createElement(VulcanComponents.FormGroupHeader, {
|
10173
10313
|
toggle,
|
10174
10314
|
label,
|
10175
10315
|
collapsed: collapsed1,
|
@@ -10180,7 +10320,7 @@ var FormGroup = /* @__PURE__ */ __name((props) => {
|
|
10180
10320
|
return null;
|
10181
10321
|
}
|
10182
10322
|
const anchorName = name2.split(".").length > 1 ? name2.split(".")[1] : name2;
|
10183
|
-
return /* @__PURE__ */
|
10323
|
+
return /* @__PURE__ */ React17.createElement(VulcanComponents.FormGroupLayout, {
|
10184
10324
|
label,
|
10185
10325
|
anchorName,
|
10186
10326
|
toggle,
|
@@ -10190,7 +10330,7 @@ var FormGroup = /* @__PURE__ */ __name((props) => {
|
|
10190
10330
|
heading: name2 === "default" ? null : heading,
|
10191
10331
|
hasErrors,
|
10192
10332
|
document
|
10193
|
-
}, fields.map((field) => /* @__PURE__ */
|
10333
|
+
}, fields.map((field) => /* @__PURE__ */ React17.createElement(VulcanComponents.FormComponent, _extends9({
|
10194
10334
|
key: field.name,
|
10195
10335
|
disabled
|
10196
10336
|
}, field, {
|
@@ -10203,12 +10343,12 @@ var FormGroup = /* @__PURE__ */ __name((props) => {
|
|
10203
10343
|
}))));
|
10204
10344
|
}, "FormGroup");
|
10205
10345
|
|
10206
|
-
// components/form/FormIntl.tsx
|
10346
|
+
// components/form/intl/FormIntl.tsx
|
10207
10347
|
init_esm_shims();
|
10208
|
-
import
|
10348
|
+
import React18 from "react";
|
10209
10349
|
import omit2 from "lodash/omit.js";
|
10210
|
-
function
|
10211
|
-
|
10350
|
+
function _extends10() {
|
10351
|
+
_extends10 = Object.assign || function(target) {
|
10212
10352
|
for (var i = 1; i < arguments.length; i++) {
|
10213
10353
|
var source = arguments[i];
|
10214
10354
|
for (var key in source) {
|
@@ -10219,13 +10359,13 @@ function _extends9() {
|
|
10219
10359
|
}
|
10220
10360
|
return target;
|
10221
10361
|
};
|
10222
|
-
return
|
10362
|
+
return _extends10.apply(this, arguments);
|
10223
10363
|
}
|
10224
|
-
__name(
|
10225
|
-
var FormIntlLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
10364
|
+
__name(_extends10, "_extends");
|
10365
|
+
var FormIntlLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React18.createElement("div", {
|
10226
10366
|
className: "form-intl"
|
10227
10367
|
}, children), "FormIntlLayout");
|
10228
|
-
var FormIntlItemLayout = /* @__PURE__ */ __name(({ locale, children }) => /* @__PURE__ */
|
10368
|
+
var FormIntlItemLayout = /* @__PURE__ */ __name(({ locale, children }) => /* @__PURE__ */ React18.createElement("div", {
|
10229
10369
|
className: `form-intl-${locale.id}`
|
10230
10370
|
}, children), "FormIntlItemLayout");
|
10231
10371
|
var FormIntl = /* @__PURE__ */ __name((props) => {
|
@@ -10237,133 +10377,22 @@ var FormIntl = /* @__PURE__ */ __name((props) => {
|
|
10237
10377
|
}, "getLocalePath");
|
10238
10378
|
const { name: name2 } = props;
|
10239
10379
|
const properties = omit2(props, "value", "inputProperties", "intlInput", "nestedInput");
|
10240
|
-
return /* @__PURE__ */
|
10380
|
+
return /* @__PURE__ */ React18.createElement(FormComponents.FormIntlLayout, null, Locales.map((locale, i) => /* @__PURE__ */ React18.createElement(FormComponents.FormIntlItemLayout, {
|
10241
10381
|
key: locale.id,
|
10242
10382
|
locale
|
10243
|
-
}, /* @__PURE__ */
|
10383
|
+
}, /* @__PURE__ */ React18.createElement(FormComponents.FormComponent, _extends10({}, properties, {
|
10244
10384
|
label: getLabel2(name2, locale.id),
|
10245
10385
|
path: getLocalePath(i),
|
10246
10386
|
locale: locale.id
|
10247
10387
|
})))));
|
10248
10388
|
}, "FormIntl");
|
10249
10389
|
|
10250
|
-
// components/form/
|
10251
|
-
init_esm_shims();
|
10252
|
-
import React15 from "react";
|
10253
|
-
var FormErrors = /* @__PURE__ */ __name(() => {
|
10254
|
-
const VulcanComponents = useVulcanComponents();
|
10255
|
-
const { errors } = useFormContext();
|
10256
|
-
return /* @__PURE__ */ React15.createElement("div", {
|
10257
|
-
className: "form-errors"
|
10258
|
-
}, !!errors.length && /* @__PURE__ */ React15.createElement(VulcanComponents.Alert, {
|
10259
|
-
className: "flash-message",
|
10260
|
-
variant: "danger"
|
10261
|
-
}, /* @__PURE__ */ React15.createElement("ul", null, errors.map((error, index) => /* @__PURE__ */ React15.createElement("li", {
|
10262
|
-
key: index
|
10263
|
-
}, /* @__PURE__ */ React15.createElement(VulcanComponents.FormError, {
|
10264
|
-
error,
|
10265
|
-
errorContext: "form"
|
10266
|
-
}))))));
|
10267
|
-
}, "FormErrors");
|
10268
|
-
|
10269
|
-
// components/form/FormSubmit.tsx
|
10270
|
-
init_esm_shims();
|
10271
|
-
var import_prop_types = __toESM(require_prop_types(), 1);
|
10272
|
-
import React16 from "react";
|
10273
|
-
import { canDeleteDocument } from "@vulcanjs/permissions";
|
10274
|
-
var FormSubmit = /* @__PURE__ */ __name(({
|
10275
|
-
submitLabel,
|
10276
|
-
cancelLabel,
|
10277
|
-
cancelCallback,
|
10278
|
-
revertLabel,
|
10279
|
-
revertCallback,
|
10280
|
-
document,
|
10281
|
-
deleteDocument,
|
10282
|
-
model,
|
10283
|
-
currentUser
|
10284
|
-
}) => {
|
10285
|
-
const VulcanComponents = useVulcanComponents();
|
10286
|
-
const { clearForm } = useFormContext();
|
10287
|
-
return /* @__PURE__ */ React16.createElement("div", {
|
10288
|
-
className: "form-submit"
|
10289
|
-
}, /* @__PURE__ */ React16.createElement(VulcanComponents.Button, {
|
10290
|
-
type: "submit",
|
10291
|
-
variant: "primary"
|
10292
|
-
}, submitLabel ? submitLabel : /* @__PURE__ */ React16.createElement(VulcanComponents.FormattedMessage, {
|
10293
|
-
id: "forms.submit",
|
10294
|
-
defaultMessage: "Submit"
|
10295
|
-
})), cancelCallback ? /* @__PURE__ */ React16.createElement("a", {
|
10296
|
-
className: "form-cancel",
|
10297
|
-
onClick: (e) => {
|
10298
|
-
e.preventDefault();
|
10299
|
-
cancelCallback(document);
|
10300
|
-
}
|
10301
|
-
}, cancelLabel ? cancelLabel : /* @__PURE__ */ React16.createElement(VulcanComponents.FormattedMessage, {
|
10302
|
-
id: "forms.cancel",
|
10303
|
-
defaultMessage: "Cancel"
|
10304
|
-
})) : null, revertCallback ? /* @__PURE__ */ React16.createElement("a", {
|
10305
|
-
className: "form-cancel",
|
10306
|
-
onClick: (e) => {
|
10307
|
-
e.preventDefault();
|
10308
|
-
clearForm();
|
10309
|
-
revertCallback(document);
|
10310
|
-
}
|
10311
|
-
}, revertLabel ? revertLabel : /* @__PURE__ */ React16.createElement(VulcanComponents.FormattedMessage, {
|
10312
|
-
id: "forms.revert",
|
10313
|
-
defaultMessage: "Revert"
|
10314
|
-
})) : null, deleteDocument && canDeleteDocument({
|
10315
|
-
user: currentUser,
|
10316
|
-
document,
|
10317
|
-
model
|
10318
|
-
}) ? /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement("hr", null), /* @__PURE__ */ React16.createElement(VulcanComponents.Button, {
|
10319
|
-
variant: "link",
|
10320
|
-
onClick: deleteDocument,
|
10321
|
-
className: `delete-link ${model.name}-delete-link`
|
10322
|
-
}, /* @__PURE__ */ React16.createElement(VulcanComponents.Icon, {
|
10323
|
-
name: "close"
|
10324
|
-
}), " ", /* @__PURE__ */ React16.createElement(VulcanComponents.FormattedMessage, {
|
10325
|
-
id: "forms.delete",
|
10326
|
-
defaultMessage: "Delete"
|
10327
|
-
}))) : null);
|
10328
|
-
}, "FormSubmit");
|
10329
|
-
FormSubmit.propTypes = {
|
10330
|
-
submitLabel: import_prop_types.default.node,
|
10331
|
-
cancelLabel: import_prop_types.default.node,
|
10332
|
-
cancelCallback: import_prop_types.default.func,
|
10333
|
-
revertLabel: import_prop_types.default.node,
|
10334
|
-
revertCallback: import_prop_types.default.func,
|
10335
|
-
document: import_prop_types.default.object,
|
10336
|
-
deleteDocument: import_prop_types.default.func,
|
10337
|
-
collectionName: import_prop_types.default.string,
|
10338
|
-
classes: import_prop_types.default.object
|
10339
|
-
};
|
10340
|
-
|
10341
|
-
// components/form/FormLayout.tsx
|
10390
|
+
// components/form/nested/index.ts
|
10342
10391
|
init_esm_shims();
|
10343
|
-
import React17 from "react";
|
10344
|
-
function _extends10() {
|
10345
|
-
_extends10 = Object.assign || function(target) {
|
10346
|
-
for (var i = 1; i < arguments.length; i++) {
|
10347
|
-
var source = arguments[i];
|
10348
|
-
for (var key in source) {
|
10349
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
10350
|
-
target[key] = source[key];
|
10351
|
-
}
|
10352
|
-
}
|
10353
|
-
}
|
10354
|
-
return target;
|
10355
|
-
};
|
10356
|
-
return _extends10.apply(this, arguments);
|
10357
|
-
}
|
10358
|
-
__name(_extends10, "_extends");
|
10359
|
-
var FormLayout = /* @__PURE__ */ __name(({ commonProps, formProps, repeatErrors, submitProps, children }) => {
|
10360
|
-
const VulcanComponents = useVulcanComponents();
|
10361
|
-
return /* @__PURE__ */ React17.createElement(VulcanComponents.FormElement, _extends10({}, formProps), /* @__PURE__ */ React17.createElement(VulcanComponents.FormErrors, _extends10({}, commonProps)), children, repeatErrors && /* @__PURE__ */ React17.createElement(VulcanComponents.FormErrors, _extends10({}, commonProps)), /* @__PURE__ */ React17.createElement(VulcanComponents.FormSubmit, _extends10({}, commonProps, submitProps)));
|
10362
|
-
}, "FormLayout");
|
10363
10392
|
|
10364
|
-
// components/form/FormNestedArray.tsx
|
10393
|
+
// components/form/nested/FormNestedArray.tsx
|
10365
10394
|
init_esm_shims();
|
10366
|
-
import
|
10395
|
+
import React19, { useEffect as useEffect5 } from "react";
|
10367
10396
|
import _omit from "lodash/omit.js";
|
10368
10397
|
import _get from "lodash/get.js";
|
10369
10398
|
function _extends11() {
|
@@ -10384,12 +10413,12 @@ __name(_extends11, "_extends");
|
|
10384
10413
|
var FormNestedArrayInnerLayout = /* @__PURE__ */ __name((props) => {
|
10385
10414
|
const { label, children, addItem, BeforeComponent, AfterComponent } = props;
|
10386
10415
|
const FormComponents = useVulcanComponents();
|
10387
|
-
return /* @__PURE__ */
|
10416
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
10388
10417
|
className: "form-nested-array-inner-layout"
|
10389
|
-
}, /* @__PURE__ */
|
10418
|
+
}, /* @__PURE__ */ React19.createElement(BeforeComponent, _extends11({}, props)), children, /* @__PURE__ */ React19.createElement(FormComponents.FormNestedDivider, {
|
10390
10419
|
label,
|
10391
10420
|
addItem
|
10392
|
-
}), /* @__PURE__ */
|
10421
|
+
}), /* @__PURE__ */ React19.createElement(AfterComponent, _extends11({}, props)));
|
10393
10422
|
}, "FormNestedArrayInnerLayout");
|
10394
10423
|
var FormNestedArray = /* @__PURE__ */ __name((props) => {
|
10395
10424
|
const { updateCurrentValues, deletedValues, errors } = useFormContext();
|
@@ -10436,18 +10465,18 @@ var FormNestedArray = /* @__PURE__ */ __name((props) => {
|
|
10436
10465
|
properties.addItem = !maxCount || arrayLength < maxCount ? addItem : null;
|
10437
10466
|
properties.nestedArrayErrors = errors.filter((error) => error.path && error.path === path1);
|
10438
10467
|
properties.hasErrors = !!(properties.nestedArrayErrors && properties.nestedArrayErrors.length);
|
10439
|
-
return /* @__PURE__ */
|
10468
|
+
return /* @__PURE__ */ React19.createElement(FormComponents.FormNestedArrayLayout, _extends11({}, properties), value.map((subDocument, i) => {
|
10440
10469
|
if (isDeleted(i))
|
10441
10470
|
return null;
|
10442
10471
|
const path = `${props.path}.${i}`;
|
10443
10472
|
const visibleItemIndex = visibleItemIndexes[i];
|
10444
|
-
return /* @__PURE__ */
|
10473
|
+
return /* @__PURE__ */ React19.createElement(FormComponents.FormNestedArrayInnerLayout, _extends11({}, arrayField, {
|
10445
10474
|
key: path,
|
10446
10475
|
addItem,
|
10447
10476
|
itemIndex: i,
|
10448
10477
|
visibleItemIndex,
|
10449
10478
|
path
|
10450
|
-
}), /* @__PURE__ */
|
10479
|
+
}), /* @__PURE__ */ React19.createElement(FormComponents.FormNestedItem, _extends11({}, properties, {
|
10451
10480
|
itemIndex: i,
|
10452
10481
|
visibleItemIndex,
|
10453
10482
|
path,
|
@@ -10458,29 +10487,29 @@ var FormNestedArray = /* @__PURE__ */ __name((props) => {
|
|
10458
10487
|
})));
|
10459
10488
|
}));
|
10460
10489
|
}, "FormNestedArray");
|
10461
|
-
var IconAdd = /* @__PURE__ */ __name(({ width = 24, height = 24 }) => /* @__PURE__ */
|
10490
|
+
var IconAdd = /* @__PURE__ */ __name(({ width = 24, height = 24 }) => /* @__PURE__ */ React19.createElement("svg", {
|
10462
10491
|
width,
|
10463
10492
|
height,
|
10464
10493
|
xmlns: "http://www.w3.org/2000/svg",
|
10465
10494
|
viewBox: "0 0 448 512"
|
10466
|
-
}, /* @__PURE__ */
|
10495
|
+
}, /* @__PURE__ */ React19.createElement("path", {
|
10467
10496
|
fill: "currentColor",
|
10468
10497
|
d: "M448 294.2v-76.4c0-13.3-10.7-24-24-24H286.2V56c0-13.3-10.7-24-24-24h-76.4c-13.3 0-24 10.7-24 24v137.8H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h137.8V456c0 13.3 10.7 24 24 24h76.4c13.3 0 24-10.7 24-24V318.2H424c13.3 0 24-10.7 24-24z"
|
10469
10498
|
})), "IconAdd");
|
10470
|
-
var IconRemove = /* @__PURE__ */ __name(({ width = 24, height = 24 }) => /* @__PURE__ */
|
10499
|
+
var IconRemove = /* @__PURE__ */ __name(({ width = 24, height = 24 }) => /* @__PURE__ */ React19.createElement("svg", {
|
10471
10500
|
width,
|
10472
10501
|
height,
|
10473
10502
|
xmlns: "http://www.w3.org/2000/svg",
|
10474
10503
|
viewBox: "0 0 448 512"
|
10475
|
-
}, /* @__PURE__ */
|
10504
|
+
}, /* @__PURE__ */ React19.createElement("path", {
|
10476
10505
|
fill: "currentColor",
|
10477
10506
|
d: "M424 318.2c13.3 0 24-10.7 24-24v-76.4c0-13.3-10.7-24-24-24H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h400z"
|
10478
10507
|
})), "IconRemove");
|
10479
10508
|
|
10480
|
-
// components/form/FormNestedArrayLayout.tsx
|
10509
|
+
// components/form/nested/FormNestedArrayLayout.tsx
|
10481
10510
|
init_esm_shims();
|
10482
10511
|
var import_prop_types2 = __toESM(require_prop_types(), 1);
|
10483
|
-
import
|
10512
|
+
import React20 from "react";
|
10484
10513
|
function _extends12() {
|
10485
10514
|
_extends12 = Object.assign || function(target) {
|
10486
10515
|
for (var i = 1; i < arguments.length; i++) {
|
@@ -10499,24 +10528,24 @@ __name(_extends12, "_extends");
|
|
10499
10528
|
var FormNestedArrayLayout = /* @__PURE__ */ __name((props) => {
|
10500
10529
|
const { hasErrors, nestedArrayErrors, label, addItem, BeforeComponent, AfterComponent, children } = props;
|
10501
10530
|
const VulcanComponents = useVulcanComponents();
|
10502
|
-
return /* @__PURE__ */
|
10531
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
10503
10532
|
className: `form-group row form-nested ${hasErrors ? "input-error" : ""}`
|
10504
|
-
}, BeforeComponent && /* @__PURE__ */
|
10533
|
+
}, BeforeComponent && /* @__PURE__ */ React20.createElement(BeforeComponent, _extends12({}, props)), /* @__PURE__ */ React20.createElement("label", {
|
10505
10534
|
className: "control-label col-sm-3"
|
10506
|
-
}, label), /* @__PURE__ */
|
10535
|
+
}, label), /* @__PURE__ */ React20.createElement("div", {
|
10507
10536
|
className: "col-sm-9"
|
10508
|
-
}, children, addItem && /* @__PURE__ */
|
10537
|
+
}, children, addItem && /* @__PURE__ */ React20.createElement(VulcanComponents.Button, {
|
10509
10538
|
className: "form-nested-button form-nested-add",
|
10510
10539
|
size: "sm",
|
10511
10540
|
variant: "success",
|
10512
10541
|
onClick: addItem
|
10513
|
-
}, /* @__PURE__ */
|
10542
|
+
}, /* @__PURE__ */ React20.createElement(VulcanComponents.IconAdd, {
|
10514
10543
|
height: 12,
|
10515
10544
|
width: 12
|
10516
|
-
})), props.hasErrors ? /* @__PURE__ */
|
10545
|
+
})), props.hasErrors ? /* @__PURE__ */ React20.createElement(VulcanComponents.FieldErrors, {
|
10517
10546
|
key: "form-nested-errors",
|
10518
10547
|
errors: nestedArrayErrors
|
10519
|
-
}) : null), AfterComponent && /* @__PURE__ */
|
10548
|
+
}) : null), AfterComponent && /* @__PURE__ */ React20.createElement(AfterComponent, _extends12({}, props)));
|
10520
10549
|
}, "FormNestedArrayLayout");
|
10521
10550
|
FormNestedArrayLayout.propTypes = {
|
10522
10551
|
hasErrors: import_prop_types2.default.bool.isRequired,
|
@@ -10530,10 +10559,10 @@ FormNestedArrayLayout.propTypes = {
|
|
10530
10559
|
children: import_prop_types2.default.node
|
10531
10560
|
};
|
10532
10561
|
|
10533
|
-
// components/form/FormNestedItem.tsx
|
10562
|
+
// components/form/nested/FormNestedItem.tsx
|
10534
10563
|
init_esm_shims();
|
10535
10564
|
var import_prop_types3 = __toESM(require_prop_types(), 1);
|
10536
|
-
import
|
10565
|
+
import React21 from "react";
|
10537
10566
|
import { intlShape } from "@vulcanjs/react-i18n";
|
10538
10567
|
import { useIntlContext as useIntlContext4 } from "@vulcanjs/react-i18n";
|
10539
10568
|
function _extends13() {
|
@@ -10551,16 +10580,16 @@ function _extends13() {
|
|
10551
10580
|
return _extends13.apply(this, arguments);
|
10552
10581
|
}
|
10553
10582
|
__name(_extends13, "_extends");
|
10554
|
-
var FormNestedItemLayout = /* @__PURE__ */ __name(({ content, removeButton }) => /* @__PURE__ */
|
10583
|
+
var FormNestedItemLayout = /* @__PURE__ */ __name(({ content, removeButton }) => /* @__PURE__ */ React21.createElement("div", {
|
10555
10584
|
className: "form-nested-item"
|
10556
|
-
}, /* @__PURE__ */
|
10585
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
10557
10586
|
className: "form-nested-item-inner"
|
10558
10587
|
}, content), removeButton && [
|
10559
|
-
/* @__PURE__ */
|
10588
|
+
/* @__PURE__ */ React21.createElement("div", {
|
10560
10589
|
key: "remove-button",
|
10561
10590
|
className: "form-nested-item-remove"
|
10562
10591
|
}, removeButton),
|
10563
|
-
/* @__PURE__ */
|
10592
|
+
/* @__PURE__ */ React21.createElement("div", {
|
10564
10593
|
key: "remove-button-overlay",
|
10565
10594
|
className: "form-nested-item-deleted-overlay"
|
10566
10595
|
})
|
@@ -10574,9 +10603,9 @@ var FormNestedItem = /* @__PURE__ */ __name((_a) => {
|
|
10574
10603
|
const VulcanComponents = useVulcanComponents();
|
10575
10604
|
const intl = useIntlContext4();
|
10576
10605
|
const isArray = typeof itemIndex !== "undefined";
|
10577
|
-
return /* @__PURE__ */
|
10606
|
+
return /* @__PURE__ */ React21.createElement(VulcanComponents.FormNestedItemLayout, {
|
10578
10607
|
content: nestedFields.map((field, i) => {
|
10579
|
-
return /* @__PURE__ */
|
10608
|
+
return /* @__PURE__ */ React21.createElement(VulcanComponents.FormComponent, _extends13({
|
10580
10609
|
key: i
|
10581
10610
|
}, props, field, {
|
10582
10611
|
path: `${path}.${field.name}`,
|
@@ -10584,10 +10613,10 @@ var FormNestedItem = /* @__PURE__ */ __name((_a) => {
|
|
10584
10613
|
}));
|
10585
10614
|
}),
|
10586
10615
|
removeButton: isArray && !hideRemove && [
|
10587
|
-
/* @__PURE__ */
|
10616
|
+
/* @__PURE__ */ React21.createElement("div", {
|
10588
10617
|
key: "remove-button",
|
10589
10618
|
className: "form-nested-item-remove"
|
10590
|
-
}, /* @__PURE__ */
|
10619
|
+
}, /* @__PURE__ */ React21.createElement(VulcanComponents.Button, {
|
10591
10620
|
className: "form-nested-button",
|
10592
10621
|
variant: "danger",
|
10593
10622
|
size: "sm",
|
@@ -10601,11 +10630,11 @@ var FormNestedItem = /* @__PURE__ */ __name((_a) => {
|
|
10601
10630
|
}, {
|
10602
10631
|
label
|
10603
10632
|
})
|
10604
|
-
}, /* @__PURE__ */
|
10633
|
+
}, /* @__PURE__ */ React21.createElement(VulcanComponents.IconRemove, {
|
10605
10634
|
height: 12,
|
10606
10635
|
width: 12
|
10607
10636
|
}))),
|
10608
|
-
/* @__PURE__ */
|
10637
|
+
/* @__PURE__ */ React21.createElement("div", {
|
10609
10638
|
key: "remove-button-overlay",
|
10610
10639
|
className: "form-nested-item-deleted-overlay"
|
10611
10640
|
})
|
@@ -10623,32 +10652,17 @@ FormNestedItem.contextTypes = {
|
|
10623
10652
|
intl: intlShape
|
10624
10653
|
};
|
10625
10654
|
|
10626
|
-
// components/form/FormNestedDivider.tsx
|
10655
|
+
// components/form/nested/FormNestedDivider.tsx
|
10627
10656
|
init_esm_shims();
|
10628
10657
|
var import_prop_types4 = __toESM(require_prop_types(), 1);
|
10629
|
-
import
|
10630
|
-
var FormNestedDivider = /* @__PURE__ */ __name(({ label, addItem }) => /* @__PURE__ */
|
10658
|
+
import React22 from "react";
|
10659
|
+
var FormNestedDivider = /* @__PURE__ */ __name(({ label, addItem }) => /* @__PURE__ */ React22.createElement("div", null), "FormNestedDivider");
|
10631
10660
|
FormNestedDivider.propTypes = {
|
10632
10661
|
label: import_prop_types4.default.string,
|
10633
10662
|
addItem: import_prop_types4.default.func
|
10634
10663
|
};
|
10635
10664
|
|
10636
|
-
// components/form/
|
10637
|
-
init_esm_shims();
|
10638
|
-
import React22 from "react";
|
10639
|
-
var FieldErrors = /* @__PURE__ */ __name(({ errors }) => {
|
10640
|
-
const VulcanComponents = useVulcanComponents();
|
10641
|
-
return /* @__PURE__ */ React22.createElement("ul", {
|
10642
|
-
className: "form-input-errors"
|
10643
|
-
}, errors.map((error, index) => /* @__PURE__ */ React22.createElement("li", {
|
10644
|
-
key: index
|
10645
|
-
}, /* @__PURE__ */ React22.createElement(VulcanComponents.FormError, {
|
10646
|
-
error,
|
10647
|
-
errorContext: "field"
|
10648
|
-
}))));
|
10649
|
-
}, "FieldErrors");
|
10650
|
-
|
10651
|
-
// components/form/FormNestedObject.tsx
|
10665
|
+
// components/form/nested/FormNestedObject.tsx
|
10652
10666
|
init_esm_shims();
|
10653
10667
|
var import_prop_types5 = __toESM(require_prop_types(), 1);
|
10654
10668
|
import React23 from "react";
|
@@ -10713,19 +10727,12 @@ FormNestedObject.propTypes = {
|
|
10713
10727
|
formComponents: import_prop_types5.default.object
|
10714
10728
|
};
|
10715
10729
|
|
10716
|
-
// components/form/
|
10730
|
+
// components/form/inputs/index.ts
|
10717
10731
|
init_esm_shims();
|
10718
|
-
import React24 from "react";
|
10719
|
-
var FormOptionLabel = /* @__PURE__ */ __name(({ option }) => {
|
10720
|
-
const { label } = option;
|
10721
|
-
return /* @__PURE__ */ React24.createElement("span", {
|
10722
|
-
className: "form-option-label"
|
10723
|
-
}, label);
|
10724
|
-
}, "FormOptionLabel");
|
10725
10732
|
|
10726
10733
|
// components/form/inputs/BasicInputs.tsx
|
10727
10734
|
init_esm_shims();
|
10728
|
-
import
|
10735
|
+
import React24 from "react";
|
10729
10736
|
function _extends15() {
|
10730
10737
|
_extends15 = Object.assign || function(target) {
|
10731
10738
|
for (var i = 1; i < arguments.length; i++) {
|
@@ -10745,75 +10752,93 @@ var HTMLInputAdapter = /* @__PURE__ */ __name((props) => {
|
|
10745
10752
|
const Components2 = useVulcanComponents();
|
10746
10753
|
const { inputProperties = {}, itemProperties = {}, path } = props;
|
10747
10754
|
const _a = inputProperties, { label, name: name2 } = _a, otherInputProperties = __objRest(_a, ["label", "name"]);
|
10748
|
-
return /* @__PURE__ */
|
10755
|
+
return /* @__PURE__ */ React24.createElement(Components2.FormItem, _extends15({
|
10749
10756
|
name: name2,
|
10750
10757
|
path,
|
10751
10758
|
label,
|
10752
10759
|
inputProperties
|
10753
|
-
}, itemProperties), /* @__PURE__ */
|
10760
|
+
}, itemProperties), /* @__PURE__ */ React24.createElement("input", _extends15({}, otherInputProperties, {
|
10754
10761
|
id: name2,
|
10755
10762
|
name: name2,
|
10756
10763
|
type: props.type
|
10757
10764
|
})));
|
10758
10765
|
}, "HTMLInputAdapter");
|
10759
|
-
var
|
10760
|
-
const { inputProperties, label, name: name2 } = props;
|
10761
|
-
return /* @__PURE__ */ React25.createElement("div", {
|
10762
|
-
className: `form-item ${name2}`
|
10763
|
-
}, /* @__PURE__ */ React25.createElement("label", {
|
10764
|
-
htmlFor: name2
|
10765
|
-
}, label), props.children);
|
10766
|
-
}, "FormItem");
|
10767
|
-
var HTMLSelectAdapter = /* @__PURE__ */ __name((props) => {
|
10768
|
-
const { multiple, path, inputProperties = {}, options = [], itemProperties } = props;
|
10769
|
-
const { label: label1, name: name2 } = inputProperties;
|
10770
|
-
if (!Array.isArray(options))
|
10771
|
-
throw new Error("HTMLSelectAdapater not yet supporting functional options");
|
10772
|
-
const Components2 = useVulcanComponents();
|
10773
|
-
return /* @__PURE__ */ React25.createElement(Components2.FormItem, _extends15({
|
10774
|
-
name: name2,
|
10775
|
-
label: label1,
|
10776
|
-
path,
|
10777
|
-
inputProperties
|
10778
|
-
}, itemProperties), /* @__PURE__ */ React25.createElement("select", _extends15({
|
10779
|
-
multiple
|
10780
|
-
}, inputProperties), options.map(({ label, value }) => /* @__PURE__ */ React25.createElement("option", {
|
10781
|
-
key: value,
|
10782
|
-
label,
|
10783
|
-
value
|
10784
|
-
}))));
|
10785
|
-
}, "HTMLSelectAdapter");
|
10786
|
-
var FormComponentDefault = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HTMLInputAdapter, _extends15({
|
10766
|
+
var FormComponentDefault = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10787
10767
|
type: "text"
|
10788
10768
|
}, props)), "FormComponentDefault");
|
10789
|
-
var FormComponentPassword = /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
10769
|
+
var FormComponentPassword = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10790
10770
|
type: "password"
|
10791
10771
|
}, props)), "FormComponentPassword");
|
10792
|
-
var FormComponentNumber = /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
10772
|
+
var FormComponentNumber = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10793
10773
|
type: "number"
|
10794
10774
|
}, props)), "FormComponentNumber");
|
10795
|
-
var FormComponentUrl = /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
10775
|
+
var FormComponentUrl = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10796
10776
|
type: "url"
|
10797
10777
|
}, props)), "FormComponentUrl");
|
10798
|
-
var FormComponentEmail = /* @__PURE__ */ __name((props) => /* @__PURE__ */
|
10778
|
+
var FormComponentEmail = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10799
10779
|
type: "email"
|
10800
10780
|
}, props)), "FormComponentEmail");
|
10801
|
-
var FormComponentTextarea = /* @__PURE__ */ __name((props) => {
|
10802
|
-
const { inputProperties, itemProperties } = props;
|
10803
|
-
return /* @__PURE__ */ React25.createElement("textarea", _extends15({}, inputProperties));
|
10804
|
-
}, "FormComponentTextarea");
|
10805
10781
|
var FormComponentCheckbox = /* @__PURE__ */ __name((props) => {
|
10806
|
-
return /* @__PURE__ */
|
10782
|
+
return /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10807
10783
|
type: "checkbox"
|
10808
10784
|
}, props));
|
10809
10785
|
}, "FormComponentCheckbox");
|
10786
|
+
var FormComponentDate = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10787
|
+
type: "date"
|
10788
|
+
}, props)), "FormComponentDate");
|
10789
|
+
var FormComponentDateTime = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10790
|
+
type: "datetime-local"
|
10791
|
+
}, props)), "FormComponentDateTime");
|
10792
|
+
var FormComponentTime = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React24.createElement(HTMLInputAdapter, _extends15({
|
10793
|
+
type: "time"
|
10794
|
+
}, props)), "FormComponentTime");
|
10795
|
+
var FormComponentStaticText = /* @__PURE__ */ __name((props) => {
|
10796
|
+
const { inputProperties } = props;
|
10797
|
+
return /* @__PURE__ */ React24.createElement("input", _extends15({}, inputProperties, {
|
10798
|
+
disabled: true
|
10799
|
+
}));
|
10800
|
+
}, "FormComponentStaticText");
|
10801
|
+
var FormComponentLikert = /* @__PURE__ */ __name((props) => "Likert component not yet implemented", "FormComponentLikert");
|
10802
|
+
var FormComponentAutocomplete = /* @__PURE__ */ __name((props) => "Autocomplete component not yet implemented", "FormComponentAutocomplete");
|
10803
|
+
var FormComponentTextarea = /* @__PURE__ */ __name((props) => {
|
10804
|
+
const Components2 = useVulcanComponents();
|
10805
|
+
const { inputProperties = {}, itemProperties = {}, path } = props;
|
10806
|
+
const _a = inputProperties, { label, name: name2 } = _a, otherInputProperties = __objRest(_a, ["label", "name"]);
|
10807
|
+
return /* @__PURE__ */ React24.createElement(Components2.FormItem, _extends15({
|
10808
|
+
name: name2,
|
10809
|
+
path,
|
10810
|
+
label,
|
10811
|
+
inputProperties
|
10812
|
+
}, itemProperties), /* @__PURE__ */ React24.createElement("label", {
|
10813
|
+
htmlFor: "name"
|
10814
|
+
}, label), /* @__PURE__ */ React24.createElement("textarea", _extends15({}, inputProperties)));
|
10815
|
+
}, "FormComponentTextarea");
|
10816
|
+
|
10817
|
+
// components/form/inputs/RadioGroup.tsx
|
10818
|
+
init_esm_shims();
|
10819
|
+
import React25 from "react";
|
10820
|
+
function _extends16() {
|
10821
|
+
_extends16 = Object.assign || function(target) {
|
10822
|
+
for (var i = 1; i < arguments.length; i++) {
|
10823
|
+
var source = arguments[i];
|
10824
|
+
for (var key in source) {
|
10825
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
10826
|
+
target[key] = source[key];
|
10827
|
+
}
|
10828
|
+
}
|
10829
|
+
}
|
10830
|
+
return target;
|
10831
|
+
};
|
10832
|
+
return _extends16.apply(this, arguments);
|
10833
|
+
}
|
10834
|
+
__name(_extends16, "_extends");
|
10810
10835
|
var FormComponentRadioGroup = /* @__PURE__ */ __name((props) => {
|
10811
|
-
const { path, inputProperties, options = [], itemProperties } = props;
|
10836
|
+
const { value: propsValue, path, inputProperties, options = [], itemProperties } = props;
|
10812
10837
|
const { label, name: name2 } = inputProperties;
|
10813
10838
|
if (!Array.isArray(options))
|
10814
10839
|
throw new Error("RadioGroup not yet supporting functional options");
|
10815
10840
|
const Components2 = useVulcanComponents();
|
10816
|
-
return /* @__PURE__ */ React25.createElement(Components2.FormItem,
|
10841
|
+
return /* @__PURE__ */ React25.createElement(Components2.FormItem, _extends16({
|
10817
10842
|
path,
|
10818
10843
|
name: name2,
|
10819
10844
|
label,
|
@@ -10825,45 +10850,27 @@ var FormComponentRadioGroup = /* @__PURE__ */ __name((props) => {
|
|
10825
10850
|
className: "form-radio-group-radio-item"
|
10826
10851
|
}, /* @__PURE__ */ React25.createElement(Components2.FormOptionLabel, {
|
10827
10852
|
option
|
10828
|
-
}), /* @__PURE__ */ React25.createElement("input", {
|
10853
|
+
}), /* @__PURE__ */ React25.createElement("input", _extends16({
|
10829
10854
|
type: "radio",
|
10830
10855
|
id: value,
|
10831
10856
|
name: name2,
|
10832
|
-
key: value
|
10833
|
-
|
10834
|
-
|
10857
|
+
key: value
|
10858
|
+
}, inputProperties, {
|
10859
|
+
value,
|
10860
|
+
checked: value === propsValue
|
10861
|
+
})));
|
10835
10862
|
}));
|
10836
10863
|
}, "FormComponentRadioGroup");
|
10837
|
-
var FormComponentSelect = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HTMLSelectAdapter, _extends15({}, props)), "FormComponentSelect");
|
10838
|
-
var FormComponentSelectMultiple = /* @__PURE__ */ __name((props) => {
|
10839
|
-
const Components2 = useVulcanComponents();
|
10840
|
-
return /* @__PURE__ */ React25.createElement(Components2.FormComponentSelect, _extends15({
|
10841
|
-
multiple: true
|
10842
|
-
}, props));
|
10843
|
-
}, "FormComponentSelectMultiple");
|
10844
|
-
var FormComponentDate = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HTMLInputAdapter, _extends15({
|
10845
|
-
type: "date"
|
10846
|
-
}, props)), "FormComponentDate");
|
10847
|
-
var FormComponentDateTime = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HTMLInputAdapter, _extends15({
|
10848
|
-
type: "datetime-local"
|
10849
|
-
}, props)), "FormComponentDateTime");
|
10850
|
-
var FormComponentTime = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement(HTMLInputAdapter, _extends15({
|
10851
|
-
type: "time"
|
10852
|
-
}, props)), "FormComponentTime");
|
10853
|
-
var FormComponentStaticText = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React25.createElement("input", _extends15({
|
10854
|
-
disabled: true
|
10855
|
-
}, props)), "FormComponentStaticText");
|
10856
|
-
var FormComponentLikert = /* @__PURE__ */ __name((props) => "Likert component not yet implemented", "FormComponentLikert");
|
10857
|
-
var FormComponentAutocomplete = /* @__PURE__ */ __name((props) => "Autocomplete component not yet implemented", "FormComponentAutocomplete");
|
10858
10864
|
|
10859
10865
|
// components/form/inputs/Checkboxgroup.tsx
|
10860
10866
|
init_esm_shims();
|
10861
10867
|
import React26, { useState as useState4 } from "react";
|
10862
10868
|
import without2 from "lodash/without.js";
|
10869
|
+
import omit3 from "lodash/omit.js";
|
10863
10870
|
import uniq2 from "lodash/uniq.js";
|
10864
10871
|
import isEmpty3 from "lodash/isEmpty.js";
|
10865
|
-
function
|
10866
|
-
|
10872
|
+
function _extends17() {
|
10873
|
+
_extends17 = Object.assign || function(target) {
|
10867
10874
|
for (var i = 1; i < arguments.length; i++) {
|
10868
10875
|
var source = arguments[i];
|
10869
10876
|
for (var key in source) {
|
@@ -10874,9 +10881,9 @@ function _extends16() {
|
|
10874
10881
|
}
|
10875
10882
|
return target;
|
10876
10883
|
};
|
10877
|
-
return
|
10884
|
+
return _extends17.apply(this, arguments);
|
10878
10885
|
}
|
10879
|
-
__name(
|
10886
|
+
__name(_extends17, "_extends");
|
10880
10887
|
var otherMarker = "[other]";
|
10881
10888
|
var isOtherValue = /* @__PURE__ */ __name((s) => s && typeof s === "string" && s.substr(0, otherMarker.length) === otherMarker, "isOtherValue");
|
10882
10889
|
var removeOtherMarker = /* @__PURE__ */ __name((s) => s && typeof s === "string" && s.substr(otherMarker.length), "removeOtherMarker");
|
@@ -10948,7 +10955,7 @@ var FormComponentCheckboxGroup = /* @__PURE__ */ __name((props) => {
|
|
10948
10955
|
throw new Error("FormComponentCheckboxGroup not yet supporting functional options");
|
10949
10956
|
const value = valueFromProps ? uniq2(valueFromProps.filter((v) => isOtherValue(v) || options.map((o) => o.value).includes(v))) : [];
|
10950
10957
|
const hasValue = value.length > 0;
|
10951
|
-
return /* @__PURE__ */ React26.createElement(Components2.FormItem,
|
10958
|
+
return /* @__PURE__ */ React26.createElement(Components2.FormItem, _extends17({
|
10952
10959
|
name: name2,
|
10953
10960
|
label,
|
10954
10961
|
path,
|
@@ -10958,12 +10965,15 @@ var FormComponentCheckboxGroup = /* @__PURE__ */ __name((props) => {
|
|
10958
10965
|
}, options.map((option, i) => {
|
10959
10966
|
const isChecked1 = value.includes(option.value);
|
10960
10967
|
const checkClass = hasValue ? isChecked1 ? "form-check-checked" : "form-check-unchecked" : "";
|
10961
|
-
return /* @__PURE__ */ React26.createElement(
|
10968
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
10969
|
+
className: "form-item-option",
|
10970
|
+
key: option.value
|
10971
|
+
}, /* @__PURE__ */ React26.createElement(Components2.FormOptionLabel, {
|
10962
10972
|
option,
|
10963
10973
|
name: name2
|
10964
|
-
}), /* @__PURE__ */ React26.createElement("input",
|
10974
|
+
}), /* @__PURE__ */ React26.createElement("input", _extends17({
|
10965
10975
|
type: "checkbox"
|
10966
|
-
}, inputProperties, {
|
10976
|
+
}, omit3(inputProperties, "value"), {
|
10967
10977
|
name: name2,
|
10968
10978
|
key: i,
|
10969
10979
|
checked: isChecked1,
|
@@ -10986,13 +10996,83 @@ var FormComponentCheckboxGroup = /* @__PURE__ */ __name((props) => {
|
|
10986
10996
|
})));
|
10987
10997
|
}, "FormComponentCheckboxGroup");
|
10988
10998
|
|
10999
|
+
// components/form/inputs/SelectInputs.tsx
|
11000
|
+
init_esm_shims();
|
11001
|
+
import React27 from "react";
|
11002
|
+
function _extends18() {
|
11003
|
+
_extends18 = Object.assign || function(target) {
|
11004
|
+
for (var i = 1; i < arguments.length; i++) {
|
11005
|
+
var source = arguments[i];
|
11006
|
+
for (var key in source) {
|
11007
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
11008
|
+
target[key] = source[key];
|
11009
|
+
}
|
11010
|
+
}
|
11011
|
+
}
|
11012
|
+
return target;
|
11013
|
+
};
|
11014
|
+
return _extends18.apply(this, arguments);
|
11015
|
+
}
|
11016
|
+
__name(_extends18, "_extends");
|
11017
|
+
var HTMLSelectAdapter = /* @__PURE__ */ __name((props) => {
|
11018
|
+
const { multiple, path, inputProperties = {}, options = [], itemProperties } = props;
|
11019
|
+
const { label: label1, name: name2 } = inputProperties;
|
11020
|
+
if (!Array.isArray(options))
|
11021
|
+
throw new Error("HTMLSelectAdapater not yet supporting functional options");
|
11022
|
+
const Components2 = useVulcanComponents();
|
11023
|
+
return /* @__PURE__ */ React27.createElement(Components2.FormItem, _extends18({
|
11024
|
+
name: name2,
|
11025
|
+
label: label1,
|
11026
|
+
path,
|
11027
|
+
inputProperties
|
11028
|
+
}, itemProperties), /* @__PURE__ */ React27.createElement("select", _extends18({
|
11029
|
+
multiple
|
11030
|
+
}, inputProperties, {
|
11031
|
+
value: inputProperties.value === null ? void 0 : inputProperties.value
|
11032
|
+
}), options.map(({ label, value }) => /* @__PURE__ */ React27.createElement("option", {
|
11033
|
+
key: value,
|
11034
|
+
label,
|
11035
|
+
value
|
11036
|
+
}))));
|
11037
|
+
}, "HTMLSelectAdapter");
|
11038
|
+
var FormComponentSelect = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React27.createElement(HTMLSelectAdapter, _extends18({}, props)), "FormComponentSelect");
|
11039
|
+
var FormComponentSelectMultiple = /* @__PURE__ */ __name((props) => {
|
11040
|
+
const Components2 = useVulcanComponents();
|
11041
|
+
return /* @__PURE__ */ React27.createElement(Components2.FormComponentSelect, _extends18({
|
11042
|
+
multiple: true
|
11043
|
+
}, props));
|
11044
|
+
}, "FormComponentSelectMultiple");
|
11045
|
+
|
11046
|
+
// components/form/inputs/FormItem.tsx
|
11047
|
+
init_esm_shims();
|
11048
|
+
import React28 from "react";
|
11049
|
+
var FormItem = /* @__PURE__ */ __name((props) => {
|
11050
|
+
const { inputProperties, label, name: name2 } = props;
|
11051
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
11052
|
+
className: `form-item ${name2}`
|
11053
|
+
}, /* @__PURE__ */ React28.createElement("label", {
|
11054
|
+
htmlFor: name2
|
11055
|
+
}, label), props.children);
|
11056
|
+
}, "FormItem");
|
11057
|
+
|
11058
|
+
// components/form/inputs/FormOptionLabel.tsx
|
11059
|
+
init_esm_shims();
|
11060
|
+
import React29 from "react";
|
11061
|
+
var FormOptionLabel = /* @__PURE__ */ __name(({ option, name: name2 }) => {
|
11062
|
+
const { label } = option;
|
11063
|
+
return /* @__PURE__ */ React29.createElement("label", {
|
11064
|
+
htmlFor: name2,
|
11065
|
+
className: "form-option-label"
|
11066
|
+
}, label);
|
11067
|
+
}, "FormOptionLabel");
|
11068
|
+
|
10989
11069
|
// components/form/inputs/AutocompleteMultiple.tsx
|
10990
11070
|
init_esm_shims();
|
10991
11071
|
import { AsyncTypeahead } from "react-bootstrap-typeahead";
|
10992
|
-
import
|
11072
|
+
import React30, { useState as useState5 } from "react";
|
10993
11073
|
import { useLazyQuery as useLazyQuery2 } from "@apollo/client";
|
10994
|
-
function
|
10995
|
-
|
11074
|
+
function _extends19() {
|
11075
|
+
_extends19 = Object.assign || function(target) {
|
10996
11076
|
for (var i = 1; i < arguments.length; i++) {
|
10997
11077
|
var source = arguments[i];
|
10998
11078
|
for (var key in source) {
|
@@ -11003,9 +11083,9 @@ function _extends17() {
|
|
11003
11083
|
}
|
11004
11084
|
return target;
|
11005
11085
|
};
|
11006
|
-
return
|
11086
|
+
return _extends19.apply(this, arguments);
|
11007
11087
|
}
|
11008
|
-
__name(
|
11088
|
+
__name(_extends19, "_extends");
|
11009
11089
|
var AutocompleteMultiple = /* @__PURE__ */ __name((props) => {
|
11010
11090
|
const {
|
11011
11091
|
queryData,
|
@@ -11034,9 +11114,9 @@ var AutocompleteMultiple = /* @__PURE__ */ __name((props) => {
|
|
11034
11114
|
const selectedItems = queryData && optionsFunction({
|
11035
11115
|
data: queryData
|
11036
11116
|
}).filter((d) => value1.includes(d.value));
|
11037
|
-
return /* @__PURE__ */
|
11117
|
+
return /* @__PURE__ */ React30.createElement(Components2.FormItem, _extends19({}, props, itemProperties, {
|
11038
11118
|
name: path
|
11039
|
-
}), /* @__PURE__ */
|
11119
|
+
}), /* @__PURE__ */ React30.createElement(AsyncTypeahead, _extends19({}, inputProperties, {
|
11040
11120
|
multiple: true,
|
11041
11121
|
onChange: (selected) => {
|
11042
11122
|
const selectedIds = selected.map(({ value }) => value);
|
@@ -11116,14 +11196,14 @@ init_esm_shims();
|
|
11116
11196
|
|
11117
11197
|
// components/Datatable/Datatable.tsx
|
11118
11198
|
init_esm_shims();
|
11119
|
-
import
|
11199
|
+
import React31, { useEffect as useEffect6, useState as useState6 } from "react";
|
11120
11200
|
import _isEmpty from "lodash/isEmpty.js";
|
11121
11201
|
import { useMulti } from "@vulcanjs/react-hooks";
|
11122
11202
|
import { isAdmin as isAdmin2 } from "@vulcanjs/permissions";
|
11123
11203
|
import { useIntlContext as useIntlContext5 } from "@vulcanjs/react-i18n";
|
11124
11204
|
import { permissionCheck } from "@vulcanjs/permissions";
|
11125
|
-
function
|
11126
|
-
|
11205
|
+
function _extends20() {
|
11206
|
+
_extends20 = Object.assign || function(target) {
|
11127
11207
|
for (var i = 1; i < arguments.length; i++) {
|
11128
11208
|
var source = arguments[i];
|
11129
11209
|
for (var key in source) {
|
@@ -11134,9 +11214,9 @@ function _extends18() {
|
|
11134
11214
|
}
|
11135
11215
|
return target;
|
11136
11216
|
};
|
11137
|
-
return
|
11217
|
+
return _extends20.apply(this, arguments);
|
11138
11218
|
}
|
11139
|
-
__name(
|
11219
|
+
__name(_extends20, "_extends");
|
11140
11220
|
var ascSortOperator = "asc";
|
11141
11221
|
var descSortOperator = "desc";
|
11142
11222
|
var delay = function() {
|
@@ -11237,7 +11317,7 @@ var Datatable = /* @__PURE__ */ __name((props) => {
|
|
11237
11317
|
}
|
11238
11318
|
}));
|
11239
11319
|
if (data) {
|
11240
|
-
return /* @__PURE__ */
|
11320
|
+
return /* @__PURE__ */ React31.createElement(Components2.DatatableContents, _extends20({}, props, {
|
11241
11321
|
datatableData: data,
|
11242
11322
|
totalCount: data.length,
|
11243
11323
|
results: data,
|
@@ -11268,9 +11348,9 @@ var Datatable = /* @__PURE__ */ __name((props) => {
|
|
11268
11348
|
if (!_isEmpty(state.currentFilters)) {
|
11269
11349
|
input.filter = state.currentFilters;
|
11270
11350
|
}
|
11271
|
-
return /* @__PURE__ */
|
11351
|
+
return /* @__PURE__ */ React31.createElement(Components2.DatatableLayout, {
|
11272
11352
|
model
|
11273
|
-
}, /* @__PURE__ */
|
11353
|
+
}, /* @__PURE__ */ React31.createElement(Components2.DatatableAbove, _extends20({}, props, {
|
11274
11354
|
model,
|
11275
11355
|
canInsert: canCreate,
|
11276
11356
|
canCreate,
|
@@ -11278,7 +11358,7 @@ var Datatable = /* @__PURE__ */ __name((props) => {
|
|
11278
11358
|
updateSearch,
|
11279
11359
|
selectedItems: state.selectedItems,
|
11280
11360
|
onSubmitSelected
|
11281
|
-
})), /* @__PURE__ */
|
11361
|
+
})), /* @__PURE__ */ React31.createElement(Components2.DatatableContents, _extends20({}, props, {
|
11282
11362
|
results: multiRes.documents,
|
11283
11363
|
totalCount: multiRes.totalCount,
|
11284
11364
|
count: multiRes.count,
|
@@ -11292,20 +11372,20 @@ var Datatable = /* @__PURE__ */ __name((props) => {
|
|
11292
11372
|
toggleItem
|
11293
11373
|
})));
|
11294
11374
|
}, "Datatable");
|
11295
|
-
var DatatableLayout = /* @__PURE__ */ __name(({ model, children }) => /* @__PURE__ */
|
11375
|
+
var DatatableLayout = /* @__PURE__ */ __name(({ model, children }) => /* @__PURE__ */ React31.createElement("div", {
|
11296
11376
|
className: `datatable datatable-${model.name.toLowerCase()}`
|
11297
11377
|
}, children), "DatatableLayout");
|
11298
11378
|
var DatatableAbove = /* @__PURE__ */ __name((props) => {
|
11299
11379
|
const Components2 = useVulcanComponents();
|
11300
|
-
return /* @__PURE__ */
|
11380
|
+
return /* @__PURE__ */ React31.createElement(Components2.DatatableAboveLayout, null, /* @__PURE__ */ React31.createElement(Components2.DatatableAboveLeft, _extends20({}, props)), /* @__PURE__ */ React31.createElement(Components2.DatatableAboveRight, _extends20({}, props)));
|
11301
11381
|
}, "DatatableAbove");
|
11302
11382
|
var DatatableAboveLeft = /* @__PURE__ */ __name((props) => {
|
11303
11383
|
const { showSearch, searchValue, updateSearch } = props;
|
11304
11384
|
const Components2 = useVulcanComponents();
|
11305
11385
|
const intl = useIntlContext5();
|
11306
|
-
return /* @__PURE__ */
|
11386
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
11307
11387
|
className: "datatable-above-left"
|
11308
|
-
}, showSearch && /* @__PURE__ */
|
11388
|
+
}, showSearch && /* @__PURE__ */ React31.createElement(Components2.DatatableAboveSearchInput, {
|
11309
11389
|
className: "datatable-search form-control",
|
11310
11390
|
inputProperties: {
|
11311
11391
|
path: "datatableSearchQuery",
|
@@ -11321,16 +11401,16 @@ var DatatableAboveLeft = /* @__PURE__ */ __name((props) => {
|
|
11321
11401
|
var DatatableAboveRight = /* @__PURE__ */ __name((props) => {
|
11322
11402
|
const { currentUser, showNew, canInsert, options, newFormOptions, newFormProps, showSelect, selectedItems, onSubmitSelected, model } = props;
|
11323
11403
|
const Components2 = useVulcanComponents();
|
11324
|
-
return /* @__PURE__ */
|
11404
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
11325
11405
|
className: "datatable-above-right"
|
11326
|
-
}, showSelect && selectedItems.length > 0 && /* @__PURE__ */
|
11406
|
+
}, showSelect && selectedItems.length > 0 && /* @__PURE__ */ React31.createElement("div", {
|
11327
11407
|
className: "datatable-above-item"
|
11328
|
-
}, /* @__PURE__ */
|
11408
|
+
}, /* @__PURE__ */ React31.createElement(Components2.DatatableSubmitSelected, {
|
11329
11409
|
selectedItems,
|
11330
11410
|
onSubmitSelected
|
11331
|
-
})), showNew && canInsert && /* @__PURE__ */
|
11411
|
+
})), showNew && canInsert && /* @__PURE__ */ React31.createElement("div", {
|
11332
11412
|
className: "datatable-above-item"
|
11333
|
-
}, /* @__PURE__ */
|
11413
|
+
}, /* @__PURE__ */ React31.createElement(Components2.NewButton, _extends20({
|
11334
11414
|
model,
|
11335
11415
|
currentUser,
|
11336
11416
|
mutationFragmentName: options && options.fragmentName
|
@@ -11338,20 +11418,20 @@ var DatatableAboveRight = /* @__PURE__ */ __name((props) => {
|
|
11338
11418
|
}, "DatatableAboveRight");
|
11339
11419
|
var DatatableAboveSearchInput = /* @__PURE__ */ __name((props) => {
|
11340
11420
|
const Components2 = useVulcanComponents();
|
11341
|
-
return /* @__PURE__ */
|
11421
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
11342
11422
|
className: "datatable-above-search-input"
|
11343
|
-
}, /* @__PURE__ */
|
11423
|
+
}, /* @__PURE__ */ React31.createElement(Components2.FormComponentText, _extends20({}, props)));
|
11344
11424
|
}, "DatatableAboveSearchInput");
|
11345
|
-
var DatatableAboveLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11425
|
+
var DatatableAboveLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React31.createElement("div", {
|
11346
11426
|
className: "datatable-above"
|
11347
11427
|
}, children), "DatatableAboveLayout");
|
11348
11428
|
|
11349
11429
|
// components/Datatable/DatatableContents.tsx
|
11350
11430
|
init_esm_shims();
|
11351
|
-
import
|
11431
|
+
import React32 from "react";
|
11352
11432
|
import _sortBy from "lodash/sortBy.js";
|
11353
|
-
function
|
11354
|
-
|
11433
|
+
function _extends21() {
|
11434
|
+
_extends21 = Object.assign || function(target) {
|
11355
11435
|
for (var i = 1; i < arguments.length; i++) {
|
11356
11436
|
var source = arguments[i];
|
11357
11437
|
for (var key in source) {
|
@@ -11362,9 +11442,9 @@ function _extends19() {
|
|
11362
11442
|
}
|
11363
11443
|
return target;
|
11364
11444
|
};
|
11365
|
-
return
|
11445
|
+
return _extends21.apply(this, arguments);
|
11366
11446
|
}
|
11367
|
-
__name(
|
11447
|
+
__name(_extends21, "_extends");
|
11368
11448
|
var wrapColumns = /* @__PURE__ */ __name((c) => ({
|
11369
11449
|
name: c
|
11370
11450
|
}), "wrapColumns");
|
@@ -11386,18 +11466,18 @@ var DatatableContents = /* @__PURE__ */ __name((props) => {
|
|
11386
11466
|
let { title = "", datatableData, results = [], columns, loading, loadMore, count = 0, totalCount = 0, networkStatus, showEdit, showDelete, currentUser, toggleSort, currentSort, submitFilters, currentFilters, modalProps, error, showSelect, model } = props;
|
11387
11467
|
const Components2 = useVulcanComponents();
|
11388
11468
|
if (loading) {
|
11389
|
-
return /* @__PURE__ */
|
11469
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
11390
11470
|
className: "datatable-list datatable-list-loading"
|
11391
|
-
}, /* @__PURE__ */
|
11471
|
+
}, /* @__PURE__ */ React32.createElement(Components2.Loading, null));
|
11392
11472
|
}
|
11393
11473
|
const isLoadingMore = networkStatus === 2;
|
11394
11474
|
const hasMore = results && totalCount > results.length;
|
11395
11475
|
const sortedColumns = getColumns(columns, results, datatableData);
|
11396
|
-
return /* @__PURE__ */
|
11476
|
+
return /* @__PURE__ */ React32.createElement(Components2.DatatableContentsLayout, null, error && /* @__PURE__ */ React32.createElement(Components2.Alert, {
|
11397
11477
|
variant: "danger"
|
11398
|
-
}, error.message), title && /* @__PURE__ */
|
11478
|
+
}, error.message), title && /* @__PURE__ */ React32.createElement(Components2.DatatableTitle, {
|
11399
11479
|
title
|
11400
|
-
}), /* @__PURE__ */
|
11480
|
+
}), /* @__PURE__ */ React32.createElement(Components2.DatatableContentsInnerLayout, null, /* @__PURE__ */ React32.createElement(Components2.DatatableContentsHeadLayout, null, showSelect && /* @__PURE__ */ React32.createElement("th", null), sortedColumns.map((column, index) => /* @__PURE__ */ React32.createElement(Components2.DatatableHeader, {
|
11401
11481
|
key: index,
|
11402
11482
|
model,
|
11403
11483
|
column,
|
@@ -11405,13 +11485,13 @@ var DatatableContents = /* @__PURE__ */ __name((props) => {
|
|
11405
11485
|
currentSort,
|
11406
11486
|
submitFilters,
|
11407
11487
|
currentFilters
|
11408
|
-
})), showEdit ? /* @__PURE__ */
|
11488
|
+
})), showEdit ? /* @__PURE__ */ React32.createElement("th", null, /* @__PURE__ */ React32.createElement(Components2.FormattedMessage, {
|
11409
11489
|
id: "datatable.edit",
|
11410
11490
|
defaultMessage: "Edit"
|
11411
|
-
})) : null, showDelete ? /* @__PURE__ */
|
11491
|
+
})) : null, showDelete ? /* @__PURE__ */ React32.createElement("th", null, /* @__PURE__ */ React32.createElement(Components2.FormattedMessage, {
|
11412
11492
|
id: "datatable.delete",
|
11413
11493
|
defaultMessage: "Delete"
|
11414
|
-
})) : null), /* @__PURE__ */
|
11494
|
+
})) : null), /* @__PURE__ */ React32.createElement(Components2.DatatableContentsBodyLayout, null, results && results.length ? results.map((document, index) => /* @__PURE__ */ React32.createElement(Components2.DatatableRow, _extends21({}, props, {
|
11415
11495
|
model,
|
11416
11496
|
columns: sortedColumns,
|
11417
11497
|
document,
|
@@ -11420,7 +11500,7 @@ var DatatableContents = /* @__PURE__ */ __name((props) => {
|
|
11420
11500
|
showDelete,
|
11421
11501
|
currentUser,
|
11422
11502
|
modalProps
|
11423
|
-
}))) : /* @__PURE__ */
|
11503
|
+
}))) : /* @__PURE__ */ React32.createElement(Components2.DatatableEmpty, null))), hasMore && /* @__PURE__ */ React32.createElement(Components2.DatatableContentsMoreLayout, null, isLoadingMore ? /* @__PURE__ */ React32.createElement(Components2.Loading, null) : /* @__PURE__ */ React32.createElement(Components2.DatatableLoadMoreButton, {
|
11424
11504
|
count,
|
11425
11505
|
totalCount,
|
11426
11506
|
onClick: (e) => {
|
@@ -11429,37 +11509,37 @@ var DatatableContents = /* @__PURE__ */ __name((props) => {
|
|
11429
11509
|
}
|
11430
11510
|
}, "Load More (", count, "/", totalCount, ")")));
|
11431
11511
|
}, "DatatableContents");
|
11432
|
-
var DatatableContentsLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11512
|
+
var DatatableContentsLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React32.createElement("div", {
|
11433
11513
|
className: "datatable-list"
|
11434
11514
|
}, children), "DatatableContentsLayout");
|
11435
|
-
var DatatableContentsInnerLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11515
|
+
var DatatableContentsInnerLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React32.createElement("table", {
|
11436
11516
|
className: "table"
|
11437
11517
|
}, children), "DatatableContentsInnerLayout");
|
11438
|
-
var DatatableContentsHeadLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11439
|
-
var DatatableContentsBodyLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11440
|
-
var DatatableContentsMoreLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
11518
|
+
var DatatableContentsHeadLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React32.createElement("thead", null, /* @__PURE__ */ React32.createElement("tr", null, children)), "DatatableContentsHeadLayout");
|
11519
|
+
var DatatableContentsBodyLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React32.createElement("tbody", null, children), "DatatableContentsBodyLayout");
|
11520
|
+
var DatatableContentsMoreLayout = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ React32.createElement("div", {
|
11441
11521
|
className: "datatable-list-load-more"
|
11442
11522
|
}, children), "DatatableContentsMoreLayout");
|
11443
11523
|
var DatatableLoadMoreButton = /* @__PURE__ */ __name((_a) => {
|
11444
11524
|
var _b = _a, { count, totalCount, children } = _b, otherProps = __objRest(_b, ["count", "totalCount", "children"]);
|
11445
11525
|
const Components2 = useVulcanComponents();
|
11446
|
-
return /* @__PURE__ */
|
11526
|
+
return /* @__PURE__ */ React32.createElement(Components2.Button, _extends21({
|
11447
11527
|
variant: "primary"
|
11448
11528
|
}, otherProps), children);
|
11449
11529
|
}, "DatatableLoadMoreButton");
|
11450
|
-
var DatatableTitle = /* @__PURE__ */ __name(({ title }) => /* @__PURE__ */
|
11530
|
+
var DatatableTitle = /* @__PURE__ */ __name(({ title }) => /* @__PURE__ */ React32.createElement("div", {
|
11451
11531
|
className: "datatable-title"
|
11452
11532
|
}, title), "DatatableTitle");
|
11453
11533
|
var DatatableEmpty = /* @__PURE__ */ __name(() => {
|
11454
11534
|
const Components2 = useVulcanComponents();
|
11455
|
-
return /* @__PURE__ */
|
11535
|
+
return /* @__PURE__ */ React32.createElement("tr", null, /* @__PURE__ */ React32.createElement("td", {
|
11456
11536
|
colSpan: 99
|
11457
|
-
}, /* @__PURE__ */
|
11537
|
+
}, /* @__PURE__ */ React32.createElement("div", {
|
11458
11538
|
style: {
|
11459
11539
|
textAlign: "center",
|
11460
11540
|
padding: 10
|
11461
11541
|
}
|
11462
|
-
}, /* @__PURE__ */
|
11542
|
+
}, /* @__PURE__ */ React32.createElement(Components2.FormattedMessage, {
|
11463
11543
|
id: "datatable.empty",
|
11464
11544
|
defaultMessage: "No items to display."
|
11465
11545
|
}))));
|
@@ -11467,11 +11547,11 @@ var DatatableEmpty = /* @__PURE__ */ __name(() => {
|
|
11467
11547
|
|
11468
11548
|
// components/Datatable/DatatableHeader.tsx
|
11469
11549
|
init_esm_shims();
|
11470
|
-
import
|
11550
|
+
import React33 from "react";
|
11471
11551
|
import { useIntlContext as useIntlContext6 } from "@vulcanjs/react-i18n";
|
11472
11552
|
import { formatLabel as formatLabel2 } from "@vulcanjs/i18n";
|
11473
|
-
function
|
11474
|
-
|
11553
|
+
function _extends22() {
|
11554
|
+
_extends22 = Object.assign || function(target) {
|
11475
11555
|
for (var i = 1; i < arguments.length; i++) {
|
11476
11556
|
var source = arguments[i];
|
11477
11557
|
for (var key in source) {
|
@@ -11482,9 +11562,9 @@ function _extends20() {
|
|
11482
11562
|
}
|
11483
11563
|
return target;
|
11484
11564
|
};
|
11485
|
-
return
|
11565
|
+
return _extends22.apply(this, arguments);
|
11486
11566
|
}
|
11487
|
-
__name(
|
11567
|
+
__name(_extends22, "_extends");
|
11488
11568
|
var DatatableHeader = /* @__PURE__ */ __name(({ model, column, toggleSort, currentSort, submitFilters, currentFilters }) => {
|
11489
11569
|
const Components2 = useVulcanComponents();
|
11490
11570
|
const intl = useIntlContext6();
|
@@ -11505,16 +11585,16 @@ var DatatableHeader = /* @__PURE__ */ __name(({ model, column, toggleSort, curre
|
|
11505
11585
|
const fieldOptions = field && field.options;
|
11506
11586
|
const filterOptions = column.options ? column.options : fieldOptions;
|
11507
11587
|
const filterQuery = field && field.staticQuery;
|
11508
|
-
return /* @__PURE__ */
|
11588
|
+
return /* @__PURE__ */ React33.createElement(Components2.DatatableHeaderCellLayout, {
|
11509
11589
|
className: `datatable-header-${column.name}`
|
11510
|
-
}, /* @__PURE__ */
|
11590
|
+
}, /* @__PURE__ */ React33.createElement("span", {
|
11511
11591
|
className: "datatable-header-cell-label"
|
11512
|
-
}, formattedLabel), column.sortable && /* @__PURE__ */
|
11592
|
+
}, formattedLabel), column.sortable && /* @__PURE__ */ React33.createElement(Components2.DatatableSorter, {
|
11513
11593
|
name: column.name,
|
11514
11594
|
label: formattedLabel,
|
11515
11595
|
toggleSort,
|
11516
11596
|
currentSort
|
11517
|
-
}), column.filterable && /* @__PURE__ */
|
11597
|
+
}), column.filterable && /* @__PURE__ */ React33.createElement(Components2.DatatableFilter, {
|
11518
11598
|
model,
|
11519
11599
|
field,
|
11520
11600
|
name: column.name,
|
@@ -11530,25 +11610,25 @@ var DatatableHeader = /* @__PURE__ */ __name(({ model, column, toggleSort, curre
|
|
11530
11610
|
id: column.name,
|
11531
11611
|
defaultMessage: column.name
|
11532
11612
|
});
|
11533
|
-
return /* @__PURE__ */
|
11613
|
+
return /* @__PURE__ */ React33.createElement(Components2.DatatableHeaderCellLayout, {
|
11534
11614
|
className: `datatable-th-${formattedLabel2.toLowerCase().replace(/\s/g, "-")}`
|
11535
11615
|
}, formattedLabel2);
|
11536
11616
|
}
|
11537
11617
|
}, "DatatableHeader");
|
11538
11618
|
var DatatableHeaderCellLayout = /* @__PURE__ */ __name((_a) => {
|
11539
11619
|
var _b = _a, { children } = _b, otherProps = __objRest(_b, ["children"]);
|
11540
|
-
return /* @__PURE__ */
|
11620
|
+
return /* @__PURE__ */ React33.createElement("th", _extends22({}, otherProps), /* @__PURE__ */ React33.createElement("div", {
|
11541
11621
|
className: "datatable-header-cell-inner"
|
11542
11622
|
}, children));
|
11543
11623
|
}, "DatatableHeaderCellLayout");
|
11544
11624
|
|
11545
11625
|
// components/Datatable/DatatableRow.tsx
|
11546
11626
|
init_esm_shims();
|
11547
|
-
import
|
11627
|
+
import React34 from "react";
|
11548
11628
|
import _isFunction from "lodash/isFunction.js";
|
11549
11629
|
import { isAdmin as isAdmin3, permissionCheck as permissionCheck2 } from "@vulcanjs/permissions";
|
11550
|
-
function
|
11551
|
-
|
11630
|
+
function _extends23() {
|
11631
|
+
_extends23 = Object.assign || function(target) {
|
11552
11632
|
for (var i = 1; i < arguments.length; i++) {
|
11553
11633
|
var source = arguments[i];
|
11554
11634
|
for (var key in source) {
|
@@ -11559,9 +11639,9 @@ function _extends21() {
|
|
11559
11639
|
}
|
11560
11640
|
return target;
|
11561
11641
|
};
|
11562
|
-
return
|
11642
|
+
return _extends23.apply(this, arguments);
|
11563
11643
|
}
|
11564
|
-
__name(
|
11644
|
+
__name(_extends23, "_extends");
|
11565
11645
|
var DatatableRow = /* @__PURE__ */ __name((props) => {
|
11566
11646
|
const { model, columns, document, showEdit, showDelete, currentUser, options, editFormOptions, editFormProps, rowClass, showSelect, toggleItem, selectedItems } = props;
|
11567
11647
|
const Components2 = useVulcanComponents();
|
@@ -11580,33 +11660,33 @@ var DatatableRow = /* @__PURE__ */ __name((props) => {
|
|
11580
11660
|
const row = typeof rowClass === "function" ? rowClass(document) : rowClass || "";
|
11581
11661
|
const { modalProps = {} } = props;
|
11582
11662
|
const defaultModalProps = {
|
11583
|
-
title: /* @__PURE__ */
|
11663
|
+
title: /* @__PURE__ */ React34.createElement("code", null, document._id)
|
11584
11664
|
};
|
11585
11665
|
const customModalProps = __spreadValues(__spreadValues({}, defaultModalProps), _isFunction(modalProps) ? modalProps(document) : modalProps);
|
11586
11666
|
const isSelected = selectedItems && selectedItems.includes(document._id);
|
11587
|
-
return /* @__PURE__ */
|
11667
|
+
return /* @__PURE__ */ React34.createElement(Components2.DatatableRowLayout, {
|
11588
11668
|
className: `datatable-item ${row} ${isSelected ? "datatable-item-selected" : ""}`
|
11589
|
-
}, showSelect && /* @__PURE__ */
|
11669
|
+
}, showSelect && /* @__PURE__ */ React34.createElement(Components2.DatatableSelect, {
|
11590
11670
|
document,
|
11591
11671
|
toggleItem,
|
11592
11672
|
selectedItems
|
11593
|
-
}), columns.map((column, index) => /* @__PURE__ */
|
11673
|
+
}), columns.map((column, index) => /* @__PURE__ */ React34.createElement(Components2.DatatableCell, {
|
11594
11674
|
key: index,
|
11595
11675
|
column,
|
11596
11676
|
document,
|
11597
11677
|
currentUser,
|
11598
11678
|
model
|
11599
|
-
})), showEdit && canUpdate ? /* @__PURE__ */
|
11679
|
+
})), showEdit && canUpdate ? /* @__PURE__ */ React34.createElement(Components2.DatatableCellLayout, {
|
11600
11680
|
className: "datatable-edit"
|
11601
|
-
}, /* @__PURE__ */
|
11681
|
+
}, /* @__PURE__ */ React34.createElement(Components2.EditButton, _extends23({
|
11602
11682
|
model,
|
11603
11683
|
documentId: document._id,
|
11604
11684
|
currentUser,
|
11605
11685
|
mutationFragmentName: options && options.fragmentName,
|
11606
11686
|
modalProps: customModalProps
|
11607
|
-
}, editFormOptions, editFormProps))) : null, showDelete && canUpdate ? /* @__PURE__ */
|
11687
|
+
}, editFormOptions, editFormProps))) : null, showDelete && canUpdate ? /* @__PURE__ */ React34.createElement(Components2.DatatableCellLayout, {
|
11608
11688
|
className: "datatable-delete"
|
11609
|
-
}, /* @__PURE__ */
|
11689
|
+
}, /* @__PURE__ */ React34.createElement(Components2.DeleteButton, {
|
11610
11690
|
model,
|
11611
11691
|
documentId: document._id,
|
11612
11692
|
currentUser
|
@@ -11614,14 +11694,14 @@ var DatatableRow = /* @__PURE__ */ __name((props) => {
|
|
11614
11694
|
}, "DatatableRow");
|
11615
11695
|
var DatatableRowLayout = /* @__PURE__ */ __name((_a) => {
|
11616
11696
|
var _b = _a, { children } = _b, otherProps = __objRest(_b, ["children"]);
|
11617
|
-
return /* @__PURE__ */
|
11697
|
+
return /* @__PURE__ */ React34.createElement("tr", _extends23({}, otherProps), children);
|
11618
11698
|
}, "DatatableRowLayout");
|
11619
11699
|
|
11620
11700
|
// components/Datatable/DatatableCell.tsx
|
11621
11701
|
init_esm_shims();
|
11622
|
-
import
|
11623
|
-
function
|
11624
|
-
|
11702
|
+
import React35 from "react";
|
11703
|
+
function _extends24() {
|
11704
|
+
_extends24 = Object.assign || function(target) {
|
11625
11705
|
for (var i = 1; i < arguments.length; i++) {
|
11626
11706
|
var source = arguments[i];
|
11627
11707
|
for (var key in source) {
|
@@ -11632,18 +11712,18 @@ function _extends22() {
|
|
11632
11712
|
}
|
11633
11713
|
return target;
|
11634
11714
|
};
|
11635
|
-
return
|
11715
|
+
return _extends24.apply(this, arguments);
|
11636
11716
|
}
|
11637
|
-
__name(
|
11717
|
+
__name(_extends24, "_extends");
|
11638
11718
|
var DatatableCell = /* @__PURE__ */ __name(({ column, document, currentUser, model }) => {
|
11639
11719
|
const Components2 = useVulcanComponents();
|
11640
11720
|
const Component = column.component || column.componentName && Components2[column.componentName] || Components2.DatatableDefaultCell;
|
11641
11721
|
const columnName = column.label || column.name;
|
11642
11722
|
if (!columnName)
|
11643
11723
|
throw new Error("Column should have name or label");
|
11644
|
-
return /* @__PURE__ */
|
11724
|
+
return /* @__PURE__ */ React35.createElement(Components2.DatatableCellLayout, {
|
11645
11725
|
className: `datatable-item-${columnName.toLowerCase().replace(/\s/g, "-")}`
|
11646
|
-
}, /* @__PURE__ */
|
11726
|
+
}, /* @__PURE__ */ React35.createElement(Component, {
|
11647
11727
|
column,
|
11648
11728
|
document,
|
11649
11729
|
currentUser,
|
@@ -11652,14 +11732,14 @@ var DatatableCell = /* @__PURE__ */ __name(({ column, document, currentUser, mod
|
|
11652
11732
|
}, "DatatableCell");
|
11653
11733
|
var DatatableCellLayout = /* @__PURE__ */ __name((_a) => {
|
11654
11734
|
var _b = _a, { children } = _b, otherProps = __objRest(_b, ["children"]);
|
11655
|
-
return /* @__PURE__ */
|
11735
|
+
return /* @__PURE__ */ React35.createElement("td", _extends24({}, otherProps), /* @__PURE__ */ React35.createElement("div", {
|
11656
11736
|
className: "cell-contents"
|
11657
11737
|
}, children));
|
11658
11738
|
}, "DatatableCellLayout");
|
11659
11739
|
var DatatableDefaultCell = /* @__PURE__ */ __name((_a) => {
|
11660
11740
|
var _b = _a, { column, document } = _b, rest = __objRest(_b, ["column", "document"]);
|
11661
11741
|
const Components2 = useVulcanComponents();
|
11662
|
-
return /* @__PURE__ */
|
11742
|
+
return /* @__PURE__ */ React35.createElement(Components2.CardItemSwitcher, _extends24({
|
11663
11743
|
value: document[column.name],
|
11664
11744
|
document,
|
11665
11745
|
fieldName: column.name
|
@@ -11669,11 +11749,11 @@ var DatatableDefaultCell = /* @__PURE__ */ __name((_a) => {
|
|
11669
11749
|
// components/Datatable/DatatableFilter.tsx
|
11670
11750
|
init_esm_shims();
|
11671
11751
|
var import_moment = __toESM(require_moment(), 1);
|
11672
|
-
import
|
11752
|
+
import React36, { useState as useState7 } from "react";
|
11673
11753
|
import { useQuery } from "@apollo/client";
|
11674
11754
|
import isEmpty4 from "lodash/isEmpty.js";
|
11675
|
-
function
|
11676
|
-
|
11755
|
+
function _extends25() {
|
11756
|
+
_extends25 = Object.assign || function(target) {
|
11677
11757
|
for (var i = 1; i < arguments.length; i++) {
|
11678
11758
|
var source = arguments[i];
|
11679
11759
|
for (var key in source) {
|
@@ -11684,9 +11764,9 @@ function _extends23() {
|
|
11684
11764
|
}
|
11685
11765
|
return target;
|
11686
11766
|
};
|
11687
|
-
return
|
11767
|
+
return _extends25.apply(this, arguments);
|
11688
11768
|
}
|
11689
|
-
__name(
|
11769
|
+
__name(_extends25, "_extends");
|
11690
11770
|
var getCount = /* @__PURE__ */ __name((columnFilters) => {
|
11691
11771
|
if (!columnFilters) {
|
11692
11772
|
return 0;
|
@@ -11701,16 +11781,16 @@ var getCount = /* @__PURE__ */ __name((columnFilters) => {
|
|
11701
11781
|
}
|
11702
11782
|
return 0;
|
11703
11783
|
}, "getCount");
|
11704
|
-
var Filter = /* @__PURE__ */ __name(({ count }) => /* @__PURE__ */
|
11784
|
+
var Filter = /* @__PURE__ */ __name(({ count }) => /* @__PURE__ */ React36.createElement("svg", {
|
11705
11785
|
width: "16",
|
11706
11786
|
height: "16",
|
11707
11787
|
xmlns: "http://www.w3.org/2000/svg",
|
11708
11788
|
viewBox: "0 0 448 512"
|
11709
|
-
}, /* @__PURE__ */
|
11789
|
+
}, /* @__PURE__ */ React36.createElement("path", {
|
11710
11790
|
fill: "#000",
|
11711
11791
|
d: "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z",
|
11712
11792
|
fillOpacity: count ? 0.8 : 0.3
|
11713
|
-
}), count ? /* @__PURE__ */
|
11793
|
+
}), count ? /* @__PURE__ */ React36.createElement("text", {
|
11714
11794
|
x: "50%",
|
11715
11795
|
y: "55%",
|
11716
11796
|
fill: "#000",
|
@@ -11718,7 +11798,7 @@ var Filter = /* @__PURE__ */ __name(({ count }) => /* @__PURE__ */ React33.creat
|
|
11718
11798
|
textAnchor: "middle",
|
11719
11799
|
alignmentBaseline: "middle",
|
11720
11800
|
fillOpacity: 0.8
|
11721
|
-
}, count) : /* @__PURE__ */
|
11801
|
+
}, count) : /* @__PURE__ */ React36.createElement("path", {
|
11722
11802
|
fill: "#000",
|
11723
11803
|
d: "M224 200v-16c0-13.3-10.7-24-24-24h-24v-20c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v20h-24c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h24v148c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V224h24c13.3 0 24-10.7 24-24zM352 328v-16c0-13.3-10.7-24-24-24h-24V140c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v148h-24c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h24v20c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12v-20h24c13.3 0 24-10.7 24-24z",
|
11724
11804
|
fillOpacity: 0.3
|
@@ -11726,10 +11806,10 @@ var Filter = /* @__PURE__ */ __name(({ count }) => /* @__PURE__ */ React33.creat
|
|
11726
11806
|
var DatatableFilter = /* @__PURE__ */ __name((props) => {
|
11727
11807
|
const Components2 = useVulcanComponents();
|
11728
11808
|
const { columnFilters, label, query } = props;
|
11729
|
-
return /* @__PURE__ */
|
11809
|
+
return /* @__PURE__ */ React36.createElement("span", {
|
11730
11810
|
className: "datatable-filter"
|
11731
|
-
}, /* @__PURE__ */
|
11732
|
-
title: /* @__PURE__ */
|
11811
|
+
}, /* @__PURE__ */ React36.createElement(Components2.ModalTrigger, {
|
11812
|
+
title: /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11733
11813
|
id: "datatable.filter_column",
|
11734
11814
|
values: {
|
11735
11815
|
label
|
@@ -11737,10 +11817,10 @@ var DatatableFilter = /* @__PURE__ */ __name((props) => {
|
|
11737
11817
|
defaultMessage: `Filter \u201C${label}\u201D`
|
11738
11818
|
}),
|
11739
11819
|
size: "small",
|
11740
|
-
trigger: /* @__PURE__ */
|
11820
|
+
trigger: /* @__PURE__ */ React36.createElement(Filter, {
|
11741
11821
|
count: getCount(columnFilters)
|
11742
11822
|
})
|
11743
|
-
}, query ? /* @__PURE__ */
|
11823
|
+
}, query ? /* @__PURE__ */ React36.createElement(Components2.DatatableFilterContentsWithData, _extends25({}, props)) : /* @__PURE__ */ React36.createElement(Components2.DatatableFilterContents, _extends25({}, props))));
|
11744
11824
|
}, "DatatableFilter");
|
11745
11825
|
var DatatableFilterContentsWithData = /* @__PURE__ */ __name((props) => {
|
11746
11826
|
const Components2 = useVulcanComponents();
|
@@ -11751,14 +11831,14 @@ var DatatableFilterContentsWithData = /* @__PURE__ */ __name((props) => {
|
|
11751
11831
|
const filterQuery = queryGql;
|
11752
11832
|
const { loading, error, data } = useQuery(filterQuery);
|
11753
11833
|
if (loading) {
|
11754
|
-
return /* @__PURE__ */
|
11834
|
+
return /* @__PURE__ */ React36.createElement(Components2.Loading, null);
|
11755
11835
|
} else if (error) {
|
11756
|
-
return /* @__PURE__ */
|
11836
|
+
return /* @__PURE__ */ React36.createElement("p", null, "error");
|
11757
11837
|
} else {
|
11758
11838
|
const queryOptions = options({
|
11759
11839
|
data
|
11760
11840
|
});
|
11761
|
-
return /* @__PURE__ */
|
11841
|
+
return /* @__PURE__ */ React36.createElement(Components2.DatatableFilterContents, _extends25({}, props, {
|
11762
11842
|
options: queryOptions
|
11763
11843
|
}));
|
11764
11844
|
}
|
@@ -11775,28 +11855,28 @@ var DatatableFilterContents = /* @__PURE__ */ __name((props) => {
|
|
11775
11855
|
let contents;
|
11776
11856
|
if (filterComponent) {
|
11777
11857
|
const CustomFilter = filterComponent;
|
11778
|
-
contents = /* @__PURE__ */
|
11858
|
+
contents = /* @__PURE__ */ React36.createElement(CustomFilter, _extends25({}, filterProps));
|
11779
11859
|
} else if (options) {
|
11780
|
-
contents = /* @__PURE__ */
|
11860
|
+
contents = /* @__PURE__ */ React36.createElement(Components2.DatatableFilterCheckboxes, _extends25({}, filterProps));
|
11781
11861
|
} else {
|
11782
11862
|
switch (fieldType) {
|
11783
11863
|
case Date:
|
11784
|
-
contents = /* @__PURE__ */
|
11864
|
+
contents = /* @__PURE__ */ React36.createElement(Components2.DatatableFilterDates, _extends25({}, filterProps));
|
11785
11865
|
break;
|
11786
11866
|
case Number:
|
11787
|
-
contents = /* @__PURE__ */
|
11867
|
+
contents = /* @__PURE__ */ React36.createElement(Components2.DatatableFilterNumbers, _extends25({}, filterProps));
|
11788
11868
|
break;
|
11789
11869
|
case Boolean:
|
11790
|
-
contents = /* @__PURE__ */
|
11870
|
+
contents = /* @__PURE__ */ React36.createElement(Components2.DatatableFilterBooleans, _extends25({}, filterProps));
|
11791
11871
|
break;
|
11792
11872
|
default:
|
11793
|
-
contents = /* @__PURE__ */
|
11873
|
+
contents = /* @__PURE__ */ React36.createElement("p", null, /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11794
11874
|
id: "datatable.specify_option",
|
11795
11875
|
defaultMessage: "Please specify an options property on your schema field."
|
11796
11876
|
}));
|
11797
11877
|
}
|
11798
11878
|
}
|
11799
|
-
return /* @__PURE__ */
|
11879
|
+
return /* @__PURE__ */ React36.createElement("form", null, contents, /* @__PURE__ */ React36.createElement(Components2.Button, {
|
11800
11880
|
variant: "link",
|
11801
11881
|
style: {
|
11802
11882
|
display: "inline-block",
|
@@ -11806,10 +11886,10 @@ var DatatableFilterContents = /* @__PURE__ */ __name((props) => {
|
|
11806
11886
|
onClick: () => {
|
11807
11887
|
setFilters(void 0);
|
11808
11888
|
}
|
11809
|
-
}, /* @__PURE__ */
|
11889
|
+
}, /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11810
11890
|
id: "datatable.clear_all",
|
11811
11891
|
defaultMessage: "Clear All"
|
11812
|
-
})), /* @__PURE__ */
|
11892
|
+
})), /* @__PURE__ */ React36.createElement(Components2.Button, {
|
11813
11893
|
type: "submit",
|
11814
11894
|
className: "datatable_filter_submit",
|
11815
11895
|
onClick: () => {
|
@@ -11818,7 +11898,7 @@ var DatatableFilterContents = /* @__PURE__ */ __name((props) => {
|
|
11818
11898
|
filters
|
11819
11899
|
});
|
11820
11900
|
}
|
11821
|
-
}, /* @__PURE__ */
|
11901
|
+
}, /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11822
11902
|
id: "datatable.submit",
|
11823
11903
|
defaultMessage: "Submit"
|
11824
11904
|
})));
|
@@ -11828,7 +11908,7 @@ var DatatableFilterCheckboxes = /* @__PURE__ */ __name(({ options, filters = {
|
|
11828
11908
|
_in: []
|
11829
11909
|
}, setFilters }) => {
|
11830
11910
|
const Components2 = useVulcanComponents();
|
11831
|
-
return /* @__PURE__ */
|
11911
|
+
return /* @__PURE__ */ React36.createElement(Components2.FormComponentCheckboxGroup, {
|
11832
11912
|
path: "filter",
|
11833
11913
|
itemProperties: {
|
11834
11914
|
layout: "inputOnly"
|
@@ -11862,7 +11942,7 @@ var DatatableFilterBooleans = /* @__PURE__ */ __name(({ filters = {
|
|
11862
11942
|
_eq: []
|
11863
11943
|
}, setFilters }) => {
|
11864
11944
|
const Components2 = useVulcanComponents();
|
11865
|
-
return /* @__PURE__ */
|
11945
|
+
return /* @__PURE__ */ React36.createElement(Components2.FormComponentRadioGroup, {
|
11866
11946
|
path: "filter",
|
11867
11947
|
itemProperties: {
|
11868
11948
|
layout: "inputOnly"
|
@@ -11881,10 +11961,10 @@ var DatatableFilterBooleans = /* @__PURE__ */ __name(({ filters = {
|
|
11881
11961
|
}, "DatatableFilterBooleans");
|
11882
11962
|
var DatatableFilterDates = /* @__PURE__ */ __name(({ filters, setFilters }) => {
|
11883
11963
|
const Components2 = useVulcanComponents();
|
11884
|
-
return /* @__PURE__ */
|
11964
|
+
return /* @__PURE__ */ React36.createElement("div", null, /* @__PURE__ */ React36.createElement(Components2.FormComponentDate, {
|
11885
11965
|
path: "_gte",
|
11886
11966
|
itemProperties: {
|
11887
|
-
label: /* @__PURE__ */
|
11967
|
+
label: /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11888
11968
|
id: "datatable.after",
|
11889
11969
|
defaultMessage: "After"
|
11890
11970
|
}),
|
@@ -11903,10 +11983,10 @@ var DatatableFilterDates = /* @__PURE__ */ __name(({ filters, setFilters }) => {
|
|
11903
11983
|
}));
|
11904
11984
|
}
|
11905
11985
|
}
|
11906
|
-
}), /* @__PURE__ */
|
11986
|
+
}), /* @__PURE__ */ React36.createElement(Components2.FormComponentDate, {
|
11907
11987
|
path: "_lte",
|
11908
11988
|
itemProperties: {
|
11909
|
-
label: /* @__PURE__ */
|
11989
|
+
label: /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11910
11990
|
id: "datatable.before",
|
11911
11991
|
defaultMessage: "Before"
|
11912
11992
|
}),
|
@@ -11929,10 +12009,10 @@ var DatatableFilterDates = /* @__PURE__ */ __name(({ filters, setFilters }) => {
|
|
11929
12009
|
}, "DatatableFilterDates");
|
11930
12010
|
var DatatableFilterNumbers = /* @__PURE__ */ __name(({ filters, setFilters }) => {
|
11931
12011
|
const Components2 = useVulcanComponents();
|
11932
|
-
return /* @__PURE__ */
|
12012
|
+
return /* @__PURE__ */ React36.createElement("div", null, /* @__PURE__ */ React36.createElement(Components2.FormComponentNumber, {
|
11933
12013
|
path: "_gte",
|
11934
12014
|
itemProperties: {
|
11935
|
-
label: /* @__PURE__ */
|
12015
|
+
label: /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11936
12016
|
id: "datatable.greater_than",
|
11937
12017
|
defaultMessage: "Greater than"
|
11938
12018
|
}),
|
@@ -11953,10 +12033,10 @@ var DatatableFilterNumbers = /* @__PURE__ */ __name(({ filters, setFilters }) =>
|
|
11953
12033
|
},
|
11954
12034
|
value: filters && parseFloat(filters._gte)
|
11955
12035
|
}
|
11956
|
-
}), /* @__PURE__ */
|
12036
|
+
}), /* @__PURE__ */ React36.createElement(Components2.FormComponentNumber, {
|
11957
12037
|
path: "_lte",
|
11958
12038
|
itemProperties: {
|
11959
|
-
label: /* @__PURE__ */
|
12039
|
+
label: /* @__PURE__ */ React36.createElement(Components2.FormattedMessage, {
|
11960
12040
|
id: "datatable.lower_than",
|
11961
12041
|
defaultMessage: "Lower than"
|
11962
12042
|
}),
|
@@ -11982,63 +12062,63 @@ var DatatableFilterNumbers = /* @__PURE__ */ __name(({ filters, setFilters }) =>
|
|
11982
12062
|
|
11983
12063
|
// components/Datatable/DatatableSorter.tsx
|
11984
12064
|
init_esm_shims();
|
11985
|
-
import
|
11986
|
-
var SortNone = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
12065
|
+
import React37 from "react";
|
12066
|
+
var SortNone = /* @__PURE__ */ __name(() => /* @__PURE__ */ React37.createElement("svg", {
|
11987
12067
|
width: "16",
|
11988
12068
|
height: "16",
|
11989
12069
|
viewBox: "0 0 438 438",
|
11990
12070
|
fill: "none",
|
11991
12071
|
xmlns: "http://www.w3.org/2000/svg"
|
11992
|
-
}, /* @__PURE__ */
|
12072
|
+
}, /* @__PURE__ */ React37.createElement("path", {
|
11993
12073
|
d: "M25.7368 247.243H280.263C303.149 247.243 314.592 274.958 298.444 291.116L171.18 418.456C161.128 428.515 144.872 428.515 134.926 418.456L7.55631 291.116C-8.59221 274.958 2.85078 247.243 25.7368 247.243ZM298.444 134.884L171.18 7.54408C161.128 -2.51469 144.872 -2.51469 134.926 7.54408L7.55631 134.884C-8.59221 151.042 2.85078 178.757 25.7368 178.757H280.263C303.149 178.757 314.592 151.042 298.444 134.884Z",
|
11994
12074
|
transform: "translate(66 6)",
|
11995
12075
|
fill: "#000",
|
11996
12076
|
fillOpacity: "0.2"
|
11997
12077
|
})), "SortNone");
|
11998
|
-
var SortDesc = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
12078
|
+
var SortDesc = /* @__PURE__ */ __name(() => /* @__PURE__ */ React37.createElement("svg", {
|
11999
12079
|
width: "16",
|
12000
12080
|
height: "16",
|
12001
12081
|
viewBox: "0 0 438 438",
|
12002
12082
|
fill: "none",
|
12003
12083
|
xmlns: "http://www.w3.org/2000/svg"
|
12004
|
-
}, /* @__PURE__ */
|
12084
|
+
}, /* @__PURE__ */ React37.createElement("path", {
|
12005
12085
|
d: "M25.7368 0H280.263C303.149 0 314.592 27.7151 298.444 43.8734L171.18 171.213C161.128 181.272 144.872 181.272 134.926 171.213L7.55631 43.8734C-8.59221 27.7151 2.85078 0 25.7368 0Z",
|
12006
12086
|
transform: "translate(66 253.243)",
|
12007
12087
|
fill: "black",
|
12008
12088
|
fillOpacity: "0.7"
|
12009
|
-
}), /* @__PURE__ */
|
12089
|
+
}), /* @__PURE__ */ React37.createElement("path", {
|
12010
12090
|
d: "M171.18 7.54408L298.444 134.884C314.592 151.042 303.149 178.757 280.263 178.757H25.7368C2.85078 178.757 -8.59221 151.042 7.55631 134.884L134.926 7.54408C144.872 -2.51469 161.128 -2.51469 171.18 7.54408Z",
|
12011
12091
|
transform: "translate(66 6)",
|
12012
12092
|
fill: "black",
|
12013
12093
|
fillOpacity: "0.2"
|
12014
12094
|
})), "SortDesc");
|
12015
|
-
var SortAsc = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
12095
|
+
var SortAsc = /* @__PURE__ */ __name(() => /* @__PURE__ */ React37.createElement("svg", {
|
12016
12096
|
width: "16",
|
12017
12097
|
height: "16",
|
12018
12098
|
viewBox: "0 0 438 438",
|
12019
12099
|
fill: "none",
|
12020
12100
|
xmlns: "http://www.w3.org/2000/svg"
|
12021
|
-
}, /* @__PURE__ */
|
12101
|
+
}, /* @__PURE__ */ React37.createElement("path", {
|
12022
12102
|
d: "M298.444 134.884L171.18 7.54408C161.128 -2.51469 144.872 -2.51469 134.926 7.54408L7.55631 134.884C-8.59221 151.042 2.85078 178.757 25.7368 178.757H280.263C303.149 178.757 314.592 151.042 298.444 134.884Z",
|
12023
12103
|
transform: "translate(66 6)",
|
12024
12104
|
fill: "black",
|
12025
12105
|
fillOpacity: "0.7"
|
12026
|
-
}), /* @__PURE__ */
|
12106
|
+
}), /* @__PURE__ */ React37.createElement("path", {
|
12027
12107
|
d: "M280.263 0H25.7368C2.85078 0 -8.59221 27.7151 7.55631 43.8734L134.926 171.213C144.872 181.272 161.128 181.272 171.18 171.213L298.444 43.8734C314.592 27.7151 303.149 0 280.263 0Z",
|
12028
12108
|
transform: "translate(66 253.243)",
|
12029
12109
|
fill: "black",
|
12030
12110
|
fillOpacity: "0.2"
|
12031
12111
|
})), "SortAsc");
|
12032
|
-
var DatatableSorter = /* @__PURE__ */ __name(({ name: name2, label, toggleSort, currentSort }) => /* @__PURE__ */
|
12112
|
+
var DatatableSorter = /* @__PURE__ */ __name(({ name: name2, label, toggleSort, currentSort }) => /* @__PURE__ */ React37.createElement("span", {
|
12033
12113
|
className: "datatable-sorter",
|
12034
12114
|
onClick: () => {
|
12035
12115
|
toggleSort(name2);
|
12036
12116
|
}
|
12037
|
-
}, !currentSort[name2] ? /* @__PURE__ */
|
12117
|
+
}, !currentSort[name2] ? /* @__PURE__ */ React37.createElement(SortNone, null) : currentSort[name2] === "asc" ? /* @__PURE__ */ React37.createElement(SortAsc, null) : /* @__PURE__ */ React37.createElement(SortDesc, null)), "DatatableSorter");
|
12038
12118
|
|
12039
12119
|
// components/Datatable/DatatableSelect.tsx
|
12040
12120
|
init_esm_shims();
|
12041
|
-
import
|
12121
|
+
import React38 from "react";
|
12042
12122
|
var DatatableSelect = /* @__PURE__ */ __name(({ toggleItem, selectedItems, document }) => {
|
12043
12123
|
const value = selectedItems.includes(document._id || "");
|
12044
12124
|
const onChange = /* @__PURE__ */ __name((e) => {
|
@@ -12047,9 +12127,9 @@ var DatatableSelect = /* @__PURE__ */ __name(({ toggleItem, selectedItems, docum
|
|
12047
12127
|
toggleItem(document._id);
|
12048
12128
|
}, "onChange");
|
12049
12129
|
const Components2 = useVulcanComponents();
|
12050
|
-
return /* @__PURE__ */
|
12130
|
+
return /* @__PURE__ */ React38.createElement(Components2.DatatableCellLayout, {
|
12051
12131
|
className: "datatable-check"
|
12052
|
-
}, /* @__PURE__ */
|
12132
|
+
}, /* @__PURE__ */ React38.createElement(Components2.FormComponentCheckbox, {
|
12053
12133
|
inputProperties: {
|
12054
12134
|
value,
|
12055
12135
|
onChange
|
@@ -12062,16 +12142,16 @@ var DatatableSelect = /* @__PURE__ */ __name(({ toggleItem, selectedItems, docum
|
|
12062
12142
|
|
12063
12143
|
// components/Datatable/DatatableSubmitSelected.tsx
|
12064
12144
|
init_esm_shims();
|
12065
|
-
import
|
12145
|
+
import React39 from "react";
|
12066
12146
|
var DatatableSubmitSelected = /* @__PURE__ */ __name(({ selectedItems, onSubmitSelected }) => {
|
12067
12147
|
const Components2 = useVulcanComponents();
|
12068
|
-
return /* @__PURE__ */
|
12148
|
+
return /* @__PURE__ */ React39.createElement(Components2.Button, {
|
12069
12149
|
className: "datatable-submit-selected",
|
12070
12150
|
onClick: (e) => {
|
12071
12151
|
e.preventDefault();
|
12072
12152
|
onSubmitSelected(selectedItems);
|
12073
12153
|
}
|
12074
|
-
}, /* @__PURE__ */
|
12154
|
+
}, /* @__PURE__ */ React39.createElement(Components2.FormattedMessage, {
|
12075
12155
|
id: "datatable.submit"
|
12076
12156
|
}));
|
12077
12157
|
}, "DatatableSubmitSelected");
|
@@ -12079,9 +12159,9 @@ var DatatableSubmitSelected = /* @__PURE__ */ __name(({ selectedItems, onSubmitS
|
|
12079
12159
|
// components/Datatable/others/EditButton.tsx
|
12080
12160
|
init_esm_shims();
|
12081
12161
|
import { useIntlContext as useIntlContext7 } from "@vulcanjs/react-i18n";
|
12082
|
-
import
|
12083
|
-
function
|
12084
|
-
|
12162
|
+
import React40 from "react";
|
12163
|
+
function _extends26() {
|
12164
|
+
_extends26 = Object.assign || function(target) {
|
12085
12165
|
for (var i = 1; i < arguments.length; i++) {
|
12086
12166
|
var source = arguments[i];
|
12087
12167
|
for (var key in source) {
|
@@ -12092,27 +12172,27 @@ function _extends24() {
|
|
12092
12172
|
}
|
12093
12173
|
return target;
|
12094
12174
|
};
|
12095
|
-
return
|
12175
|
+
return _extends26.apply(this, arguments);
|
12096
12176
|
}
|
12097
|
-
__name(
|
12177
|
+
__name(_extends26, "_extends");
|
12098
12178
|
var EditButton = /* @__PURE__ */ __name((_a) => {
|
12099
12179
|
var _b = _a, { style = "primary", variant, label, size: size2, showId, modalProps, formProps, component } = _b, props = __objRest(_b, ["style", "variant", "label", "size", "showId", "modalProps", "formProps", "component"]);
|
12100
12180
|
const Components2 = useVulcanComponents();
|
12101
12181
|
const intl = useIntlContext7();
|
12102
|
-
return /* @__PURE__ */
|
12182
|
+
return /* @__PURE__ */ React40.createElement(Components2.ModalTrigger, {
|
12103
12183
|
label: label || intl.formatMessage({
|
12104
12184
|
id: "datatable.edit",
|
12105
12185
|
defaultMessage: "Edit"
|
12106
12186
|
}),
|
12107
|
-
component: component ? component : /* @__PURE__ */
|
12187
|
+
component: component ? component : /* @__PURE__ */ React40.createElement(Components2.Button, {
|
12108
12188
|
size: size2,
|
12109
12189
|
variant: variant || style
|
12110
|
-
}, label || /* @__PURE__ */
|
12190
|
+
}, label || /* @__PURE__ */ React40.createElement(Components2.FormattedMessage, {
|
12111
12191
|
id: "datatable.edit",
|
12112
12192
|
defaultMessage: "Edit"
|
12113
12193
|
})),
|
12114
12194
|
modalProps
|
12115
|
-
}, /* @__PURE__ */
|
12195
|
+
}, /* @__PURE__ */ React40.createElement(Components2.EditForm, _extends26({
|
12116
12196
|
closeModal: () => {
|
12117
12197
|
console.warn("closeModal not defined");
|
12118
12198
|
}
|
@@ -12135,7 +12215,7 @@ var EditForm = /* @__PURE__ */ __name((_a) => {
|
|
12135
12215
|
} : () => {
|
12136
12216
|
closeModal();
|
12137
12217
|
};
|
12138
|
-
return /* @__PURE__ */
|
12218
|
+
return /* @__PURE__ */ React40.createElement(Components2.SmartForm, _extends26({
|
12139
12219
|
successCallback: success,
|
12140
12220
|
removeSuccessCallback: remove
|
12141
12221
|
}, formProps, props));
|
@@ -12144,9 +12224,9 @@ var EditForm = /* @__PURE__ */ __name((_a) => {
|
|
12144
12224
|
// components/Datatable/others/NewButton.tsx
|
12145
12225
|
init_esm_shims();
|
12146
12226
|
import { useIntlContext as useIntlContext8 } from "@vulcanjs/react-i18n";
|
12147
|
-
import
|
12148
|
-
function
|
12149
|
-
|
12227
|
+
import React41 from "react";
|
12228
|
+
function _extends27() {
|
12229
|
+
_extends27 = Object.assign || function(target) {
|
12150
12230
|
for (var i = 1; i < arguments.length; i++) {
|
12151
12231
|
var source = arguments[i];
|
12152
12232
|
for (var key in source) {
|
@@ -12157,27 +12237,27 @@ function _extends25() {
|
|
12157
12237
|
}
|
12158
12238
|
return target;
|
12159
12239
|
};
|
12160
|
-
return
|
12240
|
+
return _extends27.apply(this, arguments);
|
12161
12241
|
}
|
12162
|
-
__name(
|
12242
|
+
__name(_extends27, "_extends");
|
12163
12243
|
var NewButton = /* @__PURE__ */ __name((_a) => {
|
12164
12244
|
var _b = _a, { size: size2, label, style = "primary", formProps } = _b, props = __objRest(_b, ["size", "label", "style", "formProps"]);
|
12165
12245
|
const intl = useIntlContext8();
|
12166
12246
|
const Components2 = useVulcanComponents();
|
12167
|
-
return /* @__PURE__ */
|
12247
|
+
return /* @__PURE__ */ React41.createElement(Components2.ModalTrigger, {
|
12168
12248
|
label: label || intl.formatMessage({
|
12169
12249
|
id: "datatable.new"
|
12170
12250
|
}),
|
12171
12251
|
title: label || intl.formatMessage({
|
12172
12252
|
id: "datatable.new"
|
12173
12253
|
}),
|
12174
|
-
component: /* @__PURE__ */
|
12254
|
+
component: /* @__PURE__ */ React41.createElement(Components2.Button, {
|
12175
12255
|
variant: style,
|
12176
12256
|
size: size2
|
12177
|
-
}, label || /* @__PURE__ */
|
12257
|
+
}, label || /* @__PURE__ */ React41.createElement(Components2.FormattedMessage, {
|
12178
12258
|
id: "datatable.new"
|
12179
12259
|
}))
|
12180
|
-
}, /* @__PURE__ */
|
12260
|
+
}, /* @__PURE__ */ React41.createElement(Components2.NewForm, _extends27({
|
12181
12261
|
formProps
|
12182
12262
|
}, props)));
|
12183
12263
|
}, "NewButton");
|
@@ -12189,7 +12269,7 @@ var NewForm = /* @__PURE__ */ __name(({ model, closeModal, successCallback, form
|
|
12189
12269
|
} : () => {
|
12190
12270
|
closeModal();
|
12191
12271
|
};
|
12192
|
-
return /* @__PURE__ */
|
12272
|
+
return /* @__PURE__ */ React41.createElement(Components2.SmartForm, _extends27({
|
12193
12273
|
model,
|
12194
12274
|
successCallback: success
|
12195
12275
|
}, formProps || {}));
|
@@ -12198,9 +12278,9 @@ var NewForm = /* @__PURE__ */ __name(({ model, closeModal, successCallback, form
|
|
12198
12278
|
// components/Datatable/others/DeleteButton.tsx
|
12199
12279
|
init_esm_shims();
|
12200
12280
|
import { useDelete as useDelete2 } from "@vulcanjs/react-hooks";
|
12201
|
-
import
|
12202
|
-
function
|
12203
|
-
|
12281
|
+
import React42 from "react";
|
12282
|
+
function _extends28() {
|
12283
|
+
_extends28 = Object.assign || function(target) {
|
12204
12284
|
for (var i = 1; i < arguments.length; i++) {
|
12205
12285
|
var source = arguments[i];
|
12206
12286
|
for (var key in source) {
|
@@ -12211,9 +12291,9 @@ function _extends26() {
|
|
12211
12291
|
}
|
12212
12292
|
return target;
|
12213
12293
|
};
|
12214
|
-
return
|
12294
|
+
return _extends28.apply(this, arguments);
|
12215
12295
|
}
|
12216
|
-
__name(
|
12296
|
+
__name(_extends28, "_extends");
|
12217
12297
|
var DeleteButton = /* @__PURE__ */ __name((props) => {
|
12218
12298
|
const Components2 = useVulcanComponents();
|
12219
12299
|
const _a = props, { label, fragment, documentId, mutationOptions, currentUser, model } = _a, rest = __objRest(_a, ["label", "fragment", "documentId", "mutationOptions", "currentUser", "model"]);
|
@@ -12222,7 +12302,7 @@ var DeleteButton = /* @__PURE__ */ __name((props) => {
|
|
12222
12302
|
fragment,
|
12223
12303
|
mutationOptions
|
12224
12304
|
});
|
12225
|
-
return /* @__PURE__ */
|
12305
|
+
return /* @__PURE__ */ React42.createElement(Components2.LoadingButton, _extends28({
|
12226
12306
|
loading,
|
12227
12307
|
onClick: () => {
|
12228
12308
|
deleteFunction({
|
@@ -12231,7 +12311,7 @@ var DeleteButton = /* @__PURE__ */ __name((props) => {
|
|
12231
12311
|
}
|
12232
12312
|
});
|
12233
12313
|
},
|
12234
|
-
label: label || /* @__PURE__ */
|
12314
|
+
label: label || /* @__PURE__ */ React42.createElement(Components2.FormattedMessage, {
|
12235
12315
|
id: "datatable.delete",
|
12236
12316
|
defaultMessage: "Delete"
|
12237
12317
|
})
|
@@ -12285,9 +12365,9 @@ init_esm_shims();
|
|
12285
12365
|
|
12286
12366
|
// components/cell/CardItem.tsx
|
12287
12367
|
init_esm_shims();
|
12288
|
-
import
|
12289
|
-
function
|
12290
|
-
|
12368
|
+
import React43 from "react";
|
12369
|
+
function _extends29() {
|
12370
|
+
_extends29 = Object.assign || function(target) {
|
12291
12371
|
for (var i = 1; i < arguments.length; i++) {
|
12292
12372
|
var source = arguments[i];
|
12293
12373
|
for (var key in source) {
|
@@ -12298,9 +12378,9 @@ function _extends27() {
|
|
12298
12378
|
}
|
12299
12379
|
return target;
|
12300
12380
|
};
|
12301
|
-
return
|
12381
|
+
return _extends29.apply(this, arguments);
|
12302
12382
|
}
|
12303
|
-
__name(
|
12383
|
+
__name(_extends29, "_extends");
|
12304
12384
|
var getTypeName = /* @__PURE__ */ __name((value, fieldName, model) => {
|
12305
12385
|
const schema = model.schema;
|
12306
12386
|
const fieldSchema = schema && schema[fieldName];
|
@@ -12331,7 +12411,7 @@ var CardItemSwitcher = /* @__PURE__ */ __name((props) => {
|
|
12331
12411
|
}
|
12332
12412
|
}
|
12333
12413
|
if (typeof value === "undefined" || value === null) {
|
12334
|
-
return /* @__PURE__ */
|
12414
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, '""');
|
12335
12415
|
}
|
12336
12416
|
const itemProps = {
|
12337
12417
|
nestingLevel: nestingLevel + 1,
|
@@ -12341,7 +12421,7 @@ var CardItemSwitcher = /* @__PURE__ */ __name((props) => {
|
|
12341
12421
|
model,
|
12342
12422
|
fieldSchema
|
12343
12423
|
};
|
12344
|
-
if (/* @__PURE__ */
|
12424
|
+
if (/* @__PURE__ */ React43.isValidElement(itemProps.value)) {
|
12345
12425
|
return itemProps.value;
|
12346
12426
|
}
|
12347
12427
|
if (fieldSchema && fieldSchema.resolveAs && fieldSchema.resolveAs.relation) {
|
@@ -12349,15 +12429,15 @@ var CardItemSwitcher = /* @__PURE__ */ __name((props) => {
|
|
12349
12429
|
itemProps.relatedDocument = document == null ? void 0 : document[itemProps.relatedFieldName || ""];
|
12350
12430
|
itemProps.relatedModel = (_b = fieldSchema.relation) == null ? void 0 : _b.model;
|
12351
12431
|
if (!itemProps.relatedDocument) {
|
12352
|
-
return /* @__PURE__ */
|
12432
|
+
return /* @__PURE__ */ React43.createElement("span", null, "Missing data for sub-document ", /* @__PURE__ */ React43.createElement("code", null, value), " of type", " ", /* @__PURE__ */ React43.createElement("code", null, typeName), " (", /* @__PURE__ */ React43.createElement("code", null, itemProps.relatedFieldName), ")");
|
12353
12433
|
}
|
12354
12434
|
switch ((_c = fieldSchema.relation) == null ? void 0 : _c.kind) {
|
12355
12435
|
case "hasOne":
|
12356
|
-
return /* @__PURE__ */
|
12436
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemRelationHasOne, _extends29({}, itemProps));
|
12357
12437
|
case "hasMany":
|
12358
|
-
return /* @__PURE__ */
|
12438
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemRelationHasMany, _extends29({}, itemProps));
|
12359
12439
|
default:
|
12360
|
-
return /* @__PURE__ */
|
12440
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemDefault, _extends29({}, itemProps));
|
12361
12441
|
}
|
12362
12442
|
}
|
12363
12443
|
if (Array.isArray(value)) {
|
@@ -12369,81 +12449,81 @@ var CardItemSwitcher = /* @__PURE__ */ __name((props) => {
|
|
12369
12449
|
case "Number":
|
12370
12450
|
case "number":
|
12371
12451
|
case "SimpleSchema.Integer":
|
12372
|
-
return /* @__PURE__ */
|
12452
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemNumber, _extends29({}, itemProps));
|
12373
12453
|
case "Array":
|
12374
|
-
return /* @__PURE__ */
|
12454
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemArray, _extends29({}, itemProps));
|
12375
12455
|
case "Object":
|
12376
12456
|
case "object":
|
12377
|
-
return /* @__PURE__ */
|
12457
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemObject, _extends29({}, itemProps));
|
12378
12458
|
case "Date":
|
12379
|
-
return /* @__PURE__ */
|
12459
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemDate, _extends29({}, itemProps));
|
12380
12460
|
case "String":
|
12381
12461
|
case "string":
|
12382
12462
|
switch (contents) {
|
12383
12463
|
case "html":
|
12384
|
-
return /* @__PURE__ */
|
12464
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemHTML, _extends29({}, itemProps));
|
12385
12465
|
case "date":
|
12386
|
-
return /* @__PURE__ */
|
12466
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemDate, _extends29({}, itemProps));
|
12387
12467
|
case "image":
|
12388
|
-
return /* @__PURE__ */
|
12468
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemImage, _extends29({}, itemProps, {
|
12389
12469
|
force: true
|
12390
12470
|
}));
|
12391
12471
|
case "url":
|
12392
|
-
return /* @__PURE__ */
|
12472
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemURL, _extends29({}, itemProps, {
|
12393
12473
|
force: true
|
12394
12474
|
}));
|
12395
12475
|
default:
|
12396
|
-
return /* @__PURE__ */
|
12476
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemImage, _extends29({}, itemProps));
|
12397
12477
|
}
|
12398
12478
|
default:
|
12399
|
-
return /* @__PURE__ */
|
12479
|
+
return /* @__PURE__ */ React43.createElement(Components2.CardItemDefault, _extends29({}, itemProps));
|
12400
12480
|
}
|
12401
12481
|
}, "CardItemSwitcher");
|
12402
12482
|
|
12403
12483
|
// components/cell/CardItemRelationItem.tsx
|
12404
12484
|
init_esm_shims();
|
12405
|
-
import
|
12485
|
+
import React44 from "react";
|
12406
12486
|
var CardItemRelationItem = /* @__PURE__ */ __name(({ relatedDocument, relatedModel }) => {
|
12407
12487
|
const Components2 = useVulcanComponents();
|
12408
12488
|
const label = relatedDocument._id;
|
12409
12489
|
const typeName = relatedDocument.__typename;
|
12410
12490
|
const Cell = Components2[`${typeName}Cell`];
|
12411
|
-
return Cell ? /* @__PURE__ */
|
12491
|
+
return Cell ? /* @__PURE__ */ React44.createElement(Cell, {
|
12412
12492
|
document: relatedDocument,
|
12413
12493
|
label,
|
12414
12494
|
Components: Components2
|
12415
|
-
}) : /* @__PURE__ */
|
12495
|
+
}) : /* @__PURE__ */ React44.createElement(Components2.DefaultCell, {
|
12416
12496
|
document: relatedDocument,
|
12417
12497
|
label
|
12418
12498
|
});
|
12419
12499
|
}, "CardItemRelationItem");
|
12420
|
-
var DefaultCell = /* @__PURE__ */ __name(({ document, label }) => /* @__PURE__ */
|
12500
|
+
var DefaultCell = /* @__PURE__ */ __name(({ document, label }) => /* @__PURE__ */ React44.createElement("li", {
|
12421
12501
|
className: "relation-default-cell"
|
12422
|
-
}, document.pagePath ? /* @__PURE__ */
|
12502
|
+
}, document.pagePath ? /* @__PURE__ */ React44.createElement("a", {
|
12423
12503
|
href: document.pagePath
|
12424
|
-
}, label) : /* @__PURE__ */
|
12504
|
+
}, label) : /* @__PURE__ */ React44.createElement("span", null, label)), "DefaultCell");
|
12425
12505
|
var UserCell = /* @__PURE__ */ __name(({ document }) => {
|
12426
12506
|
const Components2 = useVulcanComponents();
|
12427
|
-
return /* @__PURE__ */
|
12507
|
+
return /* @__PURE__ */ React44.createElement("div", {
|
12428
12508
|
className: "contents-user user-item"
|
12429
|
-
}, document.pagePath ? /* @__PURE__ */
|
12509
|
+
}, document.pagePath ? /* @__PURE__ */ React44.createElement("a", {
|
12430
12510
|
className: "user-item-name",
|
12431
12511
|
href: document.pagePath
|
12432
|
-
}, document.displayName) : /* @__PURE__ */
|
12512
|
+
}, document.displayName) : /* @__PURE__ */ React44.createElement("span", {
|
12433
12513
|
className: "user-item-name"
|
12434
12514
|
}, document.displayName));
|
12435
12515
|
}, "UserCell");
|
12436
12516
|
|
12437
12517
|
// components/cell/CardItemArray.tsx
|
12438
12518
|
init_esm_shims();
|
12439
|
-
import
|
12519
|
+
import React45 from "react";
|
12440
12520
|
var CardItemArray = /* @__PURE__ */ __name(({ nestingLevel, value }) => {
|
12441
12521
|
const Components2 = useVulcanComponents();
|
12442
|
-
return /* @__PURE__ */
|
12522
|
+
return /* @__PURE__ */ React45.createElement("ol", {
|
12443
12523
|
className: "contents-array"
|
12444
|
-
}, value.map((item, index) => /* @__PURE__ */
|
12524
|
+
}, value.map((item, index) => /* @__PURE__ */ React45.createElement("li", {
|
12445
12525
|
key: index
|
12446
|
-
}, /* @__PURE__ */
|
12526
|
+
}, /* @__PURE__ */ React45.createElement(Components2.CardItem, {
|
12447
12527
|
value: item,
|
12448
12528
|
typeName: typeof item,
|
12449
12529
|
nestingLevel
|
@@ -12453,20 +12533,20 @@ var CardItemArray = /* @__PURE__ */ __name(({ nestingLevel, value }) => {
|
|
12453
12533
|
// components/cell/CardItemDate.tsx
|
12454
12534
|
init_esm_shims();
|
12455
12535
|
var import_moment2 = __toESM(require_moment(), 1);
|
12456
|
-
import
|
12457
|
-
var CardItemDate = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */
|
12536
|
+
import React46 from "react";
|
12537
|
+
var CardItemDate = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ React46.createElement("span", {
|
12458
12538
|
className: "contents-date"
|
12459
12539
|
}, (0, import_moment2.default)(new Date(value)).format("YYYY/MM/DD, hh:mm")), "CardItemDate");
|
12460
12540
|
|
12461
12541
|
// components/cell/CardItemDefault.tsx
|
12462
12542
|
init_esm_shims();
|
12463
|
-
import
|
12464
|
-
var CardItemDefault = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */
|
12543
|
+
import React47 from "react";
|
12544
|
+
var CardItemDefault = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ React47.createElement("span", null, value && value.toString()), "CardItemDefault");
|
12465
12545
|
|
12466
12546
|
// components/cell/CardItemHTML.tsx
|
12467
12547
|
init_esm_shims();
|
12468
|
-
import
|
12469
|
-
var CardItemHTML = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */
|
12548
|
+
import React48 from "react";
|
12549
|
+
var CardItemHTML = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ React48.createElement("div", {
|
12470
12550
|
className: "contents-html",
|
12471
12551
|
dangerouslySetInnerHTML: {
|
12472
12552
|
__html: value
|
@@ -12475,7 +12555,7 @@ var CardItemHTML = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ React45
|
|
12475
12555
|
|
12476
12556
|
// components/cell/CardItemImage.tsx
|
12477
12557
|
init_esm_shims();
|
12478
|
-
import
|
12558
|
+
import React49 from "react";
|
12479
12559
|
var CardItemImage = /* @__PURE__ */ __name(({ value, force = false }) => {
|
12480
12560
|
const Components2 = useVulcanComponents();
|
12481
12561
|
const isImage = [
|
@@ -12486,7 +12566,7 @@ var CardItemImage = /* @__PURE__ */ __name(({ value, force = false }) => {
|
|
12486
12566
|
".webp",
|
12487
12567
|
".jpeg"
|
12488
12568
|
].indexOf(value.substr(-5)) !== -1;
|
12489
|
-
return isImage || force ? /* @__PURE__ */
|
12569
|
+
return isImage || force ? /* @__PURE__ */ React49.createElement("img", {
|
12490
12570
|
className: "contents-image",
|
12491
12571
|
style: {
|
12492
12572
|
width: "100%",
|
@@ -12496,24 +12576,24 @@ var CardItemImage = /* @__PURE__ */ __name(({ value, force = false }) => {
|
|
12496
12576
|
},
|
12497
12577
|
src: value,
|
12498
12578
|
alt: value
|
12499
|
-
}) : /* @__PURE__ */
|
12579
|
+
}) : /* @__PURE__ */ React49.createElement(Components2.CardItemURL, {
|
12500
12580
|
value
|
12501
12581
|
});
|
12502
12582
|
}, "CardItemImage");
|
12503
12583
|
|
12504
12584
|
// components/cell/CardItemNumber.tsx
|
12505
12585
|
init_esm_shims();
|
12506
|
-
import
|
12507
|
-
var CardItemNumber = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */
|
12586
|
+
import React50 from "react";
|
12587
|
+
var CardItemNumber = /* @__PURE__ */ __name(({ value }) => /* @__PURE__ */ React50.createElement("code", {
|
12508
12588
|
className: "contents-number"
|
12509
12589
|
}, value.toString()), "CardItemNumber");
|
12510
12590
|
|
12511
12591
|
// components/cell/CardItemObject.tsx
|
12512
12592
|
init_esm_shims();
|
12513
|
-
import
|
12593
|
+
import React51 from "react";
|
12514
12594
|
import without3 from "lodash/without.js";
|
12515
|
-
function
|
12516
|
-
|
12595
|
+
function _extends30() {
|
12596
|
+
_extends30 = Object.assign || function(target) {
|
12517
12597
|
for (var i = 1; i < arguments.length; i++) {
|
12518
12598
|
var source = arguments[i];
|
12519
12599
|
for (var key in source) {
|
@@ -12524,36 +12604,36 @@ function _extends28() {
|
|
12524
12604
|
}
|
12525
12605
|
return target;
|
12526
12606
|
};
|
12527
|
-
return
|
12607
|
+
return _extends30.apply(this, arguments);
|
12528
12608
|
}
|
12529
|
-
__name(
|
12609
|
+
__name(_extends30, "_extends");
|
12530
12610
|
var CardItemObject = /* @__PURE__ */ __name((props) => {
|
12531
12611
|
const { nestingLevel, value, showExpand } = props;
|
12532
12612
|
const Components2 = useVulcanComponents();
|
12533
12613
|
const showExpandControl = showExpand || nestingLevel > 1;
|
12534
12614
|
if (value.__typename === "User") {
|
12535
12615
|
const user = value;
|
12536
|
-
return /* @__PURE__ */
|
12616
|
+
return /* @__PURE__ */ React51.createElement("div", {
|
12537
12617
|
className: "dashboard-user",
|
12538
12618
|
style: {
|
12539
12619
|
whiteSpace: "nowrap"
|
12540
12620
|
}
|
12541
|
-
}, user.pagePath ? /* @__PURE__ */
|
12621
|
+
}, user.pagePath ? /* @__PURE__ */ React51.createElement("a", {
|
12542
12622
|
href: user.pagePath
|
12543
|
-
}, user.displayName) : /* @__PURE__ */
|
12623
|
+
}, user.displayName) : /* @__PURE__ */ React51.createElement("span", null, user.displayName));
|
12544
12624
|
} else {
|
12545
|
-
return /* @__PURE__ */
|
12625
|
+
return /* @__PURE__ */ React51.createElement("div", {
|
12546
12626
|
className: "card-item-details"
|
12547
|
-
}, showExpandControl ? /* @__PURE__ */
|
12627
|
+
}, showExpandControl ? /* @__PURE__ */ React51.createElement("details", null, /* @__PURE__ */ React51.createElement("summary", null, "Expand"), /* @__PURE__ */ React51.createElement(CardItemObjectContents, _extends30({}, props))) : /* @__PURE__ */ React51.createElement(CardItemObjectContents, _extends30({}, props)));
|
12548
12628
|
}
|
12549
12629
|
}, "CardItemObject");
|
12550
12630
|
var CardItemObjectContents = /* @__PURE__ */ __name(({ nestingLevel, value: object }) => {
|
12551
12631
|
const Components2 = useVulcanComponents();
|
12552
|
-
return /* @__PURE__ */
|
12632
|
+
return /* @__PURE__ */ React51.createElement("table", {
|
12553
12633
|
className: "table table-bordered"
|
12554
|
-
}, /* @__PURE__ */
|
12634
|
+
}, /* @__PURE__ */ React51.createElement("tbody", null, without3(Object.keys(object), "__typename").map((key) => /* @__PURE__ */ React51.createElement("tr", {
|
12555
12635
|
key
|
12556
|
-
}, /* @__PURE__ */
|
12636
|
+
}, /* @__PURE__ */ React51.createElement("td", null, /* @__PURE__ */ React51.createElement("strong", null, key)), /* @__PURE__ */ React51.createElement("td", null, /* @__PURE__ */ React51.createElement(Components2.CardItemSwitcher, {
|
12557
12637
|
nestingLevel,
|
12558
12638
|
value: object[key],
|
12559
12639
|
typeName: typeof object[key]
|
@@ -12562,9 +12642,9 @@ var CardItemObjectContents = /* @__PURE__ */ __name(({ nestingLevel, value: obje
|
|
12562
12642
|
|
12563
12643
|
// components/cell/CardItemRelationHasMany.tsx
|
12564
12644
|
init_esm_shims();
|
12565
|
-
import
|
12566
|
-
function
|
12567
|
-
|
12645
|
+
import React52 from "react";
|
12646
|
+
function _extends31() {
|
12647
|
+
_extends31 = Object.assign || function(target) {
|
12568
12648
|
for (var i = 1; i < arguments.length; i++) {
|
12569
12649
|
var source = arguments[i];
|
12570
12650
|
for (var key in source) {
|
@@ -12575,15 +12655,15 @@ function _extends29() {
|
|
12575
12655
|
}
|
12576
12656
|
return target;
|
12577
12657
|
};
|
12578
|
-
return
|
12658
|
+
return _extends31.apply(this, arguments);
|
12579
12659
|
}
|
12580
|
-
__name(
|
12660
|
+
__name(_extends31, "_extends");
|
12581
12661
|
var CardItemRelationHasMany = /* @__PURE__ */ __name((_a) => {
|
12582
12662
|
var _b = _a, { relatedDocument: relatedDocuments } = _b, rest = __objRest(_b, ["relatedDocument"]);
|
12583
12663
|
const Components2 = useVulcanComponents();
|
12584
|
-
return /* @__PURE__ */
|
12664
|
+
return /* @__PURE__ */ React52.createElement("div", {
|
12585
12665
|
className: "contents-hasmany"
|
12586
|
-
}, relatedDocuments.map((relatedDocument) => /* @__PURE__ */
|
12666
|
+
}, relatedDocuments.map((relatedDocument) => /* @__PURE__ */ React52.createElement(Components2.CardItemRelationItem, _extends31({
|
12587
12667
|
key: relatedDocument._id,
|
12588
12668
|
relatedDocument
|
12589
12669
|
}, rest))));
|
@@ -12591,9 +12671,9 @@ var CardItemRelationHasMany = /* @__PURE__ */ __name((_a) => {
|
|
12591
12671
|
|
12592
12672
|
// components/cell/CardItemRelationHasOne.tsx
|
12593
12673
|
init_esm_shims();
|
12594
|
-
import
|
12595
|
-
function
|
12596
|
-
|
12674
|
+
import React53 from "react";
|
12675
|
+
function _extends32() {
|
12676
|
+
_extends32 = Object.assign || function(target) {
|
12597
12677
|
for (var i = 1; i < arguments.length; i++) {
|
12598
12678
|
var source = arguments[i];
|
12599
12679
|
for (var key in source) {
|
@@ -12604,39 +12684,39 @@ function _extends30() {
|
|
12604
12684
|
}
|
12605
12685
|
return target;
|
12606
12686
|
};
|
12607
|
-
return
|
12687
|
+
return _extends32.apply(this, arguments);
|
12608
12688
|
}
|
12609
|
-
__name(
|
12689
|
+
__name(_extends32, "_extends");
|
12610
12690
|
var CardItemRelationHasOne = /* @__PURE__ */ __name((_a) => {
|
12611
12691
|
var rest = __objRest(_a, []);
|
12612
12692
|
const Components2 = useVulcanComponents();
|
12613
|
-
return /* @__PURE__ */
|
12693
|
+
return /* @__PURE__ */ React53.createElement("div", {
|
12614
12694
|
className: "contents-hasone"
|
12615
|
-
}, /* @__PURE__ */
|
12695
|
+
}, /* @__PURE__ */ React53.createElement(Components2.CardItemRelationItem, _extends32({}, rest)));
|
12616
12696
|
}, "CardItemRelationHasOne");
|
12617
12697
|
|
12618
12698
|
// components/cell/CardItemString.tsx
|
12619
12699
|
init_esm_shims();
|
12620
|
-
import
|
12621
|
-
var CardItemString = /* @__PURE__ */ __name(({ string }) => /* @__PURE__ */
|
12700
|
+
import React54 from "react";
|
12701
|
+
var CardItemString = /* @__PURE__ */ __name(({ string }) => /* @__PURE__ */ React54.createElement("div", {
|
12622
12702
|
className: "contents-string"
|
12623
|
-
}, string.indexOf(" ") === -1 && string.length > 30 ? /* @__PURE__ */
|
12703
|
+
}, string.indexOf(" ") === -1 && string.length > 30 ? /* @__PURE__ */ React54.createElement("span", {
|
12624
12704
|
title: string
|
12625
|
-
}, string.substr(0, 30), "\u2026") : /* @__PURE__ */
|
12705
|
+
}, string.substr(0, 30), "\u2026") : /* @__PURE__ */ React54.createElement("span", null, string)), "CardItemString");
|
12626
12706
|
|
12627
12707
|
// components/cell/CardItemURL.tsx
|
12628
12708
|
init_esm_shims();
|
12629
|
-
import
|
12709
|
+
import React55 from "react";
|
12630
12710
|
var CardItemURL = /* @__PURE__ */ __name(({ value, force }) => {
|
12631
12711
|
const Components2 = useVulcanComponents();
|
12632
|
-
return force || value.slice(0, 4) === "http" ? /* @__PURE__ */
|
12712
|
+
return force || value.slice(0, 4) === "http" ? /* @__PURE__ */ React55.createElement("a", {
|
12633
12713
|
className: "contents-link",
|
12634
12714
|
href: value,
|
12635
12715
|
target: "_blank",
|
12636
12716
|
rel: "noopener noreferrer"
|
12637
|
-
}, /* @__PURE__ */
|
12717
|
+
}, /* @__PURE__ */ React55.createElement(Components2.CardItemString, {
|
12638
12718
|
string: value
|
12639
|
-
})) : /* @__PURE__ */
|
12719
|
+
})) : /* @__PURE__ */ React55.createElement(Components2.CardItemString, {
|
12640
12720
|
string: value
|
12641
12721
|
});
|
12642
12722
|
}, "CardItemURL");
|
@@ -12665,11 +12745,11 @@ var defaultCellComponents = {
|
|
12665
12745
|
init_esm_shims();
|
12666
12746
|
import { FormattedMessage } from "@vulcanjs/react-i18n";
|
12667
12747
|
|
12668
|
-
// components/
|
12748
|
+
// components/core/Button.tsx
|
12669
12749
|
init_esm_shims();
|
12670
|
-
import
|
12671
|
-
function
|
12672
|
-
|
12750
|
+
import React56 from "react";
|
12751
|
+
function _extends33() {
|
12752
|
+
_extends33 = Object.assign || function(target) {
|
12673
12753
|
for (var i = 1; i < arguments.length; i++) {
|
12674
12754
|
var source = arguments[i];
|
12675
12755
|
for (var key in source) {
|
@@ -12680,27 +12760,27 @@ function _extends31() {
|
|
12680
12760
|
}
|
12681
12761
|
return target;
|
12682
12762
|
};
|
12683
|
-
return
|
12763
|
+
return _extends33.apply(this, arguments);
|
12684
12764
|
}
|
12685
|
-
__name(
|
12765
|
+
__name(_extends33, "_extends");
|
12686
12766
|
var Button = /* @__PURE__ */ __name((_a) => {
|
12687
12767
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
12688
|
-
return /* @__PURE__ */
|
12768
|
+
return /* @__PURE__ */ React56.createElement("button", _extends33({}, props), children);
|
12689
12769
|
}, "Button");
|
12690
12770
|
|
12691
|
-
// components/
|
12771
|
+
// components/core/Loading.tsx
|
12692
12772
|
init_esm_shims();
|
12693
|
-
import
|
12694
|
-
var Loading = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
12773
|
+
import React57 from "react";
|
12774
|
+
var Loading = /* @__PURE__ */ __name(() => /* @__PURE__ */ React57.createElement("span", {
|
12695
12775
|
"aria-live": "polite",
|
12696
12776
|
"aria-busy": "true"
|
12697
12777
|
}, "Loading..."), "Loading");
|
12698
12778
|
|
12699
12779
|
// components/LoadingButton.tsx
|
12700
12780
|
init_esm_shims();
|
12701
|
-
import
|
12702
|
-
function
|
12703
|
-
|
12781
|
+
import React58 from "react";
|
12782
|
+
function _extends34() {
|
12783
|
+
_extends34 = Object.assign || function(target) {
|
12704
12784
|
for (var i = 1; i < arguments.length; i++) {
|
12705
12785
|
var source = arguments[i];
|
12706
12786
|
for (var key in source) {
|
@@ -12711,9 +12791,9 @@ function _extends32() {
|
|
12711
12791
|
}
|
12712
12792
|
return target;
|
12713
12793
|
};
|
12714
|
-
return
|
12794
|
+
return _extends34.apply(this, arguments);
|
12715
12795
|
}
|
12716
|
-
__name(
|
12796
|
+
__name(_extends34, "_extends");
|
12717
12797
|
var LoadingButton = /* @__PURE__ */ __name((_a) => {
|
12718
12798
|
var _b = _a, { loading, label, onClick, children, className = "" } = _b, rest = __objRest(_b, ["loading", "label", "onClick", "children", "className"]);
|
12719
12799
|
const Components2 = useVulcanComponents();
|
@@ -12735,24 +12815,24 @@ var LoadingButton = /* @__PURE__ */ __name((_a) => {
|
|
12735
12815
|
} : {
|
12736
12816
|
display: "none"
|
12737
12817
|
};
|
12738
|
-
return /* @__PURE__ */
|
12818
|
+
return /* @__PURE__ */ React58.createElement(Components2.Button, _extends34({
|
12739
12819
|
className: `loading-button ${loading ? "loading-button-loading" : "loading-button-notloading"} ${className}`,
|
12740
12820
|
onClick
|
12741
|
-
}, rest), /* @__PURE__ */
|
12821
|
+
}, rest), /* @__PURE__ */ React58.createElement("span", {
|
12742
12822
|
style: wrapperStyle
|
12743
|
-
}, /* @__PURE__ */
|
12823
|
+
}, /* @__PURE__ */ React58.createElement("span", {
|
12744
12824
|
style: labelStyle
|
12745
|
-
}, label || children), /* @__PURE__ */
|
12825
|
+
}, label || children), /* @__PURE__ */ React58.createElement("span", {
|
12746
12826
|
style: loadingStyle
|
12747
|
-
}, /* @__PURE__ */
|
12827
|
+
}, /* @__PURE__ */ React58.createElement(Components2.Loading, null))));
|
12748
12828
|
}, "LoadingButton");
|
12749
12829
|
|
12750
12830
|
// components/MutationButton.tsx
|
12751
12831
|
init_esm_shims();
|
12752
|
-
import
|
12832
|
+
import React59, { useState as useState8 } from "react";
|
12753
12833
|
import { useMutation } from "@apollo/client";
|
12754
|
-
function
|
12755
|
-
|
12834
|
+
function _extends35() {
|
12835
|
+
_extends35 = Object.assign || function(target) {
|
12756
12836
|
for (var i = 1; i < arguments.length; i++) {
|
12757
12837
|
var source = arguments[i];
|
12758
12838
|
for (var key in source) {
|
@@ -12763,9 +12843,9 @@ function _extends33() {
|
|
12763
12843
|
}
|
12764
12844
|
return target;
|
12765
12845
|
};
|
12766
|
-
return
|
12846
|
+
return _extends35.apply(this, arguments);
|
12767
12847
|
}
|
12768
|
-
__name(
|
12848
|
+
__name(_extends35, "_extends");
|
12769
12849
|
var MutationButton = /* @__PURE__ */ __name((props) => {
|
12770
12850
|
const Components2 = useVulcanComponents();
|
12771
12851
|
const [loading, setLoading] = useState8(false);
|
@@ -12811,13 +12891,13 @@ var MutationButton = /* @__PURE__ */ __name((props) => {
|
|
12811
12891
|
setLoading(false);
|
12812
12892
|
}
|
12813
12893
|
}, "handleClick");
|
12814
|
-
const loadingButton = /* @__PURE__ */
|
12894
|
+
const loadingButton = /* @__PURE__ */ React59.createElement(Components2.LoadingButton, _extends35({
|
12815
12895
|
loading,
|
12816
12896
|
onClick: handleClick,
|
12817
12897
|
label
|
12818
12898
|
}, loadingButtonProps));
|
12819
12899
|
if (error1) {
|
12820
|
-
return /* @__PURE__ */
|
12900
|
+
return /* @__PURE__ */ React59.createElement(Components2.TooltipTrigger, {
|
12821
12901
|
trigger: loadingButton,
|
12822
12902
|
defaultShow: true
|
12823
12903
|
}, error1.message.replace("GraphQL error: ", ""));
|
@@ -12827,7 +12907,7 @@ var MutationButton = /* @__PURE__ */ __name((props) => {
|
|
12827
12907
|
|
12828
12908
|
// components/HeadTags.tsx
|
12829
12909
|
init_esm_shims();
|
12830
|
-
import
|
12910
|
+
import React60, { PureComponent } from "react";
|
12831
12911
|
var HeadTags = class extends PureComponent {
|
12832
12912
|
render() {
|
12833
12913
|
console.warn("HeadTags won't work in Next.js, because Head doesn't support nesting. Define meta directly in your app instead.");
|
@@ -12839,45 +12919,45 @@ var HeadTags = class extends PureComponent {
|
|
12839
12919
|
}
|
12840
12920
|
image = siteUrl + image;
|
12841
12921
|
}
|
12842
|
-
return /* @__PURE__ */
|
12922
|
+
return /* @__PURE__ */ React60.createElement(React60.Fragment, null, /* @__PURE__ */ React60.createElement("title", null, title), /* @__PURE__ */ React60.createElement("meta", {
|
12843
12923
|
charSet: "utf-8"
|
12844
|
-
}), /* @__PURE__ */
|
12924
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12845
12925
|
name: "description",
|
12846
12926
|
content: description
|
12847
|
-
}), /* @__PURE__ */
|
12927
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12848
12928
|
name: "viewport",
|
12849
12929
|
content: "width=device-width, initial-scale=1"
|
12850
|
-
}), /* @__PURE__ */
|
12930
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12851
12931
|
property: "og:type",
|
12852
12932
|
content: "article"
|
12853
|
-
}), /* @__PURE__ */
|
12933
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12854
12934
|
property: "og:url",
|
12855
12935
|
content: url
|
12856
|
-
}), /* @__PURE__ */
|
12936
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12857
12937
|
property: "og:image",
|
12858
12938
|
content: image
|
12859
|
-
}), /* @__PURE__ */
|
12939
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12860
12940
|
property: "og:title",
|
12861
12941
|
content: title
|
12862
|
-
}), /* @__PURE__ */
|
12942
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12863
12943
|
property: "og:description",
|
12864
12944
|
content: description
|
12865
|
-
}), /* @__PURE__ */
|
12945
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12866
12946
|
name: "twitter:card",
|
12867
12947
|
content: "summary"
|
12868
|
-
}), /* @__PURE__ */
|
12948
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12869
12949
|
name: "twitter:image:src",
|
12870
12950
|
content: image
|
12871
|
-
}), /* @__PURE__ */
|
12951
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12872
12952
|
name: "twitter:title",
|
12873
12953
|
content: title
|
12874
|
-
}), /* @__PURE__ */
|
12954
|
+
}), /* @__PURE__ */ React60.createElement("meta", {
|
12875
12955
|
name: "twitter:description",
|
12876
12956
|
content: description
|
12877
|
-
}), /* @__PURE__ */
|
12957
|
+
}), /* @__PURE__ */ React60.createElement("link", {
|
12878
12958
|
rel: "canonical",
|
12879
12959
|
href: url
|
12880
|
-
}), /* @__PURE__ */
|
12960
|
+
}), /* @__PURE__ */ React60.createElement("link", {
|
12881
12961
|
rel: "shortcut icon",
|
12882
12962
|
href: faviconUrl || "/favicon.ico"
|
12883
12963
|
}));
|
@@ -12887,9 +12967,9 @@ __name(HeadTags, "HeadTags");
|
|
12887
12967
|
|
12888
12968
|
// components/bootstrap/TooltipTrigger.tsx
|
12889
12969
|
init_esm_shims();
|
12890
|
-
import
|
12970
|
+
import React61 from "react";
|
12891
12971
|
var TooltipTrigger = /* @__PURE__ */ __name(({ children, trigger }) => {
|
12892
|
-
return /* @__PURE__ */
|
12972
|
+
return /* @__PURE__ */ React61.createElement("div", {
|
12893
12973
|
title: children
|
12894
12974
|
}, trigger);
|
12895
12975
|
}, "TooltipTrigger");
|
@@ -12897,10 +12977,10 @@ var TooltipTrigger = /* @__PURE__ */ __name(({ children, trigger }) => {
|
|
12897
12977
|
// components/bootstrap/Dropdown.tsx
|
12898
12978
|
init_esm_shims();
|
12899
12979
|
var import_prop_types6 = __toESM(require_prop_types(), 1);
|
12900
|
-
import
|
12980
|
+
import React62 from "react";
|
12901
12981
|
import { Dropdown, DropdownButton } from "react-bootstrap";
|
12902
|
-
function
|
12903
|
-
|
12982
|
+
function _extends36() {
|
12983
|
+
_extends36 = Object.assign || function(target) {
|
12904
12984
|
for (var i = 1; i < arguments.length; i++) {
|
12905
12985
|
var source = arguments[i];
|
12906
12986
|
for (var key in source) {
|
@@ -12911,9 +12991,9 @@ function _extends34() {
|
|
12911
12991
|
}
|
12912
12992
|
return target;
|
12913
12993
|
};
|
12914
|
-
return
|
12994
|
+
return _extends36.apply(this, arguments);
|
12915
12995
|
}
|
12916
|
-
__name(
|
12996
|
+
__name(_extends36, "_extends");
|
12917
12997
|
var DropdownItem = Dropdown.Item;
|
12918
12998
|
var Item = /* @__PURE__ */ __name((_a) => {
|
12919
12999
|
var _b = _a, {
|
@@ -12934,15 +13014,15 @@ var Item = /* @__PURE__ */ __name((_a) => {
|
|
12934
13014
|
const Components2 = useVulcanComponents();
|
12935
13015
|
let menuComponent;
|
12936
13016
|
if (component) {
|
12937
|
-
menuComponent = /* @__PURE__ */
|
13017
|
+
menuComponent = /* @__PURE__ */ React62.cloneElement(component, componentProps);
|
12938
13018
|
} else if (labelId) {
|
12939
|
-
menuComponent = /* @__PURE__ */
|
13019
|
+
menuComponent = /* @__PURE__ */ React62.createElement(Components2.FormattedMessage, {
|
12940
13020
|
id: labelId
|
12941
13021
|
});
|
12942
13022
|
} else {
|
12943
|
-
menuComponent = /* @__PURE__ */
|
13023
|
+
menuComponent = /* @__PURE__ */ React62.createElement("span", null, label);
|
12944
13024
|
}
|
12945
|
-
const item = /* @__PURE__ */
|
13025
|
+
const item = /* @__PURE__ */ React62.createElement(DropdownItem, _extends36({
|
12946
13026
|
eventKey: index
|
12947
13027
|
}, itemProps, rest), menuComponent);
|
12948
13028
|
return item;
|
@@ -12958,9 +13038,9 @@ Item.propTypes = {
|
|
12958
13038
|
};
|
12959
13039
|
var Node = /* @__PURE__ */ __name((_a) => {
|
12960
13040
|
var _b = _a, { childrenItems } = _b, rest = __objRest(_b, ["childrenItems"]);
|
12961
|
-
return /* @__PURE__ */
|
13041
|
+
return /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(Item, _extends36({}, rest)), childrenItems && !!childrenItems.length && /* @__PURE__ */ React62.createElement("div", {
|
12962
13042
|
className: "menu-node-children"
|
12963
|
-
}, childrenItems.map((item, index) => /* @__PURE__ */
|
13043
|
+
}, childrenItems.map((item, index) => /* @__PURE__ */ React62.createElement(Item, _extends36({
|
12964
13044
|
key: index
|
12965
13045
|
}, item)))));
|
12966
13046
|
}, "Node");
|
@@ -12972,11 +13052,11 @@ var BootstrapDropdown = /* @__PURE__ */ __name((_a) => {
|
|
12972
13052
|
const Components2 = useVulcanComponents();
|
12973
13053
|
const menuBody = menuContents ? menuContents : menuItems.map((item, index) => {
|
12974
13054
|
if (item === "divider") {
|
12975
|
-
return /* @__PURE__ */
|
13055
|
+
return /* @__PURE__ */ React62.createElement(Dropdown.Divider, {
|
12976
13056
|
key: index
|
12977
13057
|
});
|
12978
13058
|
} else {
|
12979
|
-
return /* @__PURE__ */
|
13059
|
+
return /* @__PURE__ */ React62.createElement(Node, _extends36({}, item, {
|
12980
13060
|
key: index,
|
12981
13061
|
index
|
12982
13062
|
}));
|
@@ -12986,10 +13066,10 @@ var BootstrapDropdown = /* @__PURE__ */ __name((_a) => {
|
|
12986
13066
|
return menuBody;
|
12987
13067
|
} else {
|
12988
13068
|
if (trigger) {
|
12989
|
-
return /* @__PURE__ */
|
13069
|
+
return /* @__PURE__ */ React62.createElement(Dropdown, _extends36({}, dropdownProps), /* @__PURE__ */ React62.createElement(Dropdown.Toggle, null, trigger), /* @__PURE__ */ React62.createElement(Dropdown.Menu, null, menuBody));
|
12990
13070
|
} else {
|
12991
|
-
return /* @__PURE__ */
|
12992
|
-
title: labelId ? /* @__PURE__ */
|
13071
|
+
return /* @__PURE__ */ React62.createElement(DropdownButton, _extends36({}, buttonProps, {
|
13072
|
+
title: labelId ? /* @__PURE__ */ React62.createElement(Components2.FormattedMessage, {
|
12993
13073
|
id: labelId
|
12994
13074
|
}) : label
|
12995
13075
|
}, dropdownProps), menuBody);
|
@@ -13010,10 +13090,10 @@ var Dropdown_default = BootstrapDropdown;
|
|
13010
13090
|
// components/bootstrap/Modal.tsx
|
13011
13091
|
init_esm_shims();
|
13012
13092
|
var import_prop_types7 = __toESM(require_prop_types(), 1);
|
13013
|
-
import
|
13093
|
+
import React63 from "react";
|
13014
13094
|
import { Modal } from "react-bootstrap";
|
13015
|
-
function
|
13016
|
-
|
13095
|
+
function _extends37() {
|
13096
|
+
_extends37 = Object.assign || function(target) {
|
13017
13097
|
for (var i = 1; i < arguments.length; i++) {
|
13018
13098
|
var source = arguments[i];
|
13019
13099
|
for (var key in source) {
|
@@ -13024,29 +13104,29 @@ function _extends35() {
|
|
13024
13104
|
}
|
13025
13105
|
return target;
|
13026
13106
|
};
|
13027
|
-
return
|
13107
|
+
return _extends37.apply(this, arguments);
|
13028
13108
|
}
|
13029
|
-
__name(
|
13109
|
+
__name(_extends37, "_extends");
|
13030
13110
|
var BootstrapModal = /* @__PURE__ */ __name((_a) => {
|
13031
13111
|
var _b = _a, { children, size: size2 = "lg", show = false, onHide, title, showCloseButton = true, header, footer } = _b, rest = __objRest(_b, ["children", "size", "show", "onHide", "title", "showCloseButton", "header", "footer"]);
|
13032
13112
|
let headerComponent;
|
13033
13113
|
if (header) {
|
13034
|
-
headerComponent = /* @__PURE__ */
|
13114
|
+
headerComponent = /* @__PURE__ */ React63.createElement(Modal.Header, null, header);
|
13035
13115
|
} else if (title) {
|
13036
|
-
headerComponent = /* @__PURE__ */
|
13116
|
+
headerComponent = /* @__PURE__ */ React63.createElement(Modal.Header, {
|
13037
13117
|
closeButton: showCloseButton
|
13038
|
-
}, /* @__PURE__ */
|
13118
|
+
}, /* @__PURE__ */ React63.createElement(Modal.Title, null, title));
|
13039
13119
|
} else {
|
13040
|
-
headerComponent = /* @__PURE__ */
|
13120
|
+
headerComponent = /* @__PURE__ */ React63.createElement(Modal.Header, {
|
13041
13121
|
closeButton: showCloseButton
|
13042
13122
|
});
|
13043
13123
|
}
|
13044
|
-
const footerComponent = footer ? /* @__PURE__ */
|
13045
|
-
return /* @__PURE__ */
|
13124
|
+
const footerComponent = footer ? /* @__PURE__ */ React63.createElement(Modal.Footer, null, footer) : null;
|
13125
|
+
return /* @__PURE__ */ React63.createElement(Modal, _extends37({
|
13046
13126
|
size: size2,
|
13047
13127
|
show,
|
13048
13128
|
onHide
|
13049
|
-
}, rest), headerComponent, /* @__PURE__ */
|
13129
|
+
}, rest), headerComponent, /* @__PURE__ */ React63.createElement(Modal.Body, null, children), footerComponent);
|
13050
13130
|
}, "BootstrapModal");
|
13051
13131
|
BootstrapModal.propTypes = {
|
13052
13132
|
size: import_prop_types7.default.string,
|
@@ -13069,9 +13149,9 @@ BootstrapModal.propTypes = {
|
|
13069
13149
|
|
13070
13150
|
// components/bootstrap/ModalTrigger.tsx
|
13071
13151
|
init_esm_shims();
|
13072
|
-
import
|
13073
|
-
function
|
13074
|
-
|
13152
|
+
import React64, { useState as useState9 } from "react";
|
13153
|
+
function _extends38() {
|
13154
|
+
_extends38 = Object.assign || function(target) {
|
13075
13155
|
for (var i = 1; i < arguments.length; i++) {
|
13076
13156
|
var source = arguments[i];
|
13077
13157
|
for (var key in source) {
|
@@ -13082,9 +13162,9 @@ function _extends36() {
|
|
13082
13162
|
}
|
13083
13163
|
return target;
|
13084
13164
|
};
|
13085
|
-
return
|
13165
|
+
return _extends38.apply(this, arguments);
|
13086
13166
|
}
|
13087
|
-
__name(
|
13167
|
+
__name(_extends38, "_extends");
|
13088
13168
|
var ModalTrigger = /* @__PURE__ */ __name((props) => {
|
13089
13169
|
const [modalIsOpen, setModalIsOpen] = useState9(false);
|
13090
13170
|
const { onClick, openCallback, closeCallback } = props;
|
@@ -13110,23 +13190,23 @@ var ModalTrigger = /* @__PURE__ */ __name((props) => {
|
|
13110
13190
|
const Components2 = useVulcanComponents();
|
13111
13191
|
const { trigger, component, children, label, size: size2, className, dialogClassName, title, modalProps, header, footer } = props;
|
13112
13192
|
let triggerComponent = trigger || component;
|
13113
|
-
triggerComponent = triggerComponent ? /* @__PURE__ */
|
13193
|
+
triggerComponent = triggerComponent ? /* @__PURE__ */ React64.createElement("span", {
|
13114
13194
|
onClick: clickHandler
|
13115
|
-
}, triggerComponent) : /* @__PURE__ */
|
13195
|
+
}, triggerComponent) : /* @__PURE__ */ React64.createElement(Components2.Button, {
|
13116
13196
|
onClick: clickHandler
|
13117
13197
|
}, label);
|
13118
|
-
const childrenComponent = /* @__PURE__ */
|
13198
|
+
const childrenComponent = /* @__PURE__ */ React64.cloneElement(children, {
|
13119
13199
|
closeModal
|
13120
13200
|
});
|
13121
|
-
const headerComponent = header && /* @__PURE__ */
|
13201
|
+
const headerComponent = header && /* @__PURE__ */ React64.cloneElement(header, {
|
13122
13202
|
closeModal
|
13123
13203
|
});
|
13124
|
-
const footerComponent = footer && /* @__PURE__ */
|
13204
|
+
const footerComponent = footer && /* @__PURE__ */ React64.cloneElement(footer, {
|
13125
13205
|
closeModal
|
13126
13206
|
});
|
13127
|
-
return /* @__PURE__ */
|
13207
|
+
return /* @__PURE__ */ React64.createElement("div", {
|
13128
13208
|
className: "modal-trigger"
|
13129
|
-
}, triggerComponent, /* @__PURE__ */
|
13209
|
+
}, triggerComponent, /* @__PURE__ */ React64.createElement(Components2.Modal, _extends38({
|
13130
13210
|
size: size2,
|
13131
13211
|
className,
|
13132
13212
|
show: modalIsOpen,
|
@@ -13159,8 +13239,8 @@ var defaultVulcanComponents = __spreadValues(__spreadValues(__spreadValues(__spr
|
|
13159
13239
|
|
13160
13240
|
// components/VulcanComponents/Provider.tsx
|
13161
13241
|
import { debugVulcan as debugVulcan2 } from "@vulcanjs/utils";
|
13162
|
-
function
|
13163
|
-
|
13242
|
+
function _extends39() {
|
13243
|
+
_extends39 = Object.assign || function(target) {
|
13164
13244
|
for (var i = 1; i < arguments.length; i++) {
|
13165
13245
|
var source = arguments[i];
|
13166
13246
|
for (var key in source) {
|
@@ -13171,9 +13251,9 @@ function _extends37() {
|
|
13171
13251
|
}
|
13172
13252
|
return target;
|
13173
13253
|
};
|
13174
|
-
return
|
13254
|
+
return _extends39.apply(this, arguments);
|
13175
13255
|
}
|
13176
|
-
__name(
|
13256
|
+
__name(_extends39, "_extends");
|
13177
13257
|
var debugComponents = debugVulcan2("components");
|
13178
13258
|
var VulcanComponentsProvider = /* @__PURE__ */ __name((_a) => {
|
13179
13259
|
var _b = _a, { value } = _b, props = __objRest(_b, ["value"]);
|
@@ -13191,23 +13271,23 @@ var VulcanComponentsProvider = /* @__PURE__ */ __name((_a) => {
|
|
13191
13271
|
"useVulcanComponents" from index instead of Consumer.`);
|
13192
13272
|
}
|
13193
13273
|
});
|
13194
|
-
return /* @__PURE__ */
|
13274
|
+
return /* @__PURE__ */ React65.createElement(VulcanComponentsContext.Provider, _extends39({
|
13195
13275
|
value: mergedComponents
|
13196
13276
|
}, props));
|
13197
13277
|
}, "VulcanComponentsProvider");
|
13198
13278
|
|
13199
13279
|
// components/VulcanComponents/typings.ts
|
13200
13280
|
init_esm_shims();
|
13201
|
-
import
|
13281
|
+
import React66 from "react";
|
13202
13282
|
|
13203
13283
|
// components/VulcanCurrentUser/index.ts
|
13204
13284
|
init_esm_shims();
|
13205
13285
|
|
13206
13286
|
// components/VulcanCurrentUser/Provider.tsx
|
13207
13287
|
init_esm_shims();
|
13208
|
-
import
|
13209
|
-
function
|
13210
|
-
|
13288
|
+
import React67 from "react";
|
13289
|
+
function _extends40() {
|
13290
|
+
_extends40 = Object.assign || function(target) {
|
13211
13291
|
for (var i = 1; i < arguments.length; i++) {
|
13212
13292
|
var source = arguments[i];
|
13213
13293
|
for (var key in source) {
|
@@ -13218,21 +13298,21 @@ function _extends38() {
|
|
13218
13298
|
}
|
13219
13299
|
return target;
|
13220
13300
|
};
|
13221
|
-
return
|
13301
|
+
return _extends40.apply(this, arguments);
|
13222
13302
|
}
|
13223
|
-
__name(
|
13303
|
+
__name(_extends40, "_extends");
|
13224
13304
|
var VulcanCurrentUserProvider = /* @__PURE__ */ __name((_a) => {
|
13225
13305
|
var _b = _a, { value } = _b, props = __objRest(_b, ["value"]);
|
13226
|
-
return /* @__PURE__ */
|
13306
|
+
return /* @__PURE__ */ React67.createElement(VulcanCurrentUserContext.Provider, _extends40({
|
13227
13307
|
value
|
13228
13308
|
}, props));
|
13229
13309
|
}, "VulcanCurrentUserProvider");
|
13230
13310
|
|
13231
13311
|
// componentsHelpers.tsx
|
13232
13312
|
init_esm_shims();
|
13233
|
-
import
|
13234
|
-
function
|
13235
|
-
|
13313
|
+
import React68 from "react";
|
13314
|
+
function _extends41() {
|
13315
|
+
_extends41 = Object.assign || function(target) {
|
13236
13316
|
for (var i = 1; i < arguments.length; i++) {
|
13237
13317
|
var source = arguments[i];
|
13238
13318
|
for (var key in source) {
|
@@ -13243,9 +13323,9 @@ function _extends39() {
|
|
13243
13323
|
}
|
13244
13324
|
return target;
|
13245
13325
|
};
|
13246
|
-
return
|
13326
|
+
return _extends41.apply(this, arguments);
|
13247
13327
|
}
|
13248
|
-
__name(
|
13328
|
+
__name(_extends41, "_extends");
|
13249
13329
|
var Components = {};
|
13250
13330
|
var ComponentsTable = {};
|
13251
13331
|
var coreComponents = [
|
@@ -13284,16 +13364,16 @@ var getRawComponent = /* @__PURE__ */ __name((name2) => {
|
|
13284
13364
|
var instantiateComponent = /* @__PURE__ */ __name((component, props) => {
|
13285
13365
|
if (!component) {
|
13286
13366
|
return null;
|
13287
|
-
} else if (/* @__PURE__ */
|
13288
|
-
return /* @__PURE__ */
|
13367
|
+
} else if (/* @__PURE__ */ React68.isValidElement(component)) {
|
13368
|
+
return /* @__PURE__ */ React68.cloneElement(component, props);
|
13289
13369
|
} else if (typeof component === "function" && component.prototype && component.prototype.isReactComponent) {
|
13290
13370
|
const Component = component;
|
13291
|
-
return /* @__PURE__ */
|
13371
|
+
return /* @__PURE__ */ React68.createElement(Component, _extends41({}, props));
|
13292
13372
|
} else if (typeof component === "function") {
|
13293
13373
|
return component(props);
|
13294
13374
|
} else if (typeof component === "object" && component.$$typeof && component.render) {
|
13295
13375
|
const Component = component;
|
13296
|
-
return /* @__PURE__ */
|
13376
|
+
return /* @__PURE__ */ React68.createElement(Component, _extends41({}, props));
|
13297
13377
|
} else {
|
13298
13378
|
return component;
|
13299
13379
|
}
|
@@ -13301,7 +13381,7 @@ var instantiateComponent = /* @__PURE__ */ __name((component, props) => {
|
|
13301
13381
|
var delayedComponent = /* @__PURE__ */ __name((name2) => {
|
13302
13382
|
return (props) => {
|
13303
13383
|
const Component = Components[name2] || null;
|
13304
|
-
return Component && /* @__PURE__ */
|
13384
|
+
return Component && /* @__PURE__ */ React68.createElement(Component, _extends41({}, props));
|
13305
13385
|
};
|
13306
13386
|
}, "delayedComponent");
|
13307
13387
|
var mergeWithComponents = /* @__PURE__ */ __name((myComponents) => myComponents ? __spreadValues(__spreadValues({}, Components), myComponents) : Components, "mergeWithComponents");
|