@webiny/admin-ui 0.0.0-unstable.4485d22882 → 0.0.0-unstable.9bd236cf5e

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.
Files changed (57) hide show
  1. package/RadioGroup/primitives/RadioGroupPrimitive.js +1 -1
  2. package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
  3. package/Tags/Tags.d.ts +24 -0
  4. package/Tags/Tags.js +59 -0
  5. package/Tags/Tags.js.map +1 -0
  6. package/Tags/Tags.stories.d.ts +13 -0
  7. package/Tags/Tags.stories.js +92 -0
  8. package/Tags/Tags.stories.js.map +1 -0
  9. package/Tags/domain/TagItem.d.ts +18 -0
  10. package/Tags/domain/TagItem.js +26 -0
  11. package/Tags/domain/TagItem.js.map +1 -0
  12. package/Tags/domain/TagItemDto.d.ts +5 -0
  13. package/Tags/domain/TagItemDto.js +3 -0
  14. package/Tags/domain/TagItemDto.js.map +1 -0
  15. package/Tags/domain/TagItemFormatted.d.ts +5 -0
  16. package/Tags/domain/TagItemFormatted.js +3 -0
  17. package/Tags/domain/TagItemFormatted.js.map +1 -0
  18. package/Tags/domain/TagItemMapper.d.ts +5 -0
  19. package/Tags/domain/TagItemMapper.js +11 -0
  20. package/Tags/domain/TagItemMapper.js.map +1 -0
  21. package/Tags/domain/index.d.ts +4 -0
  22. package/Tags/domain/index.js +6 -0
  23. package/Tags/domain/index.js.map +1 -0
  24. package/Tags/index.d.ts +1 -0
  25. package/Tags/index.js +3 -0
  26. package/Tags/index.js.map +1 -0
  27. package/Tags/primitives/TagsPrimitive.d.ts +81 -0
  28. package/Tags/primitives/TagsPrimitive.js +54 -0
  29. package/Tags/primitives/TagsPrimitive.js.map +1 -0
  30. package/Tags/primitives/TagsPrimitive.stories.d.ts +26 -0
  31. package/Tags/primitives/TagsPrimitive.stories.js +185 -0
  32. package/Tags/primitives/TagsPrimitive.stories.js.map +1 -0
  33. package/Tags/primitives/index.d.ts +1 -0
  34. package/Tags/primitives/index.js +3 -0
  35. package/Tags/primitives/index.js.map +1 -0
  36. package/Tags/primitives/presenters/TagsInputPresenter.d.ts +22 -0
  37. package/Tags/primitives/presenters/TagsInputPresenter.js +22 -0
  38. package/Tags/primitives/presenters/TagsInputPresenter.js.map +1 -0
  39. package/Tags/primitives/presenters/TagsPresenter.d.ts +42 -0
  40. package/Tags/primitives/presenters/TagsPresenter.js +68 -0
  41. package/Tags/primitives/presenters/TagsPresenter.js.map +1 -0
  42. package/Tags/primitives/presenters/TagsPresenter.test.d.ts +1 -0
  43. package/Tags/primitives/presenters/TagsPresenter.test.js +220 -0
  44. package/Tags/primitives/presenters/TagsPresenter.test.js.map +1 -0
  45. package/Tags/primitives/presenters/TagsValuesPresenter.d.ts +28 -0
  46. package/Tags/primitives/presenters/TagsValuesPresenter.js +41 -0
  47. package/Tags/primitives/presenters/TagsValuesPresenter.js.map +1 -0
  48. package/Tags/primitives/presenters/index.d.ts +3 -0
  49. package/Tags/primitives/presenters/index.js +5 -0
  50. package/Tags/primitives/presenters/index.js.map +1 -0
  51. package/Tags/primitives/useTags.d.ts +15 -0
  52. package/Tags/primitives/useTags.js +36 -0
  53. package/Tags/primitives/useTags.js.map +1 -0
  54. package/index.d.ts +1 -0
  55. package/index.js +1 -0
  56. package/index.js.map +1 -1
  57. package/package.json +9 -8
@@ -0,0 +1,185 @@
1
+ import React from "react";
2
+ import { ReactComponent as TagIcon } from "@webiny/icons/tag.svg";
3
+ import { TagsPrimitive } from "./TagsPrimitive";
4
+ import { Button } from "../../Button";
5
+ import { Icon } from "../../Icon";
6
+ const meta = {
7
+ title: "Components/Form Primitives/Tags",
8
+ component: TagsPrimitive,
9
+ argTypes: {
10
+ onChange: {
11
+ action: "onChange"
12
+ },
13
+ onValueInput: {
14
+ action: "onValueInput"
15
+ },
16
+ onValueAdd: {
17
+ action: "onValueAdd"
18
+ },
19
+ onValueRemove: {
20
+ action: "onValueRemove"
21
+ },
22
+ disabled: {
23
+ control: "boolean",
24
+ defaultValue: false
25
+ }
26
+ },
27
+ parameters: {
28
+ layout: "padded"
29
+ },
30
+ render: args => /*#__PURE__*/React.createElement(TagsPrimitive, args)
31
+ };
32
+ export default meta;
33
+ export const Default = {};
34
+ export const MediumSize = {
35
+ args: {
36
+ ...Default.args,
37
+ size: "md"
38
+ }
39
+ };
40
+ export const LargeSize = {
41
+ args: {
42
+ ...Default.args,
43
+ size: "lg"
44
+ }
45
+ };
46
+ export const ExtraLargeSize = {
47
+ args: {
48
+ ...Default.args,
49
+ size: "xl"
50
+ }
51
+ };
52
+ export const PrimaryVariant = {
53
+ args: {
54
+ ...Default.args,
55
+ variant: "primary"
56
+ }
57
+ };
58
+ export const PrimaryVariantDisabled = {
59
+ args: {
60
+ ...PrimaryVariant.args,
61
+ disabled: true
62
+ }
63
+ };
64
+ export const PrimaryVariantInvalid = {
65
+ args: {
66
+ ...PrimaryVariant.args,
67
+ invalid: true
68
+ }
69
+ };
70
+ export const SecondaryVariant = {
71
+ args: {
72
+ variant: "secondary",
73
+ placeholder: "Custom placeholder"
74
+ }
75
+ };
76
+ export const SecondaryVariantDisabled = {
77
+ args: {
78
+ ...SecondaryVariant.args,
79
+ disabled: true
80
+ }
81
+ };
82
+ export const SecondaryVariantInvalid = {
83
+ args: {
84
+ ...SecondaryVariant.args,
85
+ invalid: true
86
+ }
87
+ };
88
+ export const GhostVariant = {
89
+ args: {
90
+ variant: "ghost",
91
+ placeholder: "Custom placeholder"
92
+ }
93
+ };
94
+ export const GhostVariantDisabled = {
95
+ args: {
96
+ ...GhostVariant.args,
97
+ disabled: true
98
+ }
99
+ };
100
+ export const GhostVariantInvalid = {
101
+ args: {
102
+ ...GhostVariant.args,
103
+ invalid: true
104
+ }
105
+ };
106
+ export const GhostNegativeVariant = {
107
+ args: {
108
+ ...Default.args,
109
+ variant: "ghost-negative",
110
+ placeholder: "Custom placeholder"
111
+ },
112
+ decorators: [Story => /*#__PURE__*/React.createElement("div", {
113
+ className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
114
+ }, /*#__PURE__*/React.createElement(Story, null))]
115
+ };
116
+ export const GhostNegativeVariantDisabled = {
117
+ args: {
118
+ ...GhostNegativeVariant.args,
119
+ disabled: true
120
+ },
121
+ decorators: [Story => /*#__PURE__*/React.createElement("div", {
122
+ className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
123
+ }, /*#__PURE__*/React.createElement(Story, null))]
124
+ };
125
+ export const GhostNegativeVariantInvalid = {
126
+ args: {
127
+ ...GhostNegativeVariant.args,
128
+ invalid: true
129
+ },
130
+ decorators: [Story => /*#__PURE__*/React.createElement("div", {
131
+ className: "wby-bg-neutral-dark wby-text-neutral-light wby-p-xl"
132
+ }, /*#__PURE__*/React.createElement(Story, null))]
133
+ };
134
+ export const WithCustomPlaceholder = {
135
+ args: {
136
+ ...Default.args,
137
+ placeholder: "Custom placeholder"
138
+ }
139
+ };
140
+ export const WithStartIcon = {
141
+ args: {
142
+ ...Default.args,
143
+ startIcon: /*#__PURE__*/React.createElement(Icon, {
144
+ label: "Tag",
145
+ icon: /*#__PURE__*/React.createElement(TagIcon, null)
146
+ })
147
+ }
148
+ };
149
+ export const WithInitialValues = {
150
+ args: {
151
+ ...Default.args,
152
+ value: ["tag1", "tag2", "tag3"]
153
+ }
154
+ };
155
+ export const WithProtectedValues = {
156
+ args: {
157
+ ...Default.args,
158
+ value: ["tag1", "tag2", "tag3", "another-tag1", "another-tag2"],
159
+ protectedValues: ["tag1", "another-tag*"]
160
+ }
161
+ };
162
+ export const WithExternalValueControl = {
163
+ args: {
164
+ ...Default.args,
165
+ value: ["tag1", "tag2", "tag3"]
166
+ },
167
+ render: args => {
168
+ const [value, setValue] = React.useState(args.value || []);
169
+ return /*#__PURE__*/React.createElement("div", {
170
+ className: "wby-w-full"
171
+ }, /*#__PURE__*/React.createElement(TagsPrimitive, Object.assign({}, args, {
172
+ value: value,
173
+ onChange: setValue
174
+ })), /*#__PURE__*/React.createElement("div", {
175
+ className: "wby-mt-4 wby-text-center"
176
+ }, /*#__PURE__*/React.createElement(Button, {
177
+ text: "Reset",
178
+ onClick: () => setValue(args.value || [])
179
+ })), /*#__PURE__*/React.createElement("div", {
180
+ className: "wby-mt-4 wby-text-center"
181
+ }, "Current selected values: ", value?.join(",")));
182
+ }
183
+ };
184
+
185
+ //# sourceMappingURL=TagsPrimitive.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","ReactComponent","TagIcon","TagsPrimitive","Button","Icon","meta","title","component","argTypes","onChange","action","onValueInput","onValueAdd","onValueRemove","disabled","control","defaultValue","parameters","layout","render","args","createElement","Default","MediumSize","size","LargeSize","ExtraLargeSize","PrimaryVariant","variant","PrimaryVariantDisabled","PrimaryVariantInvalid","invalid","SecondaryVariant","placeholder","SecondaryVariantDisabled","SecondaryVariantInvalid","GhostVariant","GhostVariantDisabled","GhostVariantInvalid","GhostNegativeVariant","decorators","Story","className","GhostNegativeVariantDisabled","GhostNegativeVariantInvalid","WithCustomPlaceholder","WithStartIcon","startIcon","label","icon","WithInitialValues","value","WithProtectedValues","protectedValues","WithExternalValueControl","setValue","useState","Object","assign","text","onClick","join"],"sources":["TagsPrimitive.stories.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react\";\nimport { ReactComponent as TagIcon } from \"@webiny/icons/tag.svg\";\nimport { TagsPrimitive } from \"./TagsPrimitive\";\nimport { Button } from \"~/Button\";\nimport { Icon } from \"~/Icon\";\n\nconst meta: Meta<typeof TagsPrimitive> = {\n title: \"Components/Form Primitives/Tags\",\n component: TagsPrimitive,\n argTypes: {\n onChange: { action: \"onChange\" },\n onValueInput: { action: \"onValueInput\" },\n onValueAdd: { action: \"onValueAdd\" },\n onValueRemove: { action: \"onValueRemove\" },\n disabled: {\n control: \"boolean\",\n defaultValue: false\n }\n },\n parameters: {\n layout: \"padded\"\n },\n render: args => <TagsPrimitive {...args} />\n};\n\nexport default meta;\ntype Story = StoryObj<typeof TagsPrimitive>;\n\nexport const Default: Story = {};\n\nexport const MediumSize: Story = {\n args: {\n ...Default.args,\n size: \"md\"\n }\n};\n\nexport const LargeSize: Story = {\n args: {\n ...Default.args,\n size: \"lg\"\n }\n};\n\nexport const ExtraLargeSize: Story = {\n args: {\n ...Default.args,\n size: \"xl\"\n }\n};\n\nexport const PrimaryVariant: Story = {\n args: {\n ...Default.args,\n variant: \"primary\"\n }\n};\n\nexport const PrimaryVariantDisabled: Story = {\n args: {\n ...PrimaryVariant.args,\n disabled: true\n }\n};\n\nexport const PrimaryVariantInvalid: Story = {\n args: {\n ...PrimaryVariant.args,\n invalid: true\n }\n};\n\nexport const SecondaryVariant: Story = {\n args: {\n variant: \"secondary\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const SecondaryVariantDisabled: Story = {\n args: {\n ...SecondaryVariant.args,\n disabled: true\n }\n};\n\nexport const SecondaryVariantInvalid: Story = {\n args: {\n ...SecondaryVariant.args,\n invalid: true\n }\n};\n\nexport const GhostVariant: Story = {\n args: {\n variant: \"ghost\",\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const GhostVariantDisabled: Story = {\n args: {\n ...GhostVariant.args,\n disabled: true\n }\n};\n\nexport const GhostVariantInvalid: Story = {\n args: {\n ...GhostVariant.args,\n invalid: true\n }\n};\n\nexport const GhostNegativeVariant: Story = {\n args: {\n ...Default.args,\n variant: \"ghost-negative\",\n placeholder: \"Custom placeholder\"\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantDisabled: Story = {\n args: {\n ...GhostNegativeVariant.args,\n disabled: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const GhostNegativeVariantInvalid: Story = {\n args: {\n ...GhostNegativeVariant.args,\n invalid: true\n },\n decorators: [\n Story => (\n <div className=\"wby-bg-neutral-dark wby-text-neutral-light wby-p-xl\">\n <Story />\n </div>\n )\n ]\n};\n\nexport const WithCustomPlaceholder: Story = {\n args: {\n ...Default.args,\n placeholder: \"Custom placeholder\"\n }\n};\n\nexport const WithStartIcon: Story = {\n args: {\n ...Default.args,\n startIcon: <Icon label={\"Tag\"} icon={<TagIcon />} />\n }\n};\n\nexport const WithInitialValues: Story = {\n args: {\n ...Default.args,\n value: [\"tag1\", \"tag2\", \"tag3\"]\n }\n};\n\nexport const WithProtectedValues: Story = {\n args: {\n ...Default.args,\n value: [\"tag1\", \"tag2\", \"tag3\", \"another-tag1\", \"another-tag2\"],\n protectedValues: [\"tag1\", \"another-tag*\"]\n }\n};\n\nexport const WithExternalValueControl: Story = {\n args: {\n ...Default.args,\n value: [\"tag1\", \"tag2\", \"tag3\"]\n },\n render: args => {\n const [value, setValue] = React.useState<string[]>(args.value || []);\n\n return (\n <div className={\"wby-w-full\"}>\n <TagsPrimitive {...args} value={value} onChange={setValue} />\n <div className={\"wby-mt-4 wby-text-center\"}>\n <Button text={\"Reset\"} onClick={() => setValue(args.value || [])} />\n </div>\n <div className={\"wby-mt-4 wby-text-center\"}>\n Current selected values: {value?.join(\",\")}\n </div>\n </div>\n );\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,IAAIC,OAAO,QAAQ,uBAAuB;AACjE,SAASC,aAAa;AACtB,SAASC,MAAM;AACf,SAASC,IAAI;AAEb,MAAMC,IAAgC,GAAG;EACrCC,KAAK,EAAE,iCAAiC;EACxCC,SAAS,EAAEL,aAAa;EACxBM,QAAQ,EAAE;IACNC,QAAQ,EAAE;MAAEC,MAAM,EAAE;IAAW,CAAC;IAChCC,YAAY,EAAE;MAAED,MAAM,EAAE;IAAe,CAAC;IACxCE,UAAU,EAAE;MAAEF,MAAM,EAAE;IAAa,CAAC;IACpCG,aAAa,EAAE;MAAEH,MAAM,EAAE;IAAgB,CAAC;IAC1CI,QAAQ,EAA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AAA,CAAAsB,aAAA,CAACnB,aAAa,EAAAuD,MAAA,CAAAC,MAAA,KAAKtC,IAAI;MAAE+B,KAAK,EAAEA,KAAM;MAAC1C,QAAQ,EAAE8C;IAAS,EAAE,CAAC,eAC7DxD,KAAA,CAAAsB,aAAA;MAAKqB,SAAS,EAAE;IAA2B,gBACvC3C,KAAA,CAAAsB,aAAA,CAAClB,MAAM;MAACwD,IAAI,EAAE,OAAQ;MAACC,OAAO,EAAEA,CAAA,KAAML,QAAQ,CAACnC,IAAI,CAAC+B,KAAK,IAAI,EAAE;IAAE,CAAE,CAClE,CAAC,eACNpD,KAAA,CAAAsB,aAAA;MAAKqB,SAAS,EAAE;IAA2B,GAAC,2BACf,EAACS,KAAK,EAAEU,IAAI,CAAC,GAAG,CACxC,CACJ,CAAC;EAEd;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export * from "./TagsPrimitive";
@@ -0,0 +1,3 @@
1
+ export * from "./TagsPrimitive";
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./TagsPrimitive\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ export interface TagsInputPresenterParams {
2
+ placeholder?: string;
3
+ }
4
+ export interface ITagsInputPresenter {
5
+ vm: {
6
+ placeholder: string;
7
+ value: string;
8
+ };
9
+ init: (params: TagsInputPresenterParams) => void;
10
+ setValue: (query: string) => void;
11
+ }
12
+ export declare class TagsInputPresenter implements ITagsInputPresenter {
13
+ private value?;
14
+ private placeholder?;
15
+ constructor();
16
+ init(params?: TagsInputPresenterParams): void;
17
+ get vm(): {
18
+ placeholder: string;
19
+ value: string;
20
+ };
21
+ setValue: (value: string) => void;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { makeAutoObservable } from "mobx";
2
+ export class TagsInputPresenter {
3
+ value = undefined;
4
+ placeholder = undefined;
5
+ constructor() {
6
+ makeAutoObservable(this);
7
+ }
8
+ init(params) {
9
+ this.placeholder = params?.placeholder;
10
+ }
11
+ get vm() {
12
+ return {
13
+ placeholder: this.placeholder || "",
14
+ value: this.value || ""
15
+ };
16
+ }
17
+ setValue = value => {
18
+ this.value = value;
19
+ };
20
+ }
21
+
22
+ //# sourceMappingURL=TagsInputPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["makeAutoObservable","TagsInputPresenter","value","undefined","placeholder","constructor","init","params","vm","setValue"],"sources":["TagsInputPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nexport interface TagsInputPresenterParams {\n placeholder?: string;\n}\n\nexport interface ITagsInputPresenter {\n vm: {\n placeholder: string;\n value: string;\n };\n init: (params: TagsInputPresenterParams) => void;\n setValue: (query: string) => void;\n}\n\nexport class TagsInputPresenter implements ITagsInputPresenter {\n private value?: string = undefined;\n private placeholder?: string = undefined;\n\n constructor() {\n makeAutoObservable(this);\n }\n\n init(params?: TagsInputPresenterParams) {\n this.placeholder = params?.placeholder;\n }\n\n get vm() {\n return {\n placeholder: this.placeholder || \"\",\n value: this.value || \"\"\n };\n }\n\n public setValue = (value: string) => {\n this.value = value;\n };\n}\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAezC,OAAO,MAAMC,kBAAkB,CAAgC;EACnDC,KAAK,GAAYC,SAAS;EAC1BC,WAAW,GAAYD,SAAS;EAExCE,WAAWA,CAAA,EAAG;IACVL,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAM,IAAIA,CAACC,MAAiC,EAAE;IACpC,IAAI,CAACH,WAAW,GAAGG,MAAM,EAAEH,WAAW;EAC1C;EAEA,IAAII,EAAEA,CAAA,EAAG;IACL,OAAO;MACHJ,WAAW,EAAE,IAAI,CAACA,WAAW,IAAI,EAAE;MACnCF,KAAK,EAAE,IAAI,CAACA,KAAK,IAAI;IACzB,CAAC;EACL;EAEOO,QAAQ,GAAIP,KAAa,IAAK;IACjC,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB,CAAC;AACL","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ import { type ITagsInputPresenter } from "./TagsInputPresenter";
2
+ import { type ITagsValuesPresenter } from "./TagsValuesPresenter";
3
+ interface TagsPresenterParams {
4
+ values?: string[];
5
+ protectedValues?: string[];
6
+ onValueChange?: (values: string[]) => void;
7
+ onValueInput?: (value: string) => void;
8
+ onValueAdd?: (value: string) => void;
9
+ onValueRemove?: (value: string) => void;
10
+ placeholder?: string;
11
+ }
12
+ interface ITagsPresenter {
13
+ vm: {
14
+ inputVm: ITagsInputPresenter["vm"];
15
+ valuesVm: ITagsValuesPresenter["vm"];
16
+ };
17
+ init: (params: TagsPresenterParams) => void;
18
+ inputValue: (value: string) => void;
19
+ addValue: (value: string) => void;
20
+ removeValue: (value: string) => void;
21
+ }
22
+ declare class TagsPresenter implements ITagsPresenter {
23
+ private params?;
24
+ private inputPresenter;
25
+ private valuesPresenter;
26
+ constructor(inputPresenter: ITagsInputPresenter, valuesPresenter: ITagsValuesPresenter);
27
+ init(params: TagsPresenterParams): void;
28
+ get vm(): {
29
+ inputVm: {
30
+ placeholder: string;
31
+ value: string;
32
+ };
33
+ valuesVm: {
34
+ values: import("../../domain").TagItemFormatted[];
35
+ };
36
+ };
37
+ inputValue: (value: string) => void;
38
+ addValue: () => void;
39
+ removeValue: (value: string) => void;
40
+ private getValues;
41
+ }
42
+ export { TagsPresenter, type ITagsPresenter, type TagsPresenterParams };
@@ -0,0 +1,68 @@
1
+ import { makeAutoObservable } from "mobx";
2
+ class TagsPresenter {
3
+ params = undefined;
4
+ constructor(inputPresenter, valuesPresenter) {
5
+ this.inputPresenter = inputPresenter;
6
+ this.valuesPresenter = valuesPresenter;
7
+ makeAutoObservable(this);
8
+ }
9
+ init(params) {
10
+ this.params = params;
11
+ this.inputPresenter.init({
12
+ placeholder: params.placeholder
13
+ });
14
+ this.valuesPresenter.init({
15
+ values: params.values,
16
+ protectedValues: params.protectedValues
17
+ });
18
+ }
19
+ get vm() {
20
+ return {
21
+ inputVm: this.inputPresenter.vm,
22
+ valuesVm: this.valuesPresenter.vm
23
+ };
24
+ }
25
+ inputValue = value => {
26
+ this.inputPresenter.setValue(value);
27
+ if (this.params?.onValueInput) {
28
+ this.params.onValueInput(value);
29
+ }
30
+ };
31
+ addValue = () => {
32
+ const value = this.vm.inputVm.value.trim();
33
+ if (!value) {
34
+ return;
35
+ }
36
+ this.inputPresenter.setValue("");
37
+ if (this.valuesPresenter.hasValue(value)) {
38
+ // If the value already exists, do not add it again
39
+ return;
40
+ }
41
+ this.valuesPresenter.addValue(value);
42
+ if (this.params?.onValueAdd) {
43
+ this.params.onValueAdd(value);
44
+ }
45
+ if (this.params?.onValueChange) {
46
+ this.params.onValueChange(this.getValues());
47
+ }
48
+ };
49
+ removeValue = value => {
50
+ this.valuesPresenter.removeValue(value);
51
+ if (this.valuesPresenter.isValueProtected(value)) {
52
+ // If the value is protected, do not remove it
53
+ return;
54
+ }
55
+ if (this.params?.onValueRemove) {
56
+ this.params.onValueRemove(value);
57
+ }
58
+ if (this.params?.onValueChange) {
59
+ this.params.onValueChange(this.getValues());
60
+ }
61
+ };
62
+ getValues = () => {
63
+ return this.valuesPresenter.vm.values.map(tag => tag.label);
64
+ };
65
+ }
66
+ export { TagsPresenter };
67
+
68
+ //# sourceMappingURL=TagsPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["makeAutoObservable","TagsPresenter","params","undefined","constructor","inputPresenter","valuesPresenter","init","placeholder","values","protectedValues","vm","inputVm","valuesVm","inputValue","value","setValue","onValueInput","addValue","trim","hasValue","onValueAdd","onValueChange","getValues","removeValue","isValueProtected","onValueRemove","map","tag","label"],"sources":["TagsPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\nimport { type ITagsInputPresenter } from \"./TagsInputPresenter\";\nimport { type ITagsValuesPresenter } from \"./TagsValuesPresenter\";\n\ninterface TagsPresenterParams {\n values?: string[];\n protectedValues?: string[];\n onValueChange?: (values: string[]) => void;\n onValueInput?: (value: string) => void;\n onValueAdd?: (value: string) => void;\n onValueRemove?: (value: string) => void;\n placeholder?: string;\n}\n\ninterface ITagsPresenter {\n vm: {\n inputVm: ITagsInputPresenter[\"vm\"];\n valuesVm: ITagsValuesPresenter[\"vm\"];\n };\n init: (params: TagsPresenterParams) => void;\n inputValue: (value: string) => void;\n addValue: (value: string) => void;\n removeValue: (value: string) => void;\n}\n\nclass TagsPresenter implements ITagsPresenter {\n private params?: TagsPresenterParams = undefined;\n private inputPresenter: ITagsInputPresenter;\n private valuesPresenter: ITagsValuesPresenter;\n\n constructor(inputPresenter: ITagsInputPresenter, valuesPresenter: ITagsValuesPresenter) {\n this.inputPresenter = inputPresenter;\n this.valuesPresenter = valuesPresenter;\n makeAutoObservable(this);\n }\n\n init(params: TagsPresenterParams) {\n this.params = params;\n this.inputPresenter.init({ placeholder: params.placeholder });\n this.valuesPresenter.init({\n values: params.values,\n protectedValues: params.protectedValues\n });\n }\n\n get vm() {\n return {\n inputVm: this.inputPresenter.vm,\n valuesVm: this.valuesPresenter.vm\n };\n }\n\n public inputValue = (value: string) => {\n this.inputPresenter.setValue(value);\n if (this.params?.onValueInput) {\n this.params.onValueInput(value);\n }\n };\n\n public addValue = () => {\n const value = this.vm.inputVm.value.trim();\n\n if (!value) {\n return;\n }\n\n this.inputPresenter.setValue(\"\");\n\n if (this.valuesPresenter.hasValue(value)) {\n // If the value already exists, do not add it again\n return;\n }\n\n this.valuesPresenter.addValue(value);\n\n if (this.params?.onValueAdd) {\n this.params.onValueAdd(value);\n }\n\n if (this.params?.onValueChange) {\n this.params.onValueChange(this.getValues());\n }\n };\n\n public removeValue = (value: string) => {\n this.valuesPresenter.removeValue(value);\n\n if (this.valuesPresenter.isValueProtected(value)) {\n // If the value is protected, do not remove it\n return;\n }\n\n if (this.params?.onValueRemove) {\n this.params.onValueRemove(value);\n }\n\n if (this.params?.onValueChange) {\n this.params.onValueChange(this.getValues());\n }\n };\n\n private getValues = () => {\n return this.valuesPresenter.vm.values.map(tag => tag.label);\n };\n}\n\nexport { TagsPresenter, type ITagsPresenter, type TagsPresenterParams };\n"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,MAAM;AAyBzC,MAAMC,aAAa,CAA2B;EAClCC,MAAM,GAAyBC,SAAS;EAIhDC,WAAWA,CAACC,cAAmC,EAAEC,eAAqC,EAAE;IACpF,IAAI,CAACD,cAAc,GAAGA,cAAc;IACpC,IAAI,CAACC,eAAe,GAAGA,eAAe;IACtCN,kBAAkB,CAAC,IAAI,CAAC;EAC5B;EAEAO,IAAIA,CAACL,MAA2B,EAAE;IAC9B,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACG,cAAc,CAACE,IAAI,CAAC;MAAEC,WAAW,EAAEN,MAAM,CAACM;IAAY,CAAC,CAAC;IAC7D,IAAI,CAACF,eAAe,CAACC,IAAI,CAAC;MACtBE,MAAM,EAAEP,MAAM,CAACO,MAAM;MACrBC,eAAe,EAAER,MAAM,CAACQ;IAC5B,CAAC,CAAC;EACN;EAEA,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO;MACHC,OAAO,EAAE,IAAI,CAACP,cAAc,CAACM,EAAE;MAC/BE,QAAQ,EAAE,IAAI,CAACP,eAAe,CAACK;IACnC,CAAC;EACL;EAEOG,UAAU,GAAIC,KAAa,IAAK;IACnC,IAAI,CAACV,cAAc,CAACW,QAAQ,CAACD,KAAK,CAAC;IACnC,IAAI,IAAI,CAACb,MAAM,EAAEe,YAAY,EAAE;MAC3B,IAAI,CAACf,MAAM,CAACe,YAAY,CAACF,KAAK,CAAC;IACnC;EACJ,CAAC;EAEMG,QAAQ,GAAGA,CAAA,KAAM;IACpB,MAAMH,KAAK,GAAG,IAAI,CAACJ,EAAE,CAACC,OAAO,CAACG,KAAK,CAACI,IAAI,CAAC,CAAC;IAE1C,IAAI,CAACJ,KAAK,EAAE;MACR;IACJ;IAEA,IAAI,CAACV,cAAc,CAACW,QAAQ,CAAC,EAAE,CAAC;IAEhC,IAAI,IAAI,CAACV,eAAe,CAACc,QAAQ,CAACL,KAAK,CAAC,EAAE;MACtC;MACA;IACJ;IAEA,IAAI,CAACT,eAAe,CAACY,QAAQ,CAACH,KAAK,CAAC;IAEpC,IAAI,IAAI,CAACb,MAAM,EAAEmB,UAAU,EAAE;MACzB,IAAI,CAACnB,MAAM,CAACmB,UAAU,CAACN,KAAK,CAAC;IACjC;IAEA,IAAI,IAAI,CAACb,MAAM,EAAEoB,aAAa,EAAE;MAC5B,IAAI,CAACpB,MAAM,CAACoB,aAAa,CAAC,IAAI,CAACC,SAAS,CAAC,CAAC,CAAC;IAC/C;EACJ,CAAC;EAEMC,WAAW,GAAIT,KAAa,IAAK;IACpC,IAAI,CAACT,eAAe,CAACkB,WAAW,CAACT,KAAK,CAAC;IAEvC,IAAI,IAAI,CAACT,eAAe,CAACmB,gBAAgB,CAACV,KAAK,CAAC,EAAE;MAC9C;MACA;IACJ;IAEA,IAAI,IAAI,CAACb,MAAM,EAAEwB,aAAa,EAAE;MAC5B,IAAI,CAACxB,MAAM,CAACwB,aAAa,CAACX,KAAK,CAAC;IACpC;IAEA,IAAI,IAAI,CAACb,MAAM,EAAEoB,aAAa,EAAE;MAC5B,IAAI,CAACpB,MAAM,CAACoB,aAAa,CAAC,IAAI,CAACC,SAAS,CAAC,CAAC,CAAC;IAC/C;EACJ,CAAC;EAEOA,SAAS,GAAGA,CAAA,KAAM;IACtB,OAAO,IAAI,CAACjB,eAAe,CAACK,EAAE,CAACF,MAAM,CAACkB,GAAG,CAACC,GAAG,IAAIA,GAAG,CAACC,KAAK,CAAC;EAC/D,CAAC;AACL;AAEA,SAAS5B,aAAa","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,220 @@
1
+ import { TagsPresenter } from "./TagsPresenter";
2
+ import { TagsValuesPresenter } from "./TagsValuesPresenter";
3
+ import { TagsInputPresenter } from "./TagsInputPresenter";
4
+ describe("TagsPresenter", () => {
5
+ let presenter;
6
+ const onValueChange = jest.fn();
7
+ const onValueInput = jest.fn();
8
+ const onValueAdd = jest.fn();
9
+ const onValueRemove = jest.fn();
10
+ beforeEach(() => {
11
+ const tagsInputPresenter = new TagsInputPresenter();
12
+ const tagsValuesPresenter = new TagsValuesPresenter();
13
+ presenter = new TagsPresenter(tagsInputPresenter, tagsValuesPresenter);
14
+ });
15
+ it("should return the compatible `vm.inputVm` based on", () => {
16
+ presenter.init({
17
+ placeholder: "Custom placeholder"
18
+ });
19
+ expect(presenter.vm.inputVm.placeholder).toBe("Custom placeholder");
20
+ });
21
+ it("should return the compatible `vm.valuesVm` based on", () => {
22
+ presenter.init({
23
+ values: ["tag1", "tag2"]
24
+ });
25
+ expect(presenter.vm.valuesVm.values).toEqual([{
26
+ id: expect.any(String),
27
+ label: "tag1",
28
+ protected: false
29
+ }, {
30
+ id: expect.any(String),
31
+ label: "tag2",
32
+ protected: false
33
+ }]);
34
+ });
35
+ it("should call `onValueInput` and add the new value when input a value", () => {
36
+ presenter.init({
37
+ onValueInput
38
+ });
39
+ const value1 = "value 1";
40
+ presenter.inputValue(value1);
41
+ expect(onValueInput).toHaveBeenCalledWith(value1);
42
+ expect(presenter.vm.inputVm.value).toBe(value1);
43
+ const value2 = "value 2";
44
+ presenter.inputValue(value2);
45
+ expect(onValueInput).toHaveBeenCalledWith(value2);
46
+ expect(presenter.vm.inputVm.value).toBe(value2);
47
+ });
48
+ it("should call `onValueAdd` and add the new value when adding a value", () => {
49
+ presenter.init({
50
+ onValueAdd,
51
+ onValueChange
52
+ });
53
+
54
+ // It should add a value and call `onValueAdd` and `onValueChange`
55
+ const value1 = "value 1";
56
+ presenter.inputValue(value1);
57
+ presenter.addValue(value1);
58
+ expect(onValueAdd).toHaveBeenCalledWith(value1);
59
+ expect(presenter.vm.valuesVm.values).toEqual([{
60
+ id: expect.any(String),
61
+ label: value1,
62
+ protected: false
63
+ }]);
64
+ expect(onValueChange).toHaveBeenCalledWith([value1]);
65
+
66
+ // It should add another value and call `onValueAdd` and `onValueChange`
67
+ const value2 = "value 2";
68
+ presenter.inputValue(value2);
69
+ presenter.addValue(value2);
70
+ expect(onValueAdd).toHaveBeenCalledWith(value2);
71
+ expect(presenter.vm.valuesVm.values).toEqual([{
72
+ id: expect.any(String),
73
+ label: value1,
74
+ protected: false
75
+ }, {
76
+ id: expect.any(String),
77
+ label: value2,
78
+ protected: false
79
+ }]);
80
+ expect(onValueChange).toHaveBeenCalledWith([value1, value2]);
81
+
82
+ // It should not add an empty value
83
+ const emptyValue = " ";
84
+ presenter.inputValue(emptyValue);
85
+ presenter.addValue(emptyValue);
86
+ expect(onValueAdd).not.toHaveBeenCalledWith(emptyValue);
87
+ expect(presenter.vm.valuesVm.values).toEqual([{
88
+ id: expect.any(String),
89
+ label: value1,
90
+ protected: false
91
+ }, {
92
+ id: expect.any(String),
93
+ label: value2,
94
+ protected: false
95
+ }]);
96
+ expect(onValueChange).toHaveBeenCalledWith([value1, value2]);
97
+
98
+ // It should not add a duplicate value
99
+ presenter.inputValue(value1);
100
+ presenter.addValue(value1);
101
+ expect(onValueAdd).not.toHaveBeenLastCalledWith(value1);
102
+ expect(presenter.vm.valuesVm.values).toEqual([{
103
+ id: expect.any(String),
104
+ label: value1,
105
+ protected: false
106
+ }, {
107
+ id: expect.any(String),
108
+ label: value2,
109
+ protected: false
110
+ }]);
111
+ });
112
+ it("should call `onValueRemove` and remove the value when removing a value", () => {
113
+ const initialValues = ["tag1", "tag2"];
114
+ presenter.init({
115
+ values: initialValues,
116
+ onValueRemove,
117
+ onValueChange
118
+ });
119
+ const valueToRemove = "tag1";
120
+ presenter.removeValue(valueToRemove);
121
+ expect(onValueRemove).toHaveBeenCalledWith(valueToRemove);
122
+ expect(presenter.vm.valuesVm.values).toEqual([{
123
+ id: expect.any(String),
124
+ label: "tag2",
125
+ protected: false
126
+ }]);
127
+ expect(onValueChange).toHaveBeenCalledWith(["tag2"]);
128
+ });
129
+ it("should not remove a protected value", () => {
130
+ const initialValues = ["tag1", "tag2"];
131
+ const protectedValues = ["tag1"];
132
+ presenter.init({
133
+ values: initialValues,
134
+ protectedValues,
135
+ onValueRemove,
136
+ onValueChange
137
+ });
138
+ expect(presenter.vm.valuesVm.values).toEqual([{
139
+ id: expect.any(String),
140
+ label: "tag1",
141
+ protected: true
142
+ }, {
143
+ id: expect.any(String),
144
+ label: "tag2",
145
+ protected: false
146
+ }]);
147
+ const valueToRemove = "tag1";
148
+ presenter.removeValue(valueToRemove);
149
+ expect(onValueRemove).not.toHaveBeenCalled();
150
+ expect(onValueChange).not.toHaveBeenCalled();
151
+ expect(presenter.vm.valuesVm.values).toEqual([{
152
+ id: expect.any(String),
153
+ label: "tag1",
154
+ protected: true
155
+ }, {
156
+ id: expect.any(String),
157
+ label: "tag2",
158
+ protected: false
159
+ }]);
160
+ });
161
+ it("should not remove a value based on a pattern", () => {
162
+ const initialValues = ["tag1", "tag2", "another-tag"];
163
+ const protectedValues = ["tag*"];
164
+ presenter.init({
165
+ values: initialValues,
166
+ protectedValues,
167
+ onValueRemove,
168
+ onValueChange
169
+ });
170
+ expect(presenter.vm.valuesVm.values).toEqual([{
171
+ id: expect.any(String),
172
+ label: "tag1",
173
+ protected: true
174
+ }, {
175
+ id: expect.any(String),
176
+ label: "tag2",
177
+ protected: true
178
+ }, {
179
+ id: expect.any(String),
180
+ label: "another-tag",
181
+ protected: false
182
+ }]);
183
+
184
+ // Try to remove a protected value
185
+ const valueToRemove = "tag1";
186
+ presenter.removeValue(valueToRemove);
187
+ expect(onValueRemove).not.toHaveBeenCalled();
188
+ expect(onValueChange).not.toHaveBeenCalled();
189
+ expect(presenter.vm.valuesVm.values).toEqual([{
190
+ id: expect.any(String),
191
+ label: "tag1",
192
+ protected: true
193
+ }, {
194
+ id: expect.any(String),
195
+ label: "tag2",
196
+ protected: true
197
+ }, {
198
+ id: expect.any(String),
199
+ label: "another-tag",
200
+ protected: false
201
+ }]);
202
+
203
+ // Try to remove a non-protected value
204
+ const anotherValueToRemove = "another-tag";
205
+ presenter.removeValue(anotherValueToRemove);
206
+ expect(onValueRemove).toHaveBeenCalledWith(anotherValueToRemove);
207
+ expect(onValueChange).toHaveBeenCalledWith(["tag1", "tag2"]);
208
+ expect(presenter.vm.valuesVm.values).toEqual([{
209
+ id: expect.any(String),
210
+ label: "tag1",
211
+ protected: true
212
+ }, {
213
+ id: expect.any(String),
214
+ label: "tag2",
215
+ protected: true
216
+ }]);
217
+ });
218
+ });
219
+
220
+ //# sourceMappingURL=TagsPresenter.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TagsPresenter","TagsValuesPresenter","TagsInputPresenter","describe","presenter","onValueChange","jest","fn","onValueInput","onValueAdd","onValueRemove","beforeEach","tagsInputPresenter","tagsValuesPresenter","it","init","placeholder","expect","vm","inputVm","toBe","values","valuesVm","toEqual","id","any","String","label","protected","value1","inputValue","toHaveBeenCalledWith","value","value2","addValue","emptyValue","not","toHaveBeenLastCalledWith","initialValues","valueToRemove","removeValue","protectedValues","toHaveBeenCalled","anotherValueToRemove"],"sources":["TagsPresenter.test.ts"],"sourcesContent":["import { type ITagsPresenter, TagsPresenter } from \"./TagsPresenter\";\nimport { TagsValuesPresenter } from \"./TagsValuesPresenter\";\nimport { TagsInputPresenter } from \"./TagsInputPresenter\";\n\ndescribe(\"TagsPresenter\", () => {\n let presenter: ITagsPresenter;\n const onValueChange = jest.fn();\n const onValueInput = jest.fn();\n const onValueAdd = jest.fn();\n const onValueRemove = jest.fn();\n\n beforeEach(() => {\n const tagsInputPresenter = new TagsInputPresenter();\n const tagsValuesPresenter = new TagsValuesPresenter();\n presenter = new TagsPresenter(tagsInputPresenter, tagsValuesPresenter);\n });\n\n it(\"should return the compatible `vm.inputVm` based on\", () => {\n presenter.init({\n placeholder: \"Custom placeholder\"\n });\n\n expect(presenter.vm.inputVm.placeholder).toBe(\"Custom placeholder\");\n });\n\n it(\"should return the compatible `vm.valuesVm` based on\", () => {\n presenter.init({\n values: [\"tag1\", \"tag2\"]\n });\n\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: false\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: false\n }\n ]);\n });\n\n it(\"should call `onValueInput` and add the new value when input a value\", () => {\n presenter.init({\n onValueInput\n });\n\n const value1 = \"value 1\";\n presenter.inputValue(value1);\n\n expect(onValueInput).toHaveBeenCalledWith(value1);\n expect(presenter.vm.inputVm.value).toBe(value1);\n\n const value2 = \"value 2\";\n presenter.inputValue(value2);\n expect(onValueInput).toHaveBeenCalledWith(value2);\n expect(presenter.vm.inputVm.value).toBe(value2);\n });\n\n it(\"should call `onValueAdd` and add the new value when adding a value\", () => {\n presenter.init({\n onValueAdd,\n onValueChange\n });\n\n // It should add a value and call `onValueAdd` and `onValueChange`\n const value1 = \"value 1\";\n presenter.inputValue(value1);\n presenter.addValue(value1);\n\n expect(onValueAdd).toHaveBeenCalledWith(value1);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: value1,\n protected: false\n }\n ]);\n expect(onValueChange).toHaveBeenCalledWith([value1]);\n\n // It should add another value and call `onValueAdd` and `onValueChange`\n const value2 = \"value 2\";\n presenter.inputValue(value2);\n presenter.addValue(value2);\n\n expect(onValueAdd).toHaveBeenCalledWith(value2);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: value1,\n protected: false\n },\n {\n id: expect.any(String),\n label: value2,\n protected: false\n }\n ]);\n expect(onValueChange).toHaveBeenCalledWith([value1, value2]);\n\n // It should not add an empty value\n const emptyValue = \" \";\n presenter.inputValue(emptyValue);\n presenter.addValue(emptyValue);\n\n expect(onValueAdd).not.toHaveBeenCalledWith(emptyValue);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: value1,\n protected: false\n },\n {\n id: expect.any(String),\n label: value2,\n protected: false\n }\n ]);\n expect(onValueChange).toHaveBeenCalledWith([value1, value2]);\n\n // It should not add a duplicate value\n presenter.inputValue(value1);\n presenter.addValue(value1);\n\n expect(onValueAdd).not.toHaveBeenLastCalledWith(value1);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: value1,\n protected: false\n },\n {\n id: expect.any(String),\n label: value2,\n protected: false\n }\n ]);\n });\n\n it(\"should call `onValueRemove` and remove the value when removing a value\", () => {\n const initialValues = [\"tag1\", \"tag2\"];\n presenter.init({\n values: initialValues,\n onValueRemove,\n onValueChange\n });\n\n const valueToRemove = \"tag1\";\n presenter.removeValue(valueToRemove);\n\n expect(onValueRemove).toHaveBeenCalledWith(valueToRemove);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: false\n }\n ]);\n expect(onValueChange).toHaveBeenCalledWith([\"tag2\"]);\n });\n\n it(\"should not remove a protected value\", () => {\n const initialValues = [\"tag1\", \"tag2\"];\n const protectedValues = [\"tag1\"];\n presenter.init({\n values: initialValues,\n protectedValues,\n onValueRemove,\n onValueChange\n });\n\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: false\n }\n ]);\n\n const valueToRemove = \"tag1\";\n presenter.removeValue(valueToRemove);\n\n expect(onValueRemove).not.toHaveBeenCalled();\n expect(onValueChange).not.toHaveBeenCalled();\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: false\n }\n ]);\n });\n\n it(\"should not remove a value based on a pattern\", () => {\n const initialValues = [\"tag1\", \"tag2\", \"another-tag\"];\n const protectedValues = [\"tag*\"];\n presenter.init({\n values: initialValues,\n protectedValues,\n onValueRemove,\n onValueChange\n });\n\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"another-tag\",\n protected: false\n }\n ]);\n\n // Try to remove a protected value\n const valueToRemove = \"tag1\";\n presenter.removeValue(valueToRemove);\n\n expect(onValueRemove).not.toHaveBeenCalled();\n expect(onValueChange).not.toHaveBeenCalled();\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"another-tag\",\n protected: false\n }\n ]);\n\n // Try to remove a non-protected value\n const anotherValueToRemove = \"another-tag\";\n presenter.removeValue(anotherValueToRemove);\n\n expect(onValueRemove).toHaveBeenCalledWith(anotherValueToRemove);\n expect(onValueChange).toHaveBeenCalledWith([\"tag1\", \"tag2\"]);\n expect(presenter.vm.valuesVm.values).toEqual([\n {\n id: expect.any(String),\n label: \"tag1\",\n protected: true\n },\n {\n id: expect.any(String),\n label: \"tag2\",\n protected: true\n }\n ]);\n });\n});\n"],"mappings":"AAAA,SAA8BA,aAAa;AAC3C,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB;AAE3BC,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC5B,IAAIC,SAAyB;EAC7B,MAAMC,aAAa,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;EAC/B,MAAMC,YAAY,GAAGF,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9B,MAAME,UAAU,GAAGH,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5B,MAAMG,aAAa,GAAGJ,IAAI,CAACC,EAAE,CAAC,CAAC;EAE/BI,UAAU,CAAC,MAAM;IACb,MAAMC,kBAAkB,GAAG,IAAIV,kBAAkB,CAAC,CAAC;IACnD,MAAMW,mBAAmB,GAAG,IAAIZ,mBAAmB,CAAC,CAAC;IACrDG,SAAS,GAAG,IAAIJ,aAAa,CAACY,kBAAkB,EAAEC,mBAAmB,CAAC;EAC1E,CAAC,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