@vulcanjs/react-ui 0.6.3 → 0.6.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ export declare const makeAutocomplete: (field: any, options: {
2
+ autocompletePropertyName: string;
3
+ fragmentName?: string;
4
+ valuePropertyName?: string;
5
+ multi?: boolean;
6
+ queryResolverName?: string;
7
+ }) => any;
8
+ //# sourceMappingURL=autocomplete.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from "./likert";
2
+ export * from "./checkboxgroup";
3
+ export * from "./radiogroup";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from "./components/form";
2
2
  export * from "./components/VulcanComponents";
3
3
  export * from "./components/VulcanCurrentUser";
4
4
  export * from "./componentsHelpers";
5
+ export * from "./decorators";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AAEpC,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1528,7 +1528,7 @@ var require_GraphQLError = __commonJS({
1528
1528
  },
1529
1529
  {
1530
1530
  key: _symbols.SYMBOL_TO_STRING_TAG,
1531
- get: /* @__PURE__ */ __name(function get5() {
1531
+ get: /* @__PURE__ */ __name(function get7() {
1532
1532
  return "Object";
1533
1533
  }, "get")
1534
1534
  }
@@ -2038,7 +2038,7 @@ var require_source = __commonJS({
2038
2038
  _createClass(Source1, [
2039
2039
  {
2040
2040
  key: _symbols.SYMBOL_TO_STRING_TAG,
2041
- get: /* @__PURE__ */ __name(function get5() {
2041
+ get: /* @__PURE__ */ __name(function get7() {
2042
2042
  return "Source";
2043
2043
  }, "get")
2044
2044
  }
@@ -4183,15 +4183,15 @@ var require_moment = __commonJS({
4183
4183
  hooks.updateOffset(this, keepTime);
4184
4184
  return this;
4185
4185
  } else {
4186
- return get5(this, unit);
4186
+ return get7(this, unit);
4187
4187
  }
4188
4188
  };
4189
4189
  }
4190
4190
  __name(makeGetSet, "makeGetSet");
4191
- function get5(mom, unit) {
4191
+ function get7(mom, unit) {
4192
4192
  return mom.isValid() ? mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]() : NaN;
4193
4193
  }
4194
- __name(get5, "get");
4194
+ __name(get7, "get");
4195
4195
  function set$1(mom, unit, value) {
4196
4196
  if (mom.isValid() && !isNaN(value)) {
4197
4197
  if (unit === "FullYear" && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
@@ -4467,7 +4467,7 @@ var require_moment = __commonJS({
4467
4467
  hooks.updateOffset(this, true);
4468
4468
  return this;
4469
4469
  } else {
4470
- return get5(this, "Month");
4470
+ return get7(this, "Month");
4471
4471
  }
4472
4472
  }
4473
4473
  __name(getSetMonth, "getSetMonth");
@@ -6345,10 +6345,10 @@ var require_moment = __commonJS({
6345
6345
  }
6346
6346
  updateOffset = updateOffset == null ? true : updateOffset;
6347
6347
  if (months) {
6348
- setMonth(mom, get5(mom, "Month") + months * isAdding);
6348
+ setMonth(mom, get7(mom, "Month") + months * isAdding);
6349
6349
  }
6350
6350
  if (days) {
6351
- set$1(mom, "Date", get5(mom, "Date") + days * isAdding);
6351
+ set$1(mom, "Date", get7(mom, "Date") + days * isAdding);
6352
6352
  }
6353
6353
  if (milliseconds) {
6354
6354
  mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
@@ -12937,6 +12937,74 @@ var delayedComponent = /* @__PURE__ */ __name((name) => {
12937
12937
  };
12938
12938
  }, "delayedComponent");
12939
12939
  var mergeWithComponents = /* @__PURE__ */ __name((myComponents) => myComponents ? __spreadValues(__spreadValues({}, Components), myComponents) : Components, "mergeWithComponents");
12940
+
12941
+ // decorators/index.ts
12942
+ init_esm_shims();
12943
+
12944
+ // decorators/likert.js
12945
+ init_esm_shims();
12946
+ import SimpleSchema3 from "simpl-schema";
12947
+ var makeLikert = /* @__PURE__ */ __name((field = {}) => {
12948
+ const { canRead, canCreate, canUpdate } = field;
12949
+ const fieldOptions = field.options;
12950
+ if (!fieldOptions) {
12951
+ throw new Error(`Likert fields need an 'options' property`);
12952
+ }
12953
+ const typeObject = {};
12954
+ fieldOptions.forEach(({ value }) => {
12955
+ typeObject[value] = {
12956
+ type: SimpleSchema3.Integer,
12957
+ canRead,
12958
+ canCreate,
12959
+ canUpdate
12960
+ };
12961
+ });
12962
+ const likertField = __spreadProps(__spreadValues({}, field), {
12963
+ type: new SimpleSchema3(typeObject),
12964
+ input: "likert"
12965
+ });
12966
+ return likertField;
12967
+ }, "makeLikert");
12968
+
12969
+ // decorators/checkboxgroup.js
12970
+ init_esm_shims();
12971
+ import get5 from "lodash/get";
12972
+ var makeCheckboxgroup = /* @__PURE__ */ __name((field = {}) => {
12973
+ const hasOther = !!get5(field, "itemProperties.showOther");
12974
+ if (!field.options) {
12975
+ throw new Error(`Checkboxgroup fields need an 'options' property`);
12976
+ }
12977
+ const cbgField = __spreadProps(__spreadValues({}, field), {
12978
+ type: Array,
12979
+ input: "checkboxgroup"
12980
+ });
12981
+ if (!hasOther) {
12982
+ cbgField.arrayItem = __spreadProps(__spreadValues({}, cbgField.arrayItem), {
12983
+ allowedValues: field.options.map(({ value }) => value)
12984
+ });
12985
+ }
12986
+ return cbgField;
12987
+ }, "makeCheckboxgroup");
12988
+
12989
+ // decorators/radiogroup.js
12990
+ init_esm_shims();
12991
+ import get6 from "lodash/get";
12992
+ var makeRadiogroup = /* @__PURE__ */ __name((field = {}) => {
12993
+ const hasOther = !!get6(field, "itemProperties.showOther");
12994
+ if (!field.options) {
12995
+ throw new Error(`Radiogroup fields need an 'options' property`);
12996
+ }
12997
+ const rgField = __spreadProps(__spreadValues({}, field), {
12998
+ type: Array,
12999
+ input: "radiogroup"
13000
+ });
13001
+ if (!hasOther) {
13002
+ rgField.arrayItem = __spreadProps(__spreadValues({}, rgField.arrayItem), {
13003
+ allowedValues: field.options.map(({ value }) => value)
13004
+ });
13005
+ }
13006
+ return rgField;
13007
+ }, "makeRadiogroup");
12940
13008
  export {
12941
13009
  Components,
12942
13010
  ComponentsTable,
@@ -12954,6 +13022,9 @@ export {
12954
13022
  delayedComponent,
12955
13023
  getRawComponent,
12956
13024
  instantiateComponent,
13025
+ makeCheckboxgroup,
13026
+ makeLikert,
13027
+ makeRadiogroup,
12957
13028
  mergeWithComponents,
12958
13029
  useFormContext,
12959
13030
  useVulcanComponents,