@uniformdev/mesh-sdk-react 18.30.1-alpha.15 → 18.30.1-alpha.16
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.d.ts +13 -3
- package/dist/index.esm.js +48 -27
- package/dist/index.js +43 -22
- package/dist/index.mjs +48 -27
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -598,7 +598,8 @@ type EntrySearchFilterProps = {
|
|
|
598
598
|
/** sets the select input options */
|
|
599
599
|
selectOptions: Array<{
|
|
600
600
|
id: string;
|
|
601
|
-
name
|
|
601
|
+
name?: string;
|
|
602
|
+
label: string;
|
|
602
603
|
}>;
|
|
603
604
|
/** sets the search input name value
|
|
604
605
|
* @default 'searchText'
|
|
@@ -631,7 +632,7 @@ type SearchQueryProps = {
|
|
|
631
632
|
/** sets the content type in the search context */
|
|
632
633
|
contentType: string | undefined;
|
|
633
634
|
/** sets the keyword search in the search context */
|
|
634
|
-
|
|
635
|
+
keyword?: string;
|
|
635
636
|
};
|
|
636
637
|
type SelectedItemProps = {
|
|
637
638
|
/** sets the id value */
|
|
@@ -832,6 +833,7 @@ type QueryFilterSearchProps = {
|
|
|
832
833
|
type QuertFilterSelectionOptionProps = Array<{
|
|
833
834
|
id: string;
|
|
834
835
|
name: string;
|
|
836
|
+
label: string;
|
|
835
837
|
}>;
|
|
836
838
|
type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = QuertFilterSelectionOptionProps> = {
|
|
837
839
|
/** sets the query filter title
|
|
@@ -870,6 +872,14 @@ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = Q
|
|
|
870
872
|
sortOrderLabel?: string;
|
|
871
873
|
/** sets the sort order select options value */
|
|
872
874
|
sortOrderOptions: TSelectOptions;
|
|
875
|
+
/** sets the search input name value
|
|
876
|
+
* @default 'searchText'
|
|
877
|
+
*/
|
|
878
|
+
searchInputName?: string;
|
|
879
|
+
/** sets the search input placeholder text
|
|
880
|
+
* @default 'Enter keyword to narrow your results'
|
|
881
|
+
*/
|
|
882
|
+
searchInputPlaceholderText?: string;
|
|
873
883
|
/** allows for additional child components, for example more input components */
|
|
874
884
|
children?: ReactNode;
|
|
875
885
|
};
|
|
@@ -877,7 +887,7 @@ type QueryFilterProps<TSelectOptions extends QuertFilterSelectionOptionProps = Q
|
|
|
877
887
|
* @description An opinionated multi query filter UI component, best used for querying product data or more complex scenarios
|
|
878
888
|
* @example <QueryFilter contentTypeOptions={[{ id: 'id', name: 'name' }]} sortOptions={[{ id: 'id', name: 'name' }]} sortOrderOptions={[{ id: 'id', name: 'name' }]} />
|
|
879
889
|
*/
|
|
880
|
-
declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
890
|
+
declare const QueryFilter: ({ requireContentType, queryFilterTitle, contentTypeLabel, typeSelectorAllTypesOptionText, contentTypeOptions, searchInputName, searchInputPlaceholderText, countLabel, countValue, sortLabel, sortOptions, sortOrderLabel, sortOrderOptions, children, }: QueryFilterProps) => _emotion_react_types_jsx_namespace.EmotionJSX.Element;
|
|
881
891
|
|
|
882
892
|
type MeshAppProps = {
|
|
883
893
|
loadingComponent?: React__default.ComponentType;
|
package/dist/index.esm.js
CHANGED
|
@@ -3965,7 +3965,7 @@ var EntrySearchContext = createContext5({
|
|
|
3965
3965
|
},
|
|
3966
3966
|
query: {
|
|
3967
3967
|
contentType: "",
|
|
3968
|
-
|
|
3968
|
+
keyword: ""
|
|
3969
3969
|
},
|
|
3970
3970
|
list: {},
|
|
3971
3971
|
onSetList: () => {
|
|
@@ -3977,7 +3977,7 @@ var EntrySearchContext = createContext5({
|
|
|
3977
3977
|
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
3978
3978
|
const [query, setQuery] = useState9({
|
|
3979
3979
|
contentType: "",
|
|
3980
|
-
|
|
3980
|
+
keyword: ""
|
|
3981
3981
|
});
|
|
3982
3982
|
const querySearchDeferred = useDeferredValue(query);
|
|
3983
3983
|
const [selectedItems, setSelectedItems] = useState9(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
@@ -4068,7 +4068,7 @@ var EntrySearchFilter = ({
|
|
|
4068
4068
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4069
4069
|
const [searchState, setSearchState] = useState10({
|
|
4070
4070
|
contentType: "any",
|
|
4071
|
-
|
|
4071
|
+
keyword: ""
|
|
4072
4072
|
});
|
|
4073
4073
|
const handleFilterChange = (value) => {
|
|
4074
4074
|
setSearchState((prev) => {
|
|
@@ -4086,7 +4086,8 @@ var EntrySearchFilter = ({
|
|
|
4086
4086
|
options: [
|
|
4087
4087
|
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4088
4088
|
...selectOptions ? selectOptions.map((option) => {
|
|
4089
|
-
|
|
4089
|
+
var _a;
|
|
4090
|
+
return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
|
|
4090
4091
|
}) : []
|
|
4091
4092
|
],
|
|
4092
4093
|
value: searchState.contentType
|
|
@@ -4097,10 +4098,10 @@ var EntrySearchFilter = ({
|
|
|
4097
4098
|
{
|
|
4098
4099
|
inputFieldName: searchInputName,
|
|
4099
4100
|
placeholder: searchInputPlaceholderText,
|
|
4100
|
-
onSearchTextChanged: (e) => handleFilterChange({
|
|
4101
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4101
4102
|
disabledFieldSubmission: true,
|
|
4102
|
-
onClear: () => handleFilterChange({
|
|
4103
|
-
value: searchState.
|
|
4103
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4104
|
+
value: searchState.keyword
|
|
4104
4105
|
}
|
|
4105
4106
|
)
|
|
4106
4107
|
] });
|
|
@@ -4488,7 +4489,7 @@ var EntrySearchResultList = ({
|
|
|
4488
4489
|
};
|
|
4489
4490
|
|
|
4490
4491
|
// src/components/EntrySearch/QueryFilter.tsx
|
|
4491
|
-
import { Input as Input7, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4492
|
+
import { Input as Input7, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4492
4493
|
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
4493
4494
|
import { jsx as jsx53, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
4494
4495
|
var QueryFilter = ({
|
|
@@ -4497,6 +4498,8 @@ var QueryFilter = ({
|
|
|
4497
4498
|
contentTypeLabel = "Filter by content type",
|
|
4498
4499
|
typeSelectorAllTypesOptionText = "All content types",
|
|
4499
4500
|
contentTypeOptions,
|
|
4501
|
+
searchInputName = "searchText",
|
|
4502
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4500
4503
|
countLabel = "Count",
|
|
4501
4504
|
countValue = 5,
|
|
4502
4505
|
sortLabel = "Sort",
|
|
@@ -4505,11 +4508,13 @@ var QueryFilter = ({
|
|
|
4505
4508
|
sortOrderOptions = [
|
|
4506
4509
|
{
|
|
4507
4510
|
name: "Ascending",
|
|
4508
|
-
id: "asc"
|
|
4511
|
+
id: "asc",
|
|
4512
|
+
label: "Ascending"
|
|
4509
4513
|
},
|
|
4510
4514
|
{
|
|
4511
4515
|
name: "Descending",
|
|
4512
|
-
id: "desc"
|
|
4516
|
+
id: "desc",
|
|
4517
|
+
label: "Descending"
|
|
4513
4518
|
}
|
|
4514
4519
|
],
|
|
4515
4520
|
children
|
|
@@ -4518,6 +4523,7 @@ var QueryFilter = ({
|
|
|
4518
4523
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4519
4524
|
const [queryState, setQueryState] = useState11({
|
|
4520
4525
|
contentType: "",
|
|
4526
|
+
keyword: "",
|
|
4521
4527
|
count: countValue != null ? countValue : 5,
|
|
4522
4528
|
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4523
4529
|
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
@@ -4532,15 +4538,17 @@ var QueryFilter = ({
|
|
|
4532
4538
|
return /* @__PURE__ */ jsxs33("fieldset", { children: [
|
|
4533
4539
|
/* @__PURE__ */ jsx53("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4534
4540
|
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
|
|
4535
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("
|
|
4541
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("0.5fr 1fr"), children: [
|
|
4536
4542
|
/* @__PURE__ */ jsx53(
|
|
4537
4543
|
InputSelect7,
|
|
4538
4544
|
{
|
|
4539
4545
|
label: contentTypeLabel,
|
|
4546
|
+
showLabel: false,
|
|
4540
4547
|
options: [
|
|
4541
|
-
...!requireContentType ? [{
|
|
4548
|
+
...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4542
4549
|
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4543
|
-
|
|
4550
|
+
var _a2;
|
|
4551
|
+
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4544
4552
|
}) : []
|
|
4545
4553
|
],
|
|
4546
4554
|
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
@@ -4548,17 +4556,18 @@ var QueryFilter = ({
|
|
|
4548
4556
|
}
|
|
4549
4557
|
),
|
|
4550
4558
|
/* @__PURE__ */ jsx53(
|
|
4551
|
-
|
|
4559
|
+
InputKeywordSearch3,
|
|
4552
4560
|
{
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4561
|
+
inputFieldName: searchInputName,
|
|
4562
|
+
placeholder: searchInputPlaceholderText,
|
|
4563
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4564
|
+
disabledFieldSubmission: true,
|
|
4565
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4566
|
+
value: queryState.keyword
|
|
4558
4567
|
}
|
|
4559
4568
|
)
|
|
4560
4569
|
] }),
|
|
4561
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
|
|
4570
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
|
|
4562
4571
|
/* @__PURE__ */ jsx53(
|
|
4563
4572
|
InputSelect7,
|
|
4564
4573
|
{
|
|
@@ -4566,10 +4575,11 @@ var QueryFilter = ({
|
|
|
4566
4575
|
options: [
|
|
4567
4576
|
{
|
|
4568
4577
|
label: "Select a sort",
|
|
4569
|
-
|
|
4578
|
+
id: ""
|
|
4570
4579
|
},
|
|
4571
4580
|
...sortOptions ? sortOptions.map((option) => {
|
|
4572
|
-
|
|
4581
|
+
var _a2;
|
|
4582
|
+
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
4573
4583
|
}) : []
|
|
4574
4584
|
],
|
|
4575
4585
|
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
@@ -4582,12 +4592,23 @@ var QueryFilter = ({
|
|
|
4582
4592
|
label: sortOrderLabel,
|
|
4583
4593
|
options: [
|
|
4584
4594
|
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4585
|
-
|
|
4595
|
+
var _a2;
|
|
4596
|
+
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4586
4597
|
}) : []
|
|
4587
4598
|
],
|
|
4588
4599
|
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4589
4600
|
value: queryState.sortOrder
|
|
4590
4601
|
}
|
|
4602
|
+
),
|
|
4603
|
+
/* @__PURE__ */ jsx53(
|
|
4604
|
+
Input7,
|
|
4605
|
+
{
|
|
4606
|
+
label: countLabel,
|
|
4607
|
+
type: "number",
|
|
4608
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4609
|
+
defaultValue: countValue,
|
|
4610
|
+
value: queryState.count
|
|
4611
|
+
}
|
|
4591
4612
|
)
|
|
4592
4613
|
] }),
|
|
4593
4614
|
children
|
|
@@ -4687,10 +4708,10 @@ import {
|
|
|
4687
4708
|
Heading,
|
|
4688
4709
|
Input as Input8,
|
|
4689
4710
|
InputComboBox,
|
|
4690
|
-
InputKeywordSearch as
|
|
4711
|
+
InputKeywordSearch as InputKeywordSearch4,
|
|
4691
4712
|
InputSelect as InputSelect8,
|
|
4692
4713
|
InputToggle,
|
|
4693
|
-
InputKeywordSearch as
|
|
4714
|
+
InputKeywordSearch as InputKeywordSearch5,
|
|
4694
4715
|
Label,
|
|
4695
4716
|
LoadingIndicator as LoadingIndicator4,
|
|
4696
4717
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4743,11 +4764,11 @@ export {
|
|
|
4743
4764
|
icons_exports as Icons,
|
|
4744
4765
|
Input8 as Input,
|
|
4745
4766
|
InputComboBox,
|
|
4746
|
-
|
|
4767
|
+
InputKeywordSearch4 as InputKeywordSearch,
|
|
4747
4768
|
InputSelect8 as InputSelect,
|
|
4748
4769
|
InputToggle,
|
|
4749
4770
|
InputVariables,
|
|
4750
|
-
|
|
4771
|
+
InputKeywordSearch5 as KeywordSearchInput,
|
|
4751
4772
|
Label,
|
|
4752
4773
|
LinkButton,
|
|
4753
4774
|
LoadingIndicator4 as LoadingIndicator,
|
package/dist/index.js
CHANGED
|
@@ -4120,7 +4120,7 @@ var EntrySearchContext = (0, import_react40.createContext)({
|
|
|
4120
4120
|
},
|
|
4121
4121
|
query: {
|
|
4122
4122
|
contentType: "",
|
|
4123
|
-
|
|
4123
|
+
keyword: ""
|
|
4124
4124
|
},
|
|
4125
4125
|
list: {},
|
|
4126
4126
|
onSetList: () => {
|
|
@@ -4132,7 +4132,7 @@ var EntrySearchContext = (0, import_react40.createContext)({
|
|
|
4132
4132
|
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
4133
4133
|
const [query, setQuery] = (0, import_react40.useState)({
|
|
4134
4134
|
contentType: "",
|
|
4135
|
-
|
|
4135
|
+
keyword: ""
|
|
4136
4136
|
});
|
|
4137
4137
|
const querySearchDeferred = (0, import_react40.useDeferredValue)(query);
|
|
4138
4138
|
const [selectedItems, setSelectedItems] = (0, import_react40.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
@@ -4223,7 +4223,7 @@ var EntrySearchFilter = ({
|
|
|
4223
4223
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4224
4224
|
const [searchState, setSearchState] = (0, import_react42.useState)({
|
|
4225
4225
|
contentType: "any",
|
|
4226
|
-
|
|
4226
|
+
keyword: ""
|
|
4227
4227
|
});
|
|
4228
4228
|
const handleFilterChange = (value) => {
|
|
4229
4229
|
setSearchState((prev) => {
|
|
@@ -4241,7 +4241,8 @@ var EntrySearchFilter = ({
|
|
|
4241
4241
|
options: [
|
|
4242
4242
|
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4243
4243
|
...selectOptions ? selectOptions.map((option) => {
|
|
4244
|
-
|
|
4244
|
+
var _a;
|
|
4245
|
+
return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
|
|
4245
4246
|
}) : []
|
|
4246
4247
|
],
|
|
4247
4248
|
value: searchState.contentType
|
|
@@ -4252,10 +4253,10 @@ var EntrySearchFilter = ({
|
|
|
4252
4253
|
{
|
|
4253
4254
|
inputFieldName: searchInputName,
|
|
4254
4255
|
placeholder: searchInputPlaceholderText,
|
|
4255
|
-
onSearchTextChanged: (e) => handleFilterChange({
|
|
4256
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4256
4257
|
disabledFieldSubmission: true,
|
|
4257
|
-
onClear: () => handleFilterChange({
|
|
4258
|
-
value: searchState.
|
|
4258
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4259
|
+
value: searchState.keyword
|
|
4259
4260
|
}
|
|
4260
4261
|
)
|
|
4261
4262
|
] });
|
|
@@ -4652,6 +4653,8 @@ var QueryFilter = ({
|
|
|
4652
4653
|
contentTypeLabel = "Filter by content type",
|
|
4653
4654
|
typeSelectorAllTypesOptionText = "All content types",
|
|
4654
4655
|
contentTypeOptions,
|
|
4656
|
+
searchInputName = "searchText",
|
|
4657
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4655
4658
|
countLabel = "Count",
|
|
4656
4659
|
countValue = 5,
|
|
4657
4660
|
sortLabel = "Sort",
|
|
@@ -4660,11 +4663,13 @@ var QueryFilter = ({
|
|
|
4660
4663
|
sortOrderOptions = [
|
|
4661
4664
|
{
|
|
4662
4665
|
name: "Ascending",
|
|
4663
|
-
id: "asc"
|
|
4666
|
+
id: "asc",
|
|
4667
|
+
label: "Ascending"
|
|
4664
4668
|
},
|
|
4665
4669
|
{
|
|
4666
4670
|
name: "Descending",
|
|
4667
|
-
id: "desc"
|
|
4671
|
+
id: "desc",
|
|
4672
|
+
label: "Descending"
|
|
4668
4673
|
}
|
|
4669
4674
|
],
|
|
4670
4675
|
children
|
|
@@ -4673,6 +4678,7 @@ var QueryFilter = ({
|
|
|
4673
4678
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4674
4679
|
const [queryState, setQueryState] = (0, import_react47.useState)({
|
|
4675
4680
|
contentType: "",
|
|
4681
|
+
keyword: "",
|
|
4676
4682
|
count: countValue != null ? countValue : 5,
|
|
4677
4683
|
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4678
4684
|
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
@@ -4687,15 +4693,17 @@ var QueryFilter = ({
|
|
|
4687
4693
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("fieldset", { children: [
|
|
4688
4694
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4689
4695
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterContainer, children: [
|
|
4690
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("
|
|
4696
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("0.5fr 1fr"), children: [
|
|
4691
4697
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4692
4698
|
import_design_system31.InputSelect,
|
|
4693
4699
|
{
|
|
4694
4700
|
label: contentTypeLabel,
|
|
4701
|
+
showLabel: false,
|
|
4695
4702
|
options: [
|
|
4696
|
-
...!requireContentType ? [{
|
|
4703
|
+
...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4697
4704
|
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4698
|
-
|
|
4705
|
+
var _a2;
|
|
4706
|
+
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4699
4707
|
}) : []
|
|
4700
4708
|
],
|
|
4701
4709
|
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
@@ -4703,17 +4711,18 @@ var QueryFilter = ({
|
|
|
4703
4711
|
}
|
|
4704
4712
|
),
|
|
4705
4713
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4706
|
-
import_design_system31.
|
|
4714
|
+
import_design_system31.InputKeywordSearch,
|
|
4707
4715
|
{
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4716
|
+
inputFieldName: searchInputName,
|
|
4717
|
+
placeholder: searchInputPlaceholderText,
|
|
4718
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4719
|
+
disabledFieldSubmission: true,
|
|
4720
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4721
|
+
value: queryState.keyword
|
|
4713
4722
|
}
|
|
4714
4723
|
)
|
|
4715
4724
|
] }),
|
|
4716
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
|
|
4717
4726
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4718
4727
|
import_design_system31.InputSelect,
|
|
4719
4728
|
{
|
|
@@ -4721,10 +4730,11 @@ var QueryFilter = ({
|
|
|
4721
4730
|
options: [
|
|
4722
4731
|
{
|
|
4723
4732
|
label: "Select a sort",
|
|
4724
|
-
|
|
4733
|
+
id: ""
|
|
4725
4734
|
},
|
|
4726
4735
|
...sortOptions ? sortOptions.map((option) => {
|
|
4727
|
-
|
|
4736
|
+
var _a2;
|
|
4737
|
+
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
4728
4738
|
}) : []
|
|
4729
4739
|
],
|
|
4730
4740
|
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
@@ -4737,12 +4747,23 @@ var QueryFilter = ({
|
|
|
4737
4747
|
label: sortOrderLabel,
|
|
4738
4748
|
options: [
|
|
4739
4749
|
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4740
|
-
|
|
4750
|
+
var _a2;
|
|
4751
|
+
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4741
4752
|
}) : []
|
|
4742
4753
|
],
|
|
4743
4754
|
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4744
4755
|
value: queryState.sortOrder
|
|
4745
4756
|
}
|
|
4757
|
+
),
|
|
4758
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4759
|
+
import_design_system31.Input,
|
|
4760
|
+
{
|
|
4761
|
+
label: countLabel,
|
|
4762
|
+
type: "number",
|
|
4763
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4764
|
+
defaultValue: countValue,
|
|
4765
|
+
value: queryState.count
|
|
4766
|
+
}
|
|
4746
4767
|
)
|
|
4747
4768
|
] }),
|
|
4748
4769
|
children
|
package/dist/index.mjs
CHANGED
|
@@ -3965,7 +3965,7 @@ var EntrySearchContext = createContext5({
|
|
|
3965
3965
|
},
|
|
3966
3966
|
query: {
|
|
3967
3967
|
contentType: "",
|
|
3968
|
-
|
|
3968
|
+
keyword: ""
|
|
3969
3969
|
},
|
|
3970
3970
|
list: {},
|
|
3971
3971
|
onSetList: () => {
|
|
@@ -3977,7 +3977,7 @@ var EntrySearchContext = createContext5({
|
|
|
3977
3977
|
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
3978
3978
|
const [query, setQuery] = useState9({
|
|
3979
3979
|
contentType: "",
|
|
3980
|
-
|
|
3980
|
+
keyword: ""
|
|
3981
3981
|
});
|
|
3982
3982
|
const querySearchDeferred = useDeferredValue(query);
|
|
3983
3983
|
const [selectedItems, setSelectedItems] = useState9(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
@@ -4068,7 +4068,7 @@ var EntrySearchFilter = ({
|
|
|
4068
4068
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4069
4069
|
const [searchState, setSearchState] = useState10({
|
|
4070
4070
|
contentType: "any",
|
|
4071
|
-
|
|
4071
|
+
keyword: ""
|
|
4072
4072
|
});
|
|
4073
4073
|
const handleFilterChange = (value) => {
|
|
4074
4074
|
setSearchState((prev) => {
|
|
@@ -4086,7 +4086,8 @@ var EntrySearchFilter = ({
|
|
|
4086
4086
|
options: [
|
|
4087
4087
|
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4088
4088
|
...selectOptions ? selectOptions.map((option) => {
|
|
4089
|
-
|
|
4089
|
+
var _a;
|
|
4090
|
+
return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
|
|
4090
4091
|
}) : []
|
|
4091
4092
|
],
|
|
4092
4093
|
value: searchState.contentType
|
|
@@ -4097,10 +4098,10 @@ var EntrySearchFilter = ({
|
|
|
4097
4098
|
{
|
|
4098
4099
|
inputFieldName: searchInputName,
|
|
4099
4100
|
placeholder: searchInputPlaceholderText,
|
|
4100
|
-
onSearchTextChanged: (e) => handleFilterChange({
|
|
4101
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4101
4102
|
disabledFieldSubmission: true,
|
|
4102
|
-
onClear: () => handleFilterChange({
|
|
4103
|
-
value: searchState.
|
|
4103
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4104
|
+
value: searchState.keyword
|
|
4104
4105
|
}
|
|
4105
4106
|
)
|
|
4106
4107
|
] });
|
|
@@ -4488,7 +4489,7 @@ var EntrySearchResultList = ({
|
|
|
4488
4489
|
};
|
|
4489
4490
|
|
|
4490
4491
|
// src/components/EntrySearch/QueryFilter.tsx
|
|
4491
|
-
import { Input as Input7, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4492
|
+
import { Input as Input7, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4492
4493
|
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
4493
4494
|
import { jsx as jsx53, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
4494
4495
|
var QueryFilter = ({
|
|
@@ -4497,6 +4498,8 @@ var QueryFilter = ({
|
|
|
4497
4498
|
contentTypeLabel = "Filter by content type",
|
|
4498
4499
|
typeSelectorAllTypesOptionText = "All content types",
|
|
4499
4500
|
contentTypeOptions,
|
|
4501
|
+
searchInputName = "searchText",
|
|
4502
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4500
4503
|
countLabel = "Count",
|
|
4501
4504
|
countValue = 5,
|
|
4502
4505
|
sortLabel = "Sort",
|
|
@@ -4505,11 +4508,13 @@ var QueryFilter = ({
|
|
|
4505
4508
|
sortOrderOptions = [
|
|
4506
4509
|
{
|
|
4507
4510
|
name: "Ascending",
|
|
4508
|
-
id: "asc"
|
|
4511
|
+
id: "asc",
|
|
4512
|
+
label: "Ascending"
|
|
4509
4513
|
},
|
|
4510
4514
|
{
|
|
4511
4515
|
name: "Descending",
|
|
4512
|
-
id: "desc"
|
|
4516
|
+
id: "desc",
|
|
4517
|
+
label: "Descending"
|
|
4513
4518
|
}
|
|
4514
4519
|
],
|
|
4515
4520
|
children
|
|
@@ -4518,6 +4523,7 @@ var QueryFilter = ({
|
|
|
4518
4523
|
const { query, onSetQuery } = useEntrySearchContext();
|
|
4519
4524
|
const [queryState, setQueryState] = useState11({
|
|
4520
4525
|
contentType: "",
|
|
4526
|
+
keyword: "",
|
|
4521
4527
|
count: countValue != null ? countValue : 5,
|
|
4522
4528
|
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4523
4529
|
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
@@ -4532,15 +4538,17 @@ var QueryFilter = ({
|
|
|
4532
4538
|
return /* @__PURE__ */ jsxs33("fieldset", { children: [
|
|
4533
4539
|
/* @__PURE__ */ jsx53("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4534
4540
|
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
|
|
4535
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("
|
|
4541
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("0.5fr 1fr"), children: [
|
|
4536
4542
|
/* @__PURE__ */ jsx53(
|
|
4537
4543
|
InputSelect7,
|
|
4538
4544
|
{
|
|
4539
4545
|
label: contentTypeLabel,
|
|
4546
|
+
showLabel: false,
|
|
4540
4547
|
options: [
|
|
4541
|
-
...!requireContentType ? [{
|
|
4548
|
+
...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4542
4549
|
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4543
|
-
|
|
4550
|
+
var _a2;
|
|
4551
|
+
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4544
4552
|
}) : []
|
|
4545
4553
|
],
|
|
4546
4554
|
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
@@ -4548,17 +4556,18 @@ var QueryFilter = ({
|
|
|
4548
4556
|
}
|
|
4549
4557
|
),
|
|
4550
4558
|
/* @__PURE__ */ jsx53(
|
|
4551
|
-
|
|
4559
|
+
InputKeywordSearch3,
|
|
4552
4560
|
{
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4561
|
+
inputFieldName: searchInputName,
|
|
4562
|
+
placeholder: searchInputPlaceholderText,
|
|
4563
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4564
|
+
disabledFieldSubmission: true,
|
|
4565
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4566
|
+
value: queryState.keyword
|
|
4558
4567
|
}
|
|
4559
4568
|
)
|
|
4560
4569
|
] }),
|
|
4561
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
|
|
4570
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
|
|
4562
4571
|
/* @__PURE__ */ jsx53(
|
|
4563
4572
|
InputSelect7,
|
|
4564
4573
|
{
|
|
@@ -4566,10 +4575,11 @@ var QueryFilter = ({
|
|
|
4566
4575
|
options: [
|
|
4567
4576
|
{
|
|
4568
4577
|
label: "Select a sort",
|
|
4569
|
-
|
|
4578
|
+
id: ""
|
|
4570
4579
|
},
|
|
4571
4580
|
...sortOptions ? sortOptions.map((option) => {
|
|
4572
|
-
|
|
4581
|
+
var _a2;
|
|
4582
|
+
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
4573
4583
|
}) : []
|
|
4574
4584
|
],
|
|
4575
4585
|
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
@@ -4582,12 +4592,23 @@ var QueryFilter = ({
|
|
|
4582
4592
|
label: sortOrderLabel,
|
|
4583
4593
|
options: [
|
|
4584
4594
|
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4585
|
-
|
|
4595
|
+
var _a2;
|
|
4596
|
+
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4586
4597
|
}) : []
|
|
4587
4598
|
],
|
|
4588
4599
|
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4589
4600
|
value: queryState.sortOrder
|
|
4590
4601
|
}
|
|
4602
|
+
),
|
|
4603
|
+
/* @__PURE__ */ jsx53(
|
|
4604
|
+
Input7,
|
|
4605
|
+
{
|
|
4606
|
+
label: countLabel,
|
|
4607
|
+
type: "number",
|
|
4608
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4609
|
+
defaultValue: countValue,
|
|
4610
|
+
value: queryState.count
|
|
4611
|
+
}
|
|
4591
4612
|
)
|
|
4592
4613
|
] }),
|
|
4593
4614
|
children
|
|
@@ -4687,10 +4708,10 @@ import {
|
|
|
4687
4708
|
Heading,
|
|
4688
4709
|
Input as Input8,
|
|
4689
4710
|
InputComboBox,
|
|
4690
|
-
InputKeywordSearch as
|
|
4711
|
+
InputKeywordSearch as InputKeywordSearch4,
|
|
4691
4712
|
InputSelect as InputSelect8,
|
|
4692
4713
|
InputToggle,
|
|
4693
|
-
InputKeywordSearch as
|
|
4714
|
+
InputKeywordSearch as InputKeywordSearch5,
|
|
4694
4715
|
Label,
|
|
4695
4716
|
LoadingIndicator as LoadingIndicator4,
|
|
4696
4717
|
LoadingOverlay as LoadingOverlay2,
|
|
@@ -4743,11 +4764,11 @@ export {
|
|
|
4743
4764
|
icons_exports as Icons,
|
|
4744
4765
|
Input8 as Input,
|
|
4745
4766
|
InputComboBox,
|
|
4746
|
-
|
|
4767
|
+
InputKeywordSearch4 as InputKeywordSearch,
|
|
4747
4768
|
InputSelect8 as InputSelect,
|
|
4748
4769
|
InputToggle,
|
|
4749
4770
|
InputVariables,
|
|
4750
|
-
|
|
4771
|
+
InputKeywordSearch5 as KeywordSearchInput,
|
|
4751
4772
|
Label,
|
|
4752
4773
|
LinkButton,
|
|
4753
4774
|
LoadingIndicator4 as LoadingIndicator,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "18.30.1-alpha.
|
|
3
|
+
"version": "18.30.1-alpha.16+307079cf6",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"document": "api-extractor run --local"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@uniformdev/design-system": "18.30.1-alpha.
|
|
47
|
-
"@uniformdev/mesh-sdk": "18.30.1-alpha.
|
|
46
|
+
"@uniformdev/design-system": "18.30.1-alpha.16+307079cf6",
|
|
47
|
+
"@uniformdev/mesh-sdk": "18.30.1-alpha.16+307079cf6",
|
|
48
48
|
"formik": "^2.2.9",
|
|
49
49
|
"react-beautiful-dnd": "13.1.1",
|
|
50
50
|
"react-icons": "4.8.0",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "307079cf66af8d71316cfb18e9dbc3ff3f059838"
|
|
77
77
|
}
|