@vulcanjs/react-ui 0.6.8-alpha.4 → 0.6.9-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/components/VulcanComponents/Consumer.d.ts.map +0 -0
  2. package/dist/components/VulcanComponents/Context.d.ts.map +0 -0
  3. package/dist/components/VulcanComponents/Dummy.d.ts.map +0 -0
  4. package/dist/components/VulcanComponents/Provider.d.ts.map +0 -0
  5. package/dist/components/VulcanComponents/defaultVulcanComponents/index.d.ts.map +0 -0
  6. package/dist/components/VulcanComponents/index.d.ts.map +0 -0
  7. package/dist/components/VulcanComponents/typings.d.ts.map +0 -0
  8. package/dist/components/VulcanCurrentUser/Consumer.d.ts.map +0 -0
  9. package/dist/components/VulcanCurrentUser/Context.d.ts.map +0 -0
  10. package/dist/components/VulcanCurrentUser/Provider.d.ts.map +0 -0
  11. package/dist/components/VulcanCurrentUser/index.d.ts.map +0 -0
  12. package/dist/components/core/LoadingButton.d.ts.map +0 -0
  13. package/dist/components/core/MutationButton.d.ts.map +0 -0
  14. package/dist/components/core/index.d.ts.map +0 -0
  15. package/dist/components/core/typings.d.ts.map +0 -0
  16. package/dist/components/form/core/Form/Form.d.ts.map +1 -1
  17. package/dist/components/form/core/Form/fields.d.ts.map +0 -0
  18. package/dist/components/form/core/Form/index.d.ts.map +0 -0
  19. package/dist/components/form/core/Form/typings.d.ts.map +0 -0
  20. package/dist/components/form/core/Form/utils.d.ts.map +0 -0
  21. package/dist/components/form/core/FormContainer.d.ts.map +0 -0
  22. package/dist/components/form/core/FormContext.d.ts +1 -0
  23. package/dist/components/form/core/FormContext.d.ts.map +1 -1
  24. package/dist/components/form/core/index.d.ts.map +0 -0
  25. package/dist/components/form/hooks/useBlockTransition/block.d.ts.map +0 -0
  26. package/dist/components/form/hooks/useBlockTransition/useBlockTransition.d.ts.map +0 -0
  27. package/dist/components/form/hooks/useWarnOnUnsaved/index.d.ts.map +0 -0
  28. package/dist/components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.d.ts.map +0 -0
  29. package/dist/components/form/index.d.ts.map +0 -0
  30. package/dist/components/form/typings.d.ts.map +0 -0
  31. package/dist/components/form/utils/formFragments.d.ts.map +0 -0
  32. package/dist/components/form/utils/index.d.ts.map +0 -0
  33. package/dist/components/form/utils/path_utils.d.ts.map +0 -0
  34. package/dist/components/form/utils/schema_utils.d.ts.map +0 -0
  35. package/dist/components/form/utils/ui_utils.d.ts.map +0 -0
  36. package/dist/components/form/utils/utils.d.ts.map +0 -0
  37. package/dist/componentsHelpers.d.ts.map +0 -0
  38. package/dist/index.d.ts.map +0 -0
  39. package/dist/index.js +3 -78
  40. package/dist/index.js.map +1 -1
  41. package/dist/testing/ExpectedErrorBoundary.d.ts.map +0 -0
  42. package/dist/testing.d.ts.map +0 -0
  43. package/dist/testing.js +0 -0
  44. package/dist/testing.js.map +0 -0
  45. package/package.json +7 -7
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../components/form/core/Form/Form.tsx"],"names":[],"mappings":"AAmDA,OAAO,EAEL,SAAS,EAGV,MAAM,WAAW,CAAC;AA+PnB,eAAO,MAAM,IAAI,UAAW,SAAS,QA+hBpC,CAAC;AAeF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../components/form/core/Form/Form.tsx"],"names":[],"mappings":"AAmDA,OAAO,EAEL,SAAS,EAGV,MAAM,WAAW,CAAC;AA+PnB,eAAO,MAAM,IAAI,UAAW,SAAS,QAgiBpC,CAAC;AAeF,eAAe,IAAI,CAAC"}
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -18,6 +18,7 @@ interface FormContextValue {
18
18
  submitForm: Function;
19
19
  throwError: Function;
20
20
  updateCurrentValues: Function;
21
+ disabled: boolean;
21
22
  }
22
23
  export declare const FormContext: React.Context<FormContextValue | undefined>;
23
24
  export declare const useFormContext: () => FormContextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["../../../../components/form/core/FormContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,UAAU,gBAAgB;IACxB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,eAAe,EAAE,QAAQ,CAAC;IAC1B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,SAAS,EAAE,QAAQ,CAAC;IACpB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,WAAW,EAAE,QAAQ,CAAC;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,QAAQ,CAAC;IAItB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,mBAAmB,EAAE,QAAQ,CAAC;CAC/B;AAED,eAAO,MAAM,WAAW,6CACsC,CAAC;AAE/D,eAAO,MAAM,cAAc,wBAS1B,CAAC"}
1
+ {"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["../../../../components/form/core/FormContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,UAAU,gBAAgB;IACxB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,eAAe,EAAE,QAAQ,CAAC;IAC1B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,SAAS,EAAE,QAAQ,CAAC;IACpB,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,gBAAgB,EAAE,QAAQ,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,WAAW,EAAE,QAAQ,CAAC;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,QAAQ,CAAC;IAItB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,QAAQ,CAAC;IACrB,mBAAmB,EAAE,QAAQ,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,6CAEvB,CAAC;AAEF,eAAO,MAAM,cAAc,wBAS1B,CAAC"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.js CHANGED
@@ -34,9 +34,6 @@ var __objRest = (source, exclude) => {
34
34
  }
35
35
  return target;
36
36
  };
37
- var __esm = (fn, res) => function __init() {
38
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
39
- };
40
37
  var __commonJS = (cb, mod) => function __require() {
41
38
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
42
39
  };
@@ -54,16 +51,9 @@ var __copyProps = (to, from, except, desc) => {
54
51
  };
55
52
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
56
53
 
57
- // ../../node_modules/tsup/assets/esm_shims.js
58
- var init_esm_shims = __esm({
59
- "../../node_modules/tsup/assets/esm_shims.js"() {
60
- }
61
- });
62
-
63
54
  // ../../node_modules/tslib/tslib.js
64
55
  var require_tslib = __commonJS({
65
56
  "../../node_modules/tslib/tslib.js"(exports, module) {
66
- init_esm_shims();
67
57
  var __extends2;
68
58
  var __assign2;
69
59
  var __rest2;
@@ -576,27 +566,17 @@ var require_tslib = __commonJS({
576
566
  }
577
567
  });
578
568
 
579
- // index.ts
580
- init_esm_shims();
581
-
582
- // components/core/index.ts
583
- init_esm_shims();
584
-
585
569
  // components/core/LoadingButton.tsx
586
- init_esm_shims();
587
570
  import React4 from "react";
588
571
 
589
572
  // components/VulcanComponents/Consumer.tsx
590
- init_esm_shims();
591
573
  import { deprecate } from "@vulcanjs/utils";
592
574
  import React3, { useContext } from "react";
593
575
 
594
576
  // components/VulcanComponents/Context.ts
595
- init_esm_shims();
596
577
  import React2 from "react";
597
578
 
598
579
  // components/VulcanComponents/Dummy.tsx
599
- init_esm_shims();
600
580
  import React from "react";
601
581
  var Dummy = /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement("span", null, "You have not setup VulcanComponentsProvider. Please add following code in your app:", " ", /* @__PURE__ */ React.createElement("code", null, `import { VulcanComponentsProvider } from "@vulcanjs/react-ui"; const YourApp = <VulcanComponentsProvider>{/* your app */}</VulcanComponentsProvider>;}`)), "Dummy");
602
582
 
@@ -694,15 +674,10 @@ var LoadingButton = /* @__PURE__ */ __name((_a) => {
694
674
  }, "LoadingButton");
695
675
 
696
676
  // components/core/MutationButton.tsx
697
- init_esm_shims();
698
677
  import React5, { useState } from "react";
699
678
  import { useMutation } from "@apollo/client";
700
679
 
701
- // ../../node_modules/graphql-tag/lib/index.js
702
- init_esm_shims();
703
-
704
680
  // ../../node_modules/tslib/modules/index.js
705
- init_esm_shims();
706
681
  var import_tslib = __toESM(require_tslib(), 1);
707
682
  var { __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __createBinding, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn } = import_tslib.default;
708
683
 
@@ -911,14 +886,7 @@ var MutationButton = /* @__PURE__ */ __name((props) => {
911
886
  return loadingButton;
912
887
  }, "MutationButton");
913
888
 
914
- // components/core/typings.ts
915
- init_esm_shims();
916
-
917
- // components/form/index.ts
918
- init_esm_shims();
919
-
920
889
  // components/form/core/FormContext.tsx
921
- init_esm_shims();
922
890
  import React6, { useContext as useContext2 } from "react";
923
891
  var FormContext = /* @__PURE__ */ React6.createContext(void 0);
924
892
  var useFormContext = /* @__PURE__ */ __name(() => {
@@ -930,11 +898,7 @@ var useFormContext = /* @__PURE__ */ __name(() => {
930
898
  return formContext;
931
899
  }, "useFormContext");
932
900
 
933
- // components/form/core/Form/index.ts
934
- init_esm_shims();
935
-
936
901
  // components/form/core/Form/Form.tsx
937
- init_esm_shims();
938
902
  import React7, { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
939
903
  import { runCallbacks, getErrors } from "@vulcanjs/core";
940
904
  import { useIntlContext as useIntlContext2 } from "@vulcanjs/react-i18n";
@@ -968,7 +932,6 @@ __export(schema_utils_exports, {
968
932
  getValidFields: () => getValidFields,
969
933
  schemaProperties: () => schemaProperties
970
934
  });
971
- init_esm_shims();
972
935
  import { canCreateField, canUpdateField } from "@vulcanjs/permissions";
973
936
 
974
937
  // components/form/utils/utils.ts
@@ -983,7 +946,6 @@ __export(utils_exports, {
983
946
  isEmptyValue: () => isEmptyValue,
984
947
  mergeValue: () => mergeValue
985
948
  });
986
- init_esm_shims();
987
949
  import merge from "lodash/merge.js";
988
950
  import find from "lodash/find.js";
989
951
  import isPlainObject from "lodash/isPlainObject.js";
@@ -999,7 +961,6 @@ __export(path_utils_exports, {
999
961
  removePrefix: () => removePrefix,
1000
962
  splitPath: () => splitPath
1001
963
  });
1002
- init_esm_shims();
1003
964
  import toPath from "lodash/toPath.js";
1004
965
  import initial from "lodash/initial.js";
1005
966
  import flow from "lodash/fp/flow.js";
@@ -1264,7 +1225,6 @@ var formProperties = [
1264
1225
  ];
1265
1226
 
1266
1227
  // components/form/core/Form/fields.ts
1267
- init_esm_shims();
1268
1228
  import uniq from "lodash/uniq.js";
1269
1229
  import compact from "lodash/compact.js";
1270
1230
  import get from "lodash/get.js";
@@ -1487,7 +1447,6 @@ var getFieldGroups = /* @__PURE__ */ __name((props, state, context, mutableField
1487
1447
  }, "getFieldGroups");
1488
1448
 
1489
1449
  // components/form/core/Form/utils.ts
1490
- init_esm_shims();
1491
1450
  import find2 from "lodash/find.js";
1492
1451
  import isEqualWith from "lodash/isEqualWith.js";
1493
1452
  var isNotSameDocument = /* @__PURE__ */ __name((initialDocument, changedDocument) => {
@@ -1500,18 +1459,10 @@ var isNotSameDocument = /* @__PURE__ */ __name((initialDocument, changedDocument
1500
1459
  return typeof changedValue !== "undefined";
1501
1460
  }, "isNotSameDocument");
1502
1461
 
1503
- // components/form/hooks/useWarnOnUnsaved/index.ts
1504
- init_esm_shims();
1505
-
1506
- // components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.ts
1507
- init_esm_shims();
1508
-
1509
1462
  // components/form/hooks/useBlockTransition/useBlockTransition.ts
1510
- init_esm_shims();
1511
1463
  import { useEffect, useRef } from "react";
1512
1464
 
1513
1465
  // components/form/hooks/useBlockTransition/block.ts
1514
- init_esm_shims();
1515
1466
  import debug from "debug";
1516
1467
  var debugTransitions = debug("vn:route-transition");
1517
1468
  var BeforeUnloadEventType = "beforeunload";
@@ -1867,7 +1818,7 @@ var Form = /* @__PURE__ */ __name((props) => {
1867
1818
  props.refetch();
1868
1819
  }
1869
1820
  }, "refetchForm");
1870
- const [disabled, setDisabled] = useState2(false);
1821
+ const [disabled, setDisabled] = useState2(!!props.disabled);
1871
1822
  const [success, setSuccess] = useState2(false);
1872
1823
  const clearForm = /* @__PURE__ */ __name((options = {}) => {
1873
1824
  const { document: optionsDocument } = options;
@@ -2053,7 +2004,8 @@ var Form = /* @__PURE__ */ __name((props) => {
2053
2004
  errors,
2054
2005
  currentValues,
2055
2006
  deletedValues,
2056
- clearFieldErrors
2007
+ clearFieldErrors,
2008
+ disabled
2057
2009
  }
2058
2010
  }, /* @__PURE__ */ React7.createElement(FormComponents.FormLayout, _extends4({}, formLayoutProps), getFieldGroups(props, {
2059
2011
  currentDocument,
@@ -2065,11 +2017,7 @@ var Form = /* @__PURE__ */ __name((props) => {
2065
2017
  }, formGroupProps(group)))))));
2066
2018
  }, "Form");
2067
2019
 
2068
- // components/form/core/Form/typings.ts
2069
- init_esm_shims();
2070
-
2071
2020
  // components/form/core/FormContainer.tsx
2072
- init_esm_shims();
2073
2021
  import React10 from "react";
2074
2022
 
2075
2023
  // components/form/utils/formFragments.ts
@@ -2077,7 +2025,6 @@ var formFragments_exports = {};
2077
2025
  __export(formFragments_exports, {
2078
2026
  default: () => formFragments_default
2079
2027
  });
2080
- init_esm_shims();
2081
2028
  import _uniq from "lodash/uniq.js";
2082
2029
  import _intersection from "lodash/intersection.js";
2083
2030
  import { getCreateableFields, getUpdateableFields, getFragmentFieldNames } from "@vulcanjs/schema";
@@ -2224,15 +2171,10 @@ import { capitalize as capitalize3 } from "@vulcanjs/utils";
2224
2171
  import { useSingle, useCreate, useUpdate, useDelete } from "@vulcanjs/react-hooks";
2225
2172
  import { debugVulcan } from "@vulcanjs/utils";
2226
2173
 
2227
- // components/VulcanCurrentUser/index.ts
2228
- init_esm_shims();
2229
-
2230
2174
  // components/VulcanCurrentUser/Consumer.tsx
2231
- init_esm_shims();
2232
2175
  import { useContext as useContext3 } from "react";
2233
2176
 
2234
2177
  // components/VulcanCurrentUser/Context.ts
2235
- init_esm_shims();
2236
2178
  import React8 from "react";
2237
2179
  var VulcanCurrentUserContext = React8.createContext({
2238
2180
  currentUser: null,
@@ -2244,7 +2186,6 @@ var VulcanCurrentUserConsumer = VulcanCurrentUserContext.Consumer;
2244
2186
  var useVulcanCurrentUser = /* @__PURE__ */ __name(() => useContext3(VulcanCurrentUserContext), "useVulcanCurrentUser");
2245
2187
 
2246
2188
  // components/VulcanCurrentUser/Provider.tsx
2247
- init_esm_shims();
2248
2189
  import React9 from "react";
2249
2190
  function _extends5() {
2250
2191
  _extends5 = Object.assign || function(target) {
@@ -2421,16 +2362,12 @@ var FormContainer = /* @__PURE__ */ __name((props) => {
2421
2362
  }, "FormContainer");
2422
2363
  var SmartForm = FormContainer;
2423
2364
 
2424
- // components/form/utils/index.ts
2425
- init_esm_shims();
2426
-
2427
2365
  // components/form/utils/ui_utils.ts
2428
2366
  var ui_utils_exports = {};
2429
2367
  __export(ui_utils_exports, {
2430
2368
  getHtmlInputProps: () => getHtmlInputProps,
2431
2369
  whitelistInputProps: () => whitelistInputProps
2432
2370
  });
2433
- init_esm_shims();
2434
2371
  import pick3 from "lodash/pick.js";
2435
2372
  var getHtmlInputProps = /* @__PURE__ */ __name((props) => {
2436
2373
  const { name, path, options, label, onChange, onBlur, value, disabled } = props;
@@ -2469,11 +2406,7 @@ var whitelistInputProps = /* @__PURE__ */ __name((props) => {
2469
2406
  });
2470
2407
  }, "whitelistInputProps");
2471
2408
 
2472
- // components/VulcanComponents/index.ts
2473
- init_esm_shims();
2474
-
2475
2409
  // components/VulcanComponents/Provider.tsx
2476
- init_esm_shims();
2477
2410
  import React11 from "react";
2478
2411
  import { debugVulcan as debugVulcan2 } from "@vulcanjs/utils";
2479
2412
  function _extends7() {
@@ -2514,15 +2447,8 @@ var VulcanComponentsProvider = /* @__PURE__ */ __name((_a) => {
2514
2447
  }, "VulcanComponentsProvider");
2515
2448
 
2516
2449
  // components/VulcanComponents/typings.ts
2517
- init_esm_shims();
2518
2450
  import React12 from "react";
2519
2451
 
2520
- // components/VulcanComponents/defaultVulcanComponents/index.ts
2521
- init_esm_shims();
2522
-
2523
- // components/form/core/index.ts
2524
- init_esm_shims();
2525
-
2526
2452
  // components/VulcanComponents/defaultVulcanComponents/index.ts
2527
2453
  var defaultFormComponents = {
2528
2454
  Form,
@@ -2536,7 +2462,6 @@ var defaultCoreComponents = {
2536
2462
  };
2537
2463
 
2538
2464
  // componentsHelpers.tsx
2539
- init_esm_shims();
2540
2465
  import React13 from "react";
2541
2466
  function _extends8() {
2542
2467
  _extends8 = Object.assign || function(target) {