@pega/custom-dx-components 0.25.31 → 0.25.33
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/README.md +3 -5
- package/eslint.config.mjs +227 -0
- package/package.json +3 -3
- package/src/constants.js +1 -1
- package/src/tasks/create/index.js +8 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/repeat-utils.ts.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/index.tsx.mustache +2 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.tsx → StatusWork.tsx.mustache} +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.tsx.mustache +0 -1
- package/src/tasks/create-all/index.js +18 -2
- package/src/tasks/create-lib/helper.js +1 -2
- package/src/tasks/export-archive/helper.js +1 -1
- package/src/tasks/import-archive/index.js +2 -2
- package/src/tasks/init/index.js +1 -1
- package/src/tasks/init/template/.eslintignore +1 -0
- package/src/tasks/init/template/README.md +3 -5
- package/src/tasks/init/template/eslint.config.mjs +227 -0
- package/src/tasks/init/template/package.json.mustache +3 -2
- package/src/tasks/init/template/tasks.config.json +2 -2
- package/src/tasks/init/template/tsconfig.build.json +2 -1
- package/src/tasks/init/template/tsconfig.json +1 -0
- package/src/tasks/validator/index.js +5 -0
- package/src/util.js +30 -2
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
- package/tests/assets/library/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/Avatar.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
- package/tests/assets/original/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyRadiobuttons/index.tsx +2 -3
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +1 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts +2 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +0 -1
- package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +0 -1
- package/.eslintrc.json +0 -18
- package/src/tasks/init/template/.eslintrc.json +0 -240
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
1
|
/* eslint-disable sonarjs/cognitive-complexity */
|
|
3
2
|
import { useEffect, useRef, useState, useMemo, type MutableRefObject, type SetStateAction } from 'react';
|
|
4
3
|
import { ComboBox, menuHelpers, debounce, throttle, Button, Icon, withConfiguration, type MenuGroupProps, type MenuItemProps } from '@pega/cosmos-react-core';
|
|
@@ -414,6 +413,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
414
413
|
const { isSearchableOnKey } = props;
|
|
415
414
|
|
|
416
415
|
const [items, setItems] = useState(() => []);
|
|
416
|
+
// eslint-disable-next-line prefer-const
|
|
417
417
|
let selectItem: ((id: string, ev?: any) => void) | ((arg0: never) => void);
|
|
418
418
|
|
|
419
419
|
// convert associated to datapage listtype and transform props
|
package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MySearchbox/repeat-utils.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable sonarjs/no-collapsible-if */
|
|
2
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
2
3
|
/* eslint-disable func-names */
|
|
3
4
|
// @ts-nocheck
|
|
4
5
|
import { splitConditionTree } from '@pega/cosmos-react-condition-builder';
|
|
@@ -267,7 +268,7 @@ export function getDescriptorsFieldName(property, pageClass) {
|
|
|
267
268
|
return property;
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
// eslint-disable-next-line
|
|
271
|
+
// eslint-disable-next-line, sonarjs/cognitive-complexity
|
|
271
272
|
export function preparePatchQueryFields(fields, isDataObject = false, classID = '', getPConnect) {
|
|
272
273
|
const queryFields = [];
|
|
273
274
|
// Descriptors can be configured only for single selectionMode properties
|
package/.eslintrc.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"extends": ["@pega"],
|
|
4
|
-
"ignorePatterns": ["node_modules", "**/template/**"],
|
|
5
|
-
"env": {
|
|
6
|
-
"browser": false,
|
|
7
|
-
"node": true
|
|
8
|
-
},
|
|
9
|
-
"rules": {
|
|
10
|
-
"prettier/prettier": "off",
|
|
11
|
-
"sonarjs/cognitive-complexity": "off",
|
|
12
|
-
"sonarjs/no-identical-functions": "off",
|
|
13
|
-
"sonarjs/no-duplicate-string": "off",
|
|
14
|
-
"sonarjs/no-nested-template-literals": "off",
|
|
15
|
-
"no-console": "off",
|
|
16
|
-
"import/extensions": ["error", "ignorePackages"]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"extends": ["@pega"],
|
|
4
|
-
"parserOptions": {
|
|
5
|
-
"project": "tsconfig.json",
|
|
6
|
-
"ecmaVersion": 13
|
|
7
|
-
},
|
|
8
|
-
"globals": {
|
|
9
|
-
"PCore": "readonly"
|
|
10
|
-
},
|
|
11
|
-
"settings": {
|
|
12
|
-
"import/resolver": {
|
|
13
|
-
"typescript": {},
|
|
14
|
-
"node": {
|
|
15
|
-
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"react": {
|
|
19
|
-
"version": "detect"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"ignorePatterns": [
|
|
23
|
-
"node_modules",
|
|
24
|
-
"packages/*/lib",
|
|
25
|
-
"!.storybook",
|
|
26
|
-
".storybook/public",
|
|
27
|
-
"**/demo.stories.jsx",
|
|
28
|
-
"**/mock.stories.js",
|
|
29
|
-
"**/demo.stories.tsx",
|
|
30
|
-
"**/mock.stories.ts",
|
|
31
|
-
"**/*.mdx"
|
|
32
|
-
],
|
|
33
|
-
"rules": {
|
|
34
|
-
// Prettier recommends running separately from a linter.
|
|
35
|
-
// https://prettier.io/docs/en/integrating-with-linters.html#notes
|
|
36
|
-
"prettier/prettier": "off",
|
|
37
|
-
|
|
38
|
-
// Disable rules from shared configs we're not ready for yet.
|
|
39
|
-
"sonarjs/cognitive-complexity": "off",
|
|
40
|
-
"sonarjs/no-identical-functions": "off",
|
|
41
|
-
"sonarjs/no-duplicate-string": "off",
|
|
42
|
-
"sonarjs/no-nested-template-literals": "off",
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
// JA - Override some default lint handling here
|
|
46
|
-
"@typescript-eslint/array-type": "off",
|
|
47
|
-
// "import/extensions": ["warn", "never"], // Turning off for now (see below)
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
// Initial release: turning these off; phase in to "warn" or "error" over time
|
|
51
|
-
// For "quotes" and "@typescript-eslint/quotes", see override below for .ts/.tsx files
|
|
52
|
-
"import/extensions": ["off", "never"],
|
|
53
|
-
"import/named": "off",
|
|
54
|
-
"import/no-cycle": "off",
|
|
55
|
-
"import/no-duplicates": "off",
|
|
56
|
-
"import/no-extraneous-dependencies": "off",
|
|
57
|
-
"import/no-named-as-default": "off",
|
|
58
|
-
"import/no-named-as-default-member": "off",
|
|
59
|
-
"import/no-self-import": "off",
|
|
60
|
-
"import/no-unresolved": "off",
|
|
61
|
-
"import/no-useless-path-segments": "off",
|
|
62
|
-
"import/order": "off",
|
|
63
|
-
|
|
64
|
-
"no-else-return": "off",
|
|
65
|
-
"no-restricted-syntax": "off",
|
|
66
|
-
"no-underscore-dangle": "off",
|
|
67
|
-
|
|
68
|
-
"jsx-a11y/alt-text": "off",
|
|
69
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
70
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
71
|
-
"jsx-a11y/label-has-associated-control": "off",
|
|
72
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
73
|
-
|
|
74
|
-
"react/jsx-fragments": "off",
|
|
75
|
-
"react/jsx-no-bind": "off",
|
|
76
|
-
"react/self-closing-comp": "off",
|
|
77
|
-
|
|
78
|
-
"sonarjs/prefer-immediate-return": "off",
|
|
79
|
-
|
|
80
|
-
"@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions
|
|
81
|
-
"@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions
|
|
82
|
-
"@typescript-eslint/ban-types": "off", // also, see override below
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
// Initial release: set to error
|
|
86
|
-
"@typescript-eslint/no-inferrable-types": "error",
|
|
87
|
-
"eqeqeq": "off",
|
|
88
|
-
"no-alert": "off",
|
|
89
|
-
"no-console": "error",
|
|
90
|
-
"no-fallthrough": "error",
|
|
91
|
-
"no-undef": "error",
|
|
92
|
-
"no-unused-vars": "off",
|
|
93
|
-
"no-var": "off",
|
|
94
|
-
"yoda": "error",
|
|
95
|
-
"no-irregular-whitespace": "off",
|
|
96
|
-
"no-empty": "off",
|
|
97
|
-
"no-new-object": "off",
|
|
98
|
-
"import/no-relative-packages": "off",
|
|
99
|
-
|
|
100
|
-
"import/no-mutable-exports": "error",
|
|
101
|
-
"sonarjs/max-switch-cases": "error",
|
|
102
|
-
"sonarjs/no-collapsible-if": "error",
|
|
103
|
-
"sonarjs/no-all-duplicated-branches": "error",
|
|
104
|
-
"sonarjs/no-duplicated-branches": "error",
|
|
105
|
-
"sonarjs/no-gratuitous-expressions": "error",
|
|
106
|
-
"sonarjs/no-ignored-return": "error",
|
|
107
|
-
"sonarjs/no-small-switch": "error",
|
|
108
|
-
"sonarjs/prefer-object-literal": "error",
|
|
109
|
-
"sonarjs/prefer-single-boolean-return": "error",
|
|
110
|
-
"@typescript-eslint/no-shadow": "error",
|
|
111
|
-
"react/default-props-match-prop-types": "error",
|
|
112
|
-
"react/no-unescaped-entities": "error",
|
|
113
|
-
"react/no-unused-prop-types": "error",
|
|
114
|
-
"react/static-property-placement": "error",
|
|
115
|
-
"array-callback-return": "error",
|
|
116
|
-
"camelcase": "error",
|
|
117
|
-
"func-names": "error",
|
|
118
|
-
"no-case-declarations": "error",
|
|
119
|
-
"no-lonely-if": "error",
|
|
120
|
-
"no-nested-ternary": "error",
|
|
121
|
-
"no-plusplus": "error",
|
|
122
|
-
"no-restricted-globals": "error",
|
|
123
|
-
"no-restricted-properties": "error",
|
|
124
|
-
"no-shadow": "error",
|
|
125
|
-
"radix": "error",
|
|
126
|
-
"spaced-comment": "error",
|
|
127
|
-
|
|
128
|
-
"import/newline-after-import": "error",
|
|
129
|
-
"sonarjs/no-nested-switch": "error",
|
|
130
|
-
"@typescript-eslint/no-array-constructor": "error",
|
|
131
|
-
"@typescript-eslint/no-empty-function": "error",
|
|
132
|
-
"@typescript-eslint/no-unused-vars": "error",
|
|
133
|
-
"@typescript-eslint/no-useless-constructor": "error",
|
|
134
|
-
"react/button-has-type": "error",
|
|
135
|
-
"react/jsx-curly-brace-presence": "error",
|
|
136
|
-
"react/jsx-boolean-value": "error",
|
|
137
|
-
"react/no-array-index-key": "error",
|
|
138
|
-
"class-methods-use-this": "error",
|
|
139
|
-
"guard-for-in": "error",
|
|
140
|
-
"no-unneeded-ternary": "error",
|
|
141
|
-
"no-unused-expressions": "error",
|
|
142
|
-
"operator-assignment": "error",
|
|
143
|
-
"prefer-template": "error",
|
|
144
|
-
"vars-on-top": "error",
|
|
145
|
-
"prefer-regex-literals": "off",
|
|
146
|
-
|
|
147
|
-
"no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation
|
|
148
|
-
"@typescript-eslint/no-use-before-define": "error"
|
|
149
|
-
},
|
|
150
|
-
"overrides": [
|
|
151
|
-
{
|
|
152
|
-
"files": "*.@(ts|tsx)",
|
|
153
|
-
"rules": {
|
|
154
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
155
|
-
// "@typescript-eslint/ban-types": [
|
|
156
|
-
// "warn",
|
|
157
|
-
// {
|
|
158
|
-
// "types": {
|
|
159
|
-
// "Omit": "Please use the 'OmitStrict' type from 'src/types/' instead.",
|
|
160
|
-
// "object": false,
|
|
161
|
-
// "Function": false
|
|
162
|
-
// },
|
|
163
|
-
// "extendDefaults": true
|
|
164
|
-
// }
|
|
165
|
-
// ],
|
|
166
|
-
|
|
167
|
-
"quotes": "off",
|
|
168
|
-
"@typescript-eslint/quotes": "off"
|
|
169
|
-
// [
|
|
170
|
-
// "error",
|
|
171
|
-
// "single",
|
|
172
|
-
// {
|
|
173
|
-
// "avoidEscape": true,
|
|
174
|
-
// "allowTemplateLiterals": false
|
|
175
|
-
// }
|
|
176
|
-
// ]
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"files": "*.@(jsx|tsx|mdx)",
|
|
181
|
-
"rules": {
|
|
182
|
-
"react/react-in-jsx-scope": "off",
|
|
183
|
-
// Set up configuration for future sweep
|
|
184
|
-
"react-hooks/exhaustive-deps": [
|
|
185
|
-
"off",
|
|
186
|
-
{
|
|
187
|
-
"additionalHooks": "useAfterInitialEffect"
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
// rules for typescript (keeping old rules for js)
|
|
194
|
-
"files": "*.@(ts|tsx)",
|
|
195
|
-
"rules": {
|
|
196
|
-
"no-undef": "error",
|
|
197
|
-
"no-console": "off",
|
|
198
|
-
"import/prefer-default-export": "off",
|
|
199
|
-
"import/no-relative-packages": "off",
|
|
200
|
-
"react/jsx-fragments": "off",
|
|
201
|
-
"react/react-in-jsx-scope": "off",
|
|
202
|
-
// Set up configuration for future sweep
|
|
203
|
-
"react-hooks/exhaustive-deps": [
|
|
204
|
-
"error",
|
|
205
|
-
{
|
|
206
|
-
"additionalHooks": "useAfterInitialEffect"
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
"sonarjs/cognitive-complexity": ["warn", 45]
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
// {
|
|
213
|
-
// "files": "*.@(tsx)",
|
|
214
|
-
// "rules": {
|
|
215
|
-
// "react/react-in-jsx-scope": "off",
|
|
216
|
-
// // Set up configuration for future sweep
|
|
217
|
-
// "react-hooks/exhaustive-deps": [
|
|
218
|
-
// "error",
|
|
219
|
-
// {
|
|
220
|
-
// "additionalHooks": "useAfterInitialEffect"
|
|
221
|
-
// }
|
|
222
|
-
// ]
|
|
223
|
-
// }
|
|
224
|
-
// },
|
|
225
|
-
{
|
|
226
|
-
"files": "*.@(js|jsx|ts|tsx|mdx)",
|
|
227
|
-
"rules": {}
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"files": ".storybook/*.js",
|
|
231
|
-
"extends": ["@pega/eslint-config/script"]
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"files": "*/**/mocks/**.@(mocks|styles).@(tsx|ts)",
|
|
235
|
-
"rules": {
|
|
236
|
-
"import/prefer-default-export": ["off"]
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
]
|
|
240
|
-
}
|