@uniformdev/mesh-sdk-react 19.147.0 → 19.147.1-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -75,6 +75,7 @@ __export(src_exports, {
75
75
  LinkButton: () => LinkButton,
76
76
  LoadingIndicator: () => import_design_system53.LoadingIndicator,
77
77
  LoadingOverlay: () => import_design_system53.LoadingOverlay,
78
+ MULTI_SELECT_OPERATORS: () => MULTI_SELECT_OPERATORS,
78
79
  Menu: () => import_design_system53.Menu,
79
80
  MenuItem: () => import_design_system53.MenuItem,
80
81
  MeshApp: () => MeshApp,
@@ -129,6 +130,7 @@ __export(src_exports, {
129
130
  RequestUrl: () => RequestUrl,
130
131
  RequestUrlInput: () => RequestUrlInput,
131
132
  ResolvableLoadingValue: () => ResolvableLoadingValue,
133
+ SELECT_OPERATORS: () => SELECT_OPERATORS,
132
134
  SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
133
135
  SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
134
136
  ScrollableList: () => import_design_system53.ScrollableList,
@@ -244,6 +246,7 @@ __export(src_exports, {
244
246
  useVariableEditor: () => useVariableEditor,
245
247
  useVariables: () => useVariables,
246
248
  useVariablesMenu: () => useVariablesMenu,
249
+ utilityColors: () => import_design_system53.utilityColors,
247
250
  variableDefaultTextValue: () => variableDefaultTextValue,
248
251
  variablePrefix: () => variablePrefix,
249
252
  variableSuffix: () => variableSuffix,
@@ -4410,6 +4413,7 @@ var input = import_react42.css`
4410
4413
  var inputCompact = import_react42.css`
4411
4414
  border: 1px solid var(--white);
4412
4415
  padding-block: var(--spacing-sm);
4416
+ min-height: 39px;
4413
4417
  font-size: var(--fs-sm);
4414
4418
  `;
4415
4419
  var inputDisabled = import_react42.css`
@@ -4419,14 +4423,14 @@ var inputDisabled = import_react42.css`
4419
4423
  var placeholderCaption = import_react42.css`
4420
4424
  position: absolute;
4421
4425
  color: var(--gray-400);
4422
- inset: var(--spacing-base) var(--spacing-lg) var(--spacing-base) var(--spacing-base);
4426
+ inset: 12px var(--spacing-base) 12px var(--spacing-sm);
4423
4427
  overflow: hidden;
4424
4428
  text-overflow: ellipsis;
4425
4429
  white-space: nowrap;
4426
4430
  pointer-events: none;
4427
4431
  `;
4428
4432
  var placeholderCompact = import_react42.css`
4429
- inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-base);
4433
+ inset: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
4430
4434
  `;
4431
4435
 
4432
4436
  // src/components/Variables/styles/ParameterVariables.styles.ts
@@ -5065,6 +5069,7 @@ function InputVariables(props) {
5065
5069
  align: "center",
5066
5070
  gap: "xs",
5067
5071
  css: import_react51.css`
5072
+ position: relative;
5068
5073
  & > div:first-child {
5069
5074
  flex-grow: 1;
5070
5075
  }
@@ -5195,7 +5200,8 @@ function ParameterConnectionIndicator({
5195
5200
  value,
5196
5201
  menuOptions,
5197
5202
  disabled,
5198
- menuTooltip = "Insert variable"
5203
+ menuTooltip = "Insert variable",
5204
+ overrideMenuButtonParentMargin
5199
5205
  }) {
5200
5206
  const hasVariablesInValue = (0, import_react53.useMemo)(() => {
5201
5207
  let result = false;
@@ -5216,13 +5222,21 @@ function ParameterConnectionIndicator({
5216
5222
  placement: "bottom-start",
5217
5223
  withoutPortal: true,
5218
5224
  menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5219
- "button",
5225
+ "div",
5220
5226
  {
5221
- title: menuTooltip,
5222
- "aria-pressed": hasVariablesInValue,
5223
- css: [menuBtn, variableBindButton],
5224
- type: "button",
5225
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_CgUsbC2.CgUsbC, { size: "1.4rem" })
5227
+ css: overrideMenuButtonParentMargin ? {
5228
+ marginBottom: overrideMenuButtonParentMargin
5229
+ } : void 0,
5230
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
5231
+ "button",
5232
+ {
5233
+ title: menuTooltip,
5234
+ "aria-pressed": hasVariablesInValue,
5235
+ css: [menuBtn, variableBindButton],
5236
+ type: "button",
5237
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_CgUsbC2.CgUsbC, { size: "1.4rem" })
5238
+ }
5239
+ )
5226
5240
  }
5227
5241
  ),
5228
5242
  menuLabel: menuTooltip,
@@ -5946,8 +5960,11 @@ function RequestHeaders({
5946
5960
  }
5947
5961
  ) : null }),
5948
5962
  addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system28.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
5949
- import_design_system28.Input,
5963
+ import_design_system28.InputToggle,
5950
5964
  {
5965
+ label: "Omit if empty",
5966
+ showLabel: false,
5967
+ name: "omitIfEmpty",
5951
5968
  type: "checkbox",
5952
5969
  checked: header.omitIfEmpty,
5953
5970
  "data-testid": "header-omitifempty",
@@ -6074,8 +6091,11 @@ function RequestParameters({
6074
6091
  }
6075
6092
  ) : null }),
6076
6093
  addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
6077
- import_design_system30.Input,
6094
+ import_design_system30.InputToggle,
6078
6095
  {
6096
+ label: "Omit if empty",
6097
+ showLabel: false,
6098
+ name: "omitIfEmpty",
6079
6099
  type: "checkbox",
6080
6100
  checked: parameter.omitIfEmpty,
6081
6101
  "data-testid": "parameter-omitifempty",
@@ -7488,7 +7508,7 @@ var NUMBER_OPERATORS = [
7488
7508
  ];
7489
7509
  var DATE_OPERATORS = [
7490
7510
  {
7491
- label: "is...",
7511
+ label: "is",
7492
7512
  value: "eq",
7493
7513
  editorType: "date"
7494
7514
  },
@@ -7523,7 +7543,7 @@ var DATE_OPERATORS = [
7523
7543
  editorType: "empty"
7524
7544
  },
7525
7545
  {
7526
- label: "is not...",
7546
+ label: "is not",
7527
7547
  value: "neq",
7528
7548
  editorType: "date"
7529
7549
  },
@@ -7535,7 +7555,12 @@ var DATE_OPERATORS = [
7535
7555
  ];
7536
7556
  var TEXTBOX_OPERATORS = [
7537
7557
  {
7538
- label: "is...",
7558
+ label: "contains...",
7559
+ value: "match",
7560
+ editorType: "text"
7561
+ },
7562
+ {
7563
+ label: "is",
7539
7564
  value: "eq",
7540
7565
  editorType: "text"
7541
7566
  },
@@ -7544,18 +7569,13 @@ var TEXTBOX_OPERATORS = [
7544
7569
  value: "ndef",
7545
7570
  editorType: "empty"
7546
7571
  },
7547
- {
7548
- label: "contains...",
7549
- value: "match",
7550
- editorType: "text"
7551
- },
7552
7572
  {
7553
7573
  label: "starts with...",
7554
7574
  value: "starts",
7555
7575
  editorType: "text"
7556
7576
  },
7557
7577
  {
7558
- label: "is not...",
7578
+ label: "is not",
7559
7579
  value: "neq",
7560
7580
  editorType: "text"
7561
7581
  },
@@ -7567,13 +7587,13 @@ var TEXTBOX_OPERATORS = [
7567
7587
  ];
7568
7588
  var USER_OPERATORS = [
7569
7589
  {
7570
- label: "is...",
7571
- value: "eq",
7590
+ label: "contains...",
7591
+ value: "match",
7572
7592
  editorType: "text"
7573
7593
  },
7574
7594
  {
7575
- label: "contains...",
7576
- value: "match",
7595
+ label: "is",
7596
+ value: "eq",
7577
7597
  editorType: "text"
7578
7598
  },
7579
7599
  {
@@ -7582,14 +7602,14 @@ var USER_OPERATORS = [
7582
7602
  editorType: "text"
7583
7603
  },
7584
7604
  {
7585
- label: "is not...",
7605
+ label: "is not",
7586
7606
  value: "neq",
7587
7607
  editorType: "text"
7588
7608
  }
7589
7609
  ];
7590
7610
  var SYSTEM_DATE_OPERATORS = [
7591
7611
  {
7592
- label: "is...",
7612
+ label: "is",
7593
7613
  value: "sys-date-eq",
7594
7614
  editorType: "date"
7595
7615
  },
@@ -7619,22 +7639,22 @@ var SYSTEM_DATE_OPERATORS = [
7619
7639
  editorType: "date"
7620
7640
  },
7621
7641
  {
7622
- label: "is not...",
7642
+ label: "is not",
7623
7643
  value: "sys-date-neq",
7624
7644
  editorType: "date"
7625
7645
  }
7626
7646
  ];
7627
7647
  var RICHTEXT_OPERATORS = [
7628
- {
7629
- label: "is empty",
7630
- value: "ndef",
7631
- editorType: "empty"
7632
- },
7633
7648
  {
7634
7649
  label: "contains...",
7635
7650
  value: "match",
7636
7651
  editorType: "text"
7637
7652
  },
7653
+ {
7654
+ label: "is empty",
7655
+ value: "ndef",
7656
+ editorType: "empty"
7657
+ },
7638
7658
  {
7639
7659
  label: "starts with...",
7640
7660
  value: "starts",
@@ -7648,19 +7668,19 @@ var RICHTEXT_OPERATORS = [
7648
7668
  ];
7649
7669
  var CHECKBOX_OPERATORS = [
7650
7670
  {
7651
- label: "is checked...",
7671
+ label: "is checked",
7652
7672
  value: "def",
7653
7673
  editorType: "empty"
7654
7674
  },
7655
7675
  {
7656
- label: "is not checked...",
7676
+ label: "is not checked",
7657
7677
  value: "ndef",
7658
7678
  editorType: "empty"
7659
7679
  }
7660
7680
  ];
7661
7681
  var SYSTEM_FIELD_OPERATORS = [
7662
7682
  {
7663
- label: "is...",
7683
+ label: "is",
7664
7684
  value: "eq",
7665
7685
  editorType: "singleChoice"
7666
7686
  },
@@ -7670,7 +7690,7 @@ var SYSTEM_FIELD_OPERATORS = [
7670
7690
  editorType: "multiChoice"
7671
7691
  },
7672
7692
  {
7673
- label: "is not...",
7693
+ label: "is not",
7674
7694
  value: "neq",
7675
7695
  editorType: "singleChoice"
7676
7696
  },
@@ -7682,7 +7702,7 @@ var SYSTEM_FIELD_OPERATORS = [
7682
7702
  ];
7683
7703
  var PUBLISH_STATUS_FIELD_OPERATORS = [
7684
7704
  {
7685
- label: "is...",
7705
+ label: "is",
7686
7706
  value: "eq",
7687
7707
  editorType: "statusSingleChoice"
7688
7708
  },
@@ -7692,7 +7712,7 @@ var PUBLISH_STATUS_FIELD_OPERATORS = [
7692
7712
  editorType: "statusMultiChoice"
7693
7713
  },
7694
7714
  {
7695
- label: "is not...",
7715
+ label: "is not",
7696
7716
  value: "neq",
7697
7717
  editorType: "statusSingleChoice"
7698
7718
  },
@@ -7702,6 +7722,80 @@ var PUBLISH_STATUS_FIELD_OPERATORS = [
7702
7722
  editorType: "statusMultiChoice"
7703
7723
  }
7704
7724
  ];
7725
+ var SELECT_OPERATORS = [
7726
+ {
7727
+ label: "is",
7728
+ value: "eq",
7729
+ editorType: "singleChoice"
7730
+ },
7731
+ {
7732
+ label: "is any of...",
7733
+ value: "in",
7734
+ editorType: "multiChoice"
7735
+ },
7736
+ {
7737
+ label: "is empty",
7738
+ value: "ndef",
7739
+ editorType: "empty"
7740
+ },
7741
+ {
7742
+ label: "contains...",
7743
+ value: "match",
7744
+ editorType: "text"
7745
+ },
7746
+ {
7747
+ label: "starts with...",
7748
+ value: "starts",
7749
+ editorType: "text"
7750
+ },
7751
+ {
7752
+ label: "is not",
7753
+ value: "neq",
7754
+ editorType: "singleChoice"
7755
+ },
7756
+ {
7757
+ label: "is none of...",
7758
+ value: "nin",
7759
+ editorType: "multiChoice"
7760
+ },
7761
+ {
7762
+ label: "is not empty",
7763
+ value: "def",
7764
+ editorType: "empty"
7765
+ }
7766
+ ];
7767
+ var MULTI_SELECT_OPERATORS = [
7768
+ {
7769
+ label: "is",
7770
+ value: "eq",
7771
+ editorType: "singleChoice"
7772
+ },
7773
+ {
7774
+ label: "is any of...",
7775
+ value: "in",
7776
+ editorType: "multiChoice"
7777
+ },
7778
+ {
7779
+ label: "is empty",
7780
+ value: "ndef",
7781
+ editorType: "empty"
7782
+ },
7783
+ {
7784
+ label: "is not",
7785
+ value: "neq",
7786
+ editorType: "singleChoice"
7787
+ },
7788
+ {
7789
+ label: "is none of...",
7790
+ value: "nin",
7791
+ editorType: "multiChoice"
7792
+ },
7793
+ {
7794
+ label: "is not empty",
7795
+ value: "def",
7796
+ editorType: "empty"
7797
+ }
7798
+ ];
7705
7799
 
7706
7800
  // src/components/SearchAndFilter/FilterButton.tsx
7707
7801
  var import_design_system42 = require("@uniformdev/design-system");
@@ -8364,7 +8458,8 @@ var DateRangeEditor = ({
8364
8458
  onChange: (e) => setMinDateValue(e.currentTarget.value),
8365
8459
  "aria-invalid": !error ? false : true,
8366
8460
  disabled,
8367
- readOnly
8461
+ readOnly,
8462
+ "data-testid": "value-low"
8368
8463
  }
8369
8464
  ),
8370
8465
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
@@ -8377,7 +8472,8 @@ var DateRangeEditor = ({
8377
8472
  onChange: (e) => setMaxDateValue(e.currentTarget.value),
8378
8473
  "aria-invalid": !error ? false : true,
8379
8474
  disabled,
8380
- readOnly
8475
+ readOnly,
8476
+ "data-testid": "value-high"
8381
8477
  }
8382
8478
  )
8383
8479
  ] }),
@@ -8492,7 +8588,8 @@ var SearchAndFilterContext = (0, import_react78.createContext)({
8492
8588
  filterOptions: [],
8493
8589
  validFilterQuery: [],
8494
8590
  filterMapper: {},
8495
- totalResults: 0
8591
+ totalResults: 0,
8592
+ allowBindingSearchTerm: false
8496
8593
  });
8497
8594
  var SearchAndFilterProvider = ({
8498
8595
  filters,
@@ -8504,7 +8601,8 @@ var SearchAndFilterProvider = ({
8504
8601
  resetFilterValues = [{ field: "", operator: "", value: "" }],
8505
8602
  totalResults,
8506
8603
  filterMapper: filterMapper2 = filterMapper,
8507
- children
8604
+ children,
8605
+ allowBindingSearchTerm
8508
8606
  }) => {
8509
8607
  const [searchTerm, setSearchTerm] = (0, import_react78.useState)(defaultSearchTerm);
8510
8608
  const deferredSearchTerm = (0, import_react78.useDeferredValue)(searchTerm);
@@ -8569,7 +8667,8 @@ var SearchAndFilterProvider = ({
8569
8667
  filterOptions,
8570
8668
  validFilterQuery,
8571
8669
  totalResults,
8572
- filterMapper: filterMapper2
8670
+ filterMapper: filterMapper2,
8671
+ allowBindingSearchTerm
8573
8672
  },
8574
8673
  children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_design_system44.VerticalRhythm, { children })
8575
8674
  }
@@ -8586,7 +8685,14 @@ var FilterControls = ({
8586
8685
  children,
8587
8686
  hideSearchInput
8588
8687
  }) => {
8589
- const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm } = useSearchAndFilter();
8688
+ const {
8689
+ setFilterVisibility,
8690
+ filterVisibility,
8691
+ setSearchTerm,
8692
+ validFilterQuery,
8693
+ searchTerm,
8694
+ allowBindingSearchTerm
8695
+ } = useSearchAndFilter();
8590
8696
  const editorRef = (0, import_react79.useRef)(null);
8591
8697
  const hasVariableInSearchTerm = hasReferencedVariables(searchTerm);
8592
8698
  const [idToResetInputVariables, setIdToResetInputVariables] = (0, import_react79.useState)("data-resource-search-term-input");
@@ -8628,6 +8734,7 @@ var FilterControls = ({
8628
8734
  editorRef,
8629
8735
  value: localeSearchTerm,
8630
8736
  onChange: (value) => setLocaleSearchTerm(value != null ? value : ""),
8737
+ disableVariables: !allowBindingSearchTerm,
8631
8738
  inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
8632
8739
  import_design_system45.InputKeywordSearch,
8633
8740
  {
@@ -8957,7 +9064,7 @@ var SearchAndFilterResultContainer = ({
8957
9064
  onHandleClear,
8958
9065
  hideClearButton
8959
9066
  }) => {
8960
- const { searchTerm, setSearchTerm, totalResults, filters, handleResetFilters } = useSearchAndFilter();
9067
+ const { searchTerm, totalResults, filters, handleResetFilters, setSearchTerm } = useSearchAndFilter();
8961
9068
  const automateCalloutTitle = () => {
8962
9069
  if (searchTerm && !filters.length) {
8963
9070
  return "No search results found";
@@ -8970,6 +9077,14 @@ var SearchAndFilterResultContainer = ({
8970
9077
  if (totalResults && totalResults > 0) {
8971
9078
  return null;
8972
9079
  }
9080
+ const handleClearSearch = () => {
9081
+ setSearchTerm("");
9082
+ if (onHandleClear) {
9083
+ onHandleClear();
9084
+ } else {
9085
+ handleResetFilters();
9086
+ }
9087
+ };
8973
9088
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
8974
9089
  /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_design_system48.HorizontalRhythm, { children: [
8975
9090
  /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { children: [
@@ -8977,11 +9092,11 @@ var SearchAndFilterResultContainer = ({
8977
9092
  " results ",
8978
9093
  searchTerm ? `for "${searchTerm}"` : null
8979
9094
  ] }),
8980
- !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
9095
+ !searchTerm || hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "ghostDestructive", size: "zero", onClick: handleClearSearch, children: clearButtonLabel })
8981
9096
  ] }),
8982
9097
  totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_design_system48.Callout, { title: calloutTitle != null ? calloutTitle : automateCalloutTitle(), type: "note", children: [
8983
9098
  calloutText ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Paragraph, { children: calloutText }) : null,
8984
- hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
9099
+ hideClearButton ? null : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_design_system48.Button, { buttonType: "tertiaryOutline", size: "xs", onClick: handleClearSearch, children: buttonText != null ? buttonText : "Clear search" })
8985
9100
  ] }) : null
8986
9101
  ] });
8987
9102
  };
@@ -9001,6 +9116,7 @@ var SearchAndFilter = ({
9001
9116
  defaultSearchTerm,
9002
9117
  onSearchChange,
9003
9118
  totalResults,
9119
+ allowBindingSearchTerm = false,
9004
9120
  resetFilterValues = []
9005
9121
  }) => {
9006
9122
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
@@ -9015,6 +9131,7 @@ var SearchAndFilter = ({
9015
9131
  totalResults,
9016
9132
  resetFilterValues,
9017
9133
  filterMapper: filterMapper2,
9134
+ allowBindingSearchTerm,
9018
9135
  children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_design_system49.VerticalRhythm, { "data-testid": "search-and-filter", children: [
9019
9136
  /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
9020
9137
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
@@ -9516,6 +9633,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9516
9633
  LinkButton,
9517
9634
  LoadingIndicator,
9518
9635
  LoadingOverlay,
9636
+ MULTI_SELECT_OPERATORS,
9519
9637
  Menu,
9520
9638
  MenuItem,
9521
9639
  MeshApp,
@@ -9570,6 +9688,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9570
9688
  RequestUrl,
9571
9689
  RequestUrlInput,
9572
9690
  ResolvableLoadingValue,
9691
+ SELECT_OPERATORS,
9573
9692
  SYSTEM_DATE_OPERATORS,
9574
9693
  SYSTEM_FIELD_OPERATORS,
9575
9694
  ScrollableList,
@@ -9685,6 +9804,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
9685
9804
  useVariableEditor,
9686
9805
  useVariables,
9687
9806
  useVariablesMenu,
9807
+ utilityColors,
9688
9808
  variableDefaultTextValue,
9689
9809
  variablePrefix,
9690
9810
  variableSuffix,