sample react-content-query-online cannot be built, updated to SPFX 1.18.2 and did a few fixes to be abled to build a working sample

This commit is contained in:
Florin DUCA 2024-03-31 14:05:39 +02:00
parent 166e37a008
commit 882ec700ae
39 changed files with 32494 additions and 37333 deletions

View File

@ -0,0 +1,352 @@
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
parserOptions: { tsconfigRootDir: __dirname },
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
'parserOptions': {
'project': './tsconfig.json',
'ecmaVersion': 2018,
'sourceType': 'module'
},
rules: {
// Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin
'@rushstack/no-new-null': 1,
// Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin
'@rushstack/hoist-jest-mock': 1,
// Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security
'@rushstack/security/no-unsafe-regexp': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/adjacent-overload-signatures': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
//
// CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol
'@typescript-eslint/ban-types': [
1,
{
'extendDefaults': false,
'types': {
'String': {
'message': 'Use \'string\' instead',
'fixWith': 'string'
},
'Boolean': {
'message': 'Use \'boolean\' instead',
'fixWith': 'boolean'
},
'Number': {
'message': 'Use \'number\' instead',
'fixWith': 'number'
},
'Object': {
'message': 'Use \'object\' instead, or else define a proper TypeScript type:'
},
'Symbol': {
'message': 'Use \'symbol\' instead',
'fixWith': 'symbol'
},
'Function': {
'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
}
}
}
],
// RATIONALE: Code is more readable when the type of every variable is immediately obvious.
// Even if the compiler may be able to infer a type, this inference will be unavailable
// to a person who is reviewing a GitHub diff. This rule makes writing code harder,
// but writing code is a much less important activity than reading it.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/explicit-function-return-type': [
0,
{
'allowExpressions': true,
'allowTypedFunctionExpressions': true,
'allowHigherOrderFunctions': false
}
],
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: although this is a recommended rule, it is up to dev to select coding style.
// Set to 1 (warning) or 2 (error) to enable.
'@typescript-eslint/explicit-member-accessibility': 0,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-array-constructor': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
//
// RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript.
// This rule should be suppressed only in very special cases such as JSON.stringify()
// where the type really can be anything. Even if the type is flexible, another type
// may be more appropriate such as "unknown", "{}", or "Record<k,V>".
'@typescript-eslint/no-explicit-any': 0,
// RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch()
// handler. Thus wherever a Promise arises, the code must either append a catch handler,
// or else return the object to a caller (who assumes this responsibility). Unterminated
// promise chains are a serious issue. Besides causing errors to be silently ignored,
// they can also cause a NodeJS process to terminate unexpectedly.
'@typescript-eslint/no-floating-promises': 0,
// RATIONALE: Catches a common coding mistake.
'@typescript-eslint/no-for-in-array': 2,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-misused-new': 2,
// RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks
// a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler
// optimizations. If you are declaring loose functions/variables, it's better to make them
// static members of a class, since classes support property getters and their private
// members are accessible by unit tests. Also, the exercise of choosing a meaningful
// class name tends to produce more discoverable APIs: for example, search+replacing
// the function "reverse()" is likely to return many false matches, whereas if we always
// write "Text.reverse()" is more unique. For large scale organization, it's recommended
// to decompose your code into separate NPM packages, which ensures that component
// dependencies are tracked more conscientiously.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-namespace': [
1,
{
'allowDeclarations': false,
'allowDefinitionFiles': false
}
],
// RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)"
// that avoids the effort of declaring "title" as a field. This TypeScript feature makes
// code easier to write, but arguably sacrifices readability: In the notes for
// "@typescript-eslint/member-ordering" we pointed out that fields are central to
// a class's design, so we wouldn't want to bury them in a constructor signature
// just to save some typing.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Set to 1 (warning) or 2 (error) to enable the rule
'@typescript-eslint/parameter-properties': 0,
// RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code
// may impact performance.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-unused-vars': [
0,
{
'vars': 'all',
// Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code,
// the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures
// that are overriding a base class method or implementing an interface.
'args': 'none'
}
],
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-use-before-define': [
2,
{
'functions': false,
'classes': true,
'variables': true,
'enums': true,
'typedefs': true
}
],
// Disallows require statements except in import statements.
// In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports.
'@typescript-eslint/no-var-requires': 'error',
// RATIONALE: The "module" keyword is deprecated except when describing legacy libraries.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/prefer-namespace-keyword': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: it's up to developer to decide if he wants to add type annotations
// Set to 1 (warning) or 2 (error) to enable the rule
'@typescript-eslint/no-inferrable-types': 0,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios
'@typescript-eslint/no-empty-interface': 0,
// RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake.
'accessor-pairs': 1,
// RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking.
'dot-notation': [
1,
{
'allowPattern': '^_'
}
],
// RATIONALE: Catches code that is likely to be incorrect
'eqeqeq': 0,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'for-direction': 1,
// RATIONALE: Catches a common coding mistake.
'guard-for-in': 2,
// RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time
// to split up your code.
'max-lines': ['warn', { max: 2000 }],
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-async-promise-executor': 2,
// RATIONALE: Deprecated language feature.
'no-caller': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-compare-neg-zero': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-cond-assign': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-constant-condition': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-control-regex': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-debugger': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-delete-var': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-duplicate-case': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty-character-class': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty-pattern': 1,
// RATIONALE: Eval is a security concern and a performance concern.
'no-eval': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-ex-assign': 2,
// RATIONALE: System types are global and should not be tampered with in a scalable code base.
// If two different libraries (or two versions of the same library) both try to modify
// a type, only one of them can win. Polyfills are acceptable because they implement
// a standardized interoperable contract, but polyfills are generally coded in plain
// JavaScript.
'no-extend-native': 1,
// Disallow unnecessary labels
'no-extra-label': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-fallthrough': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-func-assign': 1,
// RATIONALE: Catches a common coding mistake.
'no-implied-eval': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-invalid-regexp': 2,
// RATIONALE: Catches a common coding mistake.
'no-label-var': 2,
// RATIONALE: Eliminates redundant code.
'no-lone-blocks': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-misleading-character-class': 2,
// RATIONALE: Catches a common coding mistake.
'no-multi-str': 2,
// RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to
// a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()",
// or else implies that the constructor is doing nontrivial computations, which is often
// a poor class design.
'no-new': 1,
// RATIONALE: Obsolete language feature that is deprecated.
'no-new-func': 2,
// RATIONALE: Obsolete language feature that is deprecated.
'no-new-object': 2,
// RATIONALE: Obsolete notation.
'no-new-wrappers': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-octal': 2,
// RATIONALE: Catches code that is likely to be incorrect
'no-octal-escape': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-regex-spaces': 2,
// RATIONALE: Catches a common coding mistake.
'no-return-assign': 2,
// RATIONALE: Security risk.
'no-script-url': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-self-assign': 2,
// RATIONALE: Catches a common coding mistake.
'no-self-compare': 2,
// RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use
// commas to create compound expressions. In general code is more readable if each
// step is split onto a separate line. This also makes it easier to set breakpoints
// in the debugger.
'no-sequences': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-shadow-restricted-names': 2,
// RATIONALE: Obsolete language feature that is deprecated.
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-sparse-arrays': 2,
// RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception,
// such flexibility adds pointless complexity, by requiring every catch block to test
// the type of the object that it receives. Whereas if catch blocks can always assume
// that their object implements the "Error" contract, then the code is simpler, and
// we generally get useful additional information like a call stack.
'no-throw-literal': 2,
// RATIONALE: Catches a common coding mistake.
'no-unmodified-loop-condition': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-unsafe-finally': 2,
// RATIONALE: Catches a common coding mistake.
'no-unused-expressions': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-unused-labels': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-useless-catch': 1,
// RATIONALE: Avoids a potential performance problem.
'no-useless-concat': 1,
// RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior.
// Always use "let" or "const" instead.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'no-var': 0,
// RATIONALE: Generally not needed in modern code.
'no-void': 1,
// RATIONALE: Obsolete language feature that is deprecated.
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-with': 2,
// RATIONALE: Makes logic easier to understand, since constants always have a known value
// @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js
'prefer-const': 0,
// RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused.
'promise/param-names': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'require-atomic-updates': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'require-yield': 1,
// "Use strict" is redundant when using the TypeScript compiler.
'strict': [
2,
'never'
],
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'use-isnan': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
// Set to 1 (warning) or 2 (error) to enable.
// Rationale to disable: !!{}
'no-extra-boolean-cast': 0,
// ====================================================================
// @microsoft/eslint-plugin-spfx
// ====================================================================
'@microsoft/spfx/import-requires-chunk-name': 1,
'@microsoft/spfx/no-require-ensure': 2,
'@microsoft/spfx/pair-react-dom-render-unmount': 1
}
},
{
// For unit tests, we can be a little bit less strict. The settings below revise the
// defaults specified in the extended configurations, as well as above.
files: [
// Test files
'*.test.ts',
'*.test.tsx',
'*.spec.ts',
'*.spec.tsx',
// Facebook convention
'**/__mocks__/*.ts',
'**/__mocks__/*.tsx',
'**/__tests__/*.ts',
'**/__tests__/*.tsx',
// Microsoft convention
'**/test/*.ts',
'**/test/*.tsx'
],
rules: {}
}
]
};

View File

@ -29,3 +29,6 @@ obj
# Styles Generated Code # Styles Generated Code
*.scss.ts *.scss.ts
.heft
release

View File

@ -1,13 +0,0 @@
{
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-scss"
],
"rules": {
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true,
"selector-pseudo-class-no-unknown": [ true, {
ignorePseudoClasses: ["global"],
}]
}
}

View File

@ -1,12 +1,17 @@
{ {
"@microsoft/generator-sharepoint": { "@microsoft/generator-sharepoint": {
"version": "1.11.0", "version": "1.18.2",
"libraryName": "react-content-query", "libraryName": "react-content-query",
"libraryId": "489c9f8f-8e66-4efb-8365-85279ba91433", "libraryId": "489c9f8f-8e66-4efb-8365-85279ba91433",
"environment": "spo", "environment": "spo",
"isDomainIsolated": false, "isDomainIsolated": false,
"packageManager": "npm", "packageManager": "npm",
"componentType": "webpart", "componentType": "webpart",
"isCreatingSolution": true "isCreatingSolution": true,
"sdkVersions": {
"@microsoft/teams-js": "2.12.0",
"@microsoft/microsoft-graph-client": "3.0.2"
},
"nodeVersion": "18.19.0"
} }
} }

View File

@ -1,4 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy"
}

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/", "workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->", "account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "react-content-query", "container": "react-content-query",
"accessKey": "<!-- ACCESS KEY -->" "accessKey": "<!-- ACCESS KEY -->",
} }

View File

@ -50,7 +50,29 @@
"privacyUrl": "", "privacyUrl": "",
"termsOfUseUrl": "", "termsOfUseUrl": "",
"websiteUrl": "" "websiteUrl": ""
} },
"metadata": {
"shortDescription": {
"default": "react-content-query-webpart description"
},
"longDescription": {
"default": "react-content-query-webpart description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "react-content-query-webpart ContentQueryWebPart Feature",
"description": "The feature that activates ContentQueryWebPart from the react-content-query-webpart solution.",
"id": "ac515af1-4490-4c7b-8191-d49b41b26c5e",
"version": "1.1.0.0",
"componentIds": [
"ac515af1-4490-4c7b-8191-d49b41b26c5e"
]
}
]
}, },
"paths": { "paths": {
"zippedPackage": "solution/react-content-query-webpart.sppkg" "zippedPackage": "solution/react-content-query-webpart.sppkg"

View File

@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}

View File

@ -1,10 +1,6 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321, "port": 4321,
"https": true, "https": true,
"initialPage": "https://localhost:5432/workbench", "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
} }

View File

@ -27,9 +27,9 @@ build.configureWebpack.mergeConfig({
generatedConfiguration.resolve.alias = { handlebars: 'handlebars/dist/handlebars.min.js' }; generatedConfiguration.resolve.alias = { handlebars: 'handlebars/dist/handlebars.min.js' };
generatedConfiguration.module.rules.push( /*generatedConfiguration.module.rules.push(
{ test: /\.js$/, loader: 'unlazy-loader' } { test: /\.js$/, loader: 'unlazy-loader' }
); );*/
generatedConfiguration.node = { generatedConfiguration.node = {
fs: 'empty' fs: 'empty'
@ -39,28 +39,14 @@ build.configureWebpack.mergeConfig({
} }
}); });
/**
* StyleLinter configuration
* Reference and custom gulp task
*/
const stylelint = require('gulp-stylelint');
/* Stylelinter sub task */ var getTasks = build.rig.getTasks;
let styleLintSubTask = build.subTask('stylelint', (gulp) => { build.rig.getTasks = function () {
var result = getTasks.call(build.rig);
console.log('[stylelint]: By default style lint errors will not break your build. If you want to change this behaviour, modify failAfterError parameter in gulpfile.js.'); result.set('serve', result.get('serve-deprecated'));
return gulp
.src('src/**/*.scss')
.pipe(stylelint({
failAfterError: false,
reporters: [{
formatter: 'string',
console: true
}]
}));
});
/* end sub task */
return result;
};
build.initialize(gulp); build.initialize(gulp);

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
{ {
"name": "react-content-query-webpart", "name": "react-content-query-webpart",
"version": "1.1.0", "version": "1.2.0",
"private": true, "private": true,
"main": "lib/index.js",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
}, },
"main": "lib/index.js",
"scripts": { "scripts": {
"build": "gulp bundle", "build": "gulp bundle",
"clean": "gulp clean", "clean": "gulp clean",
@ -14,11 +14,11 @@
"dependencies": { "dependencies": {
"@microsoft/mgt": "^2.0.1", "@microsoft/mgt": "^2.0.1",
"@microsoft/sp-build-web": "1.18.0", "@microsoft/sp-build-web": "1.18.0",
"@microsoft/sp-core-library": "1.11.0", "@microsoft/sp-core-library": "1.18.2",
"@microsoft/sp-lodash-subset": "1.11.0", "@microsoft/sp-lodash-subset": "1.18.2",
"@microsoft/sp-office-ui-fabric-core": "1.11.0", "@microsoft/sp-office-ui-fabric-core": "1.18.2",
"@microsoft/sp-property-pane": "1.11.0", "@microsoft/sp-property-pane": "1.18.2",
"@microsoft/sp-webpart-base": "1.11.0", "@microsoft/sp-webpart-base": "1.18.2",
"@pnp/spfx-controls-react": "2.3.0", "@pnp/spfx-controls-react": "2.3.0",
"@pnp/spfx-property-controls": "2.2.0", "@pnp/spfx-property-controls": "2.2.0",
"@types/handlebars": "4.0.32", "@types/handlebars": "4.0.32",
@ -50,41 +50,39 @@
"morgan": ">=1.9.1", "morgan": ">=1.9.1",
"natives": "^1.1.6", "natives": "^1.1.6",
"node.extend": ">=1.1.7", "node.extend": ">=1.1.7",
"office-ui-fabric-react": "6.214.0",
"open": ">=6.0.0", "open": ">=6.0.0",
"randomatic": ">=3.0.0", "randomatic": ">=3.0.0",
"react": "16.8.5", "react": "17.0.1",
"react-ace": "^5.1.0", "react-dom": "17.0.1",
"react-dom": "16.8.5", "react-ace": "^11.0.1",
"set-value": ">=3.0.3", "set-value": ">=3.0.3",
"sshpk": ">=1.13.2", "sshpk": ">=1.13.2",
"stringstream": ">=0.0.6", "stringstream": ">=0.0.6",
"tar": ">=2.2.2", "tar": ">=2.2.2",
"underscore.string": ">=3.3.5", "underscore.string": ">=3.3.5",
"ws": ">=1.1.5" "ws": ">=1.1.5",
"tslib": "2.3.1",
"@fluentui/react": "^8.106.4"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-4.7": "0.1.0",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@rushstack/eslint-config": "2.5.1",
"@microsoft/sp-module-interfaces": "1.11.0", "@microsoft/eslint-plugin-spfx": "1.18.2",
"@microsoft/sp-tslint-rules": "1.11.0", "@microsoft/eslint-config-spfx": "1.18.2",
"@microsoft/sp-webpart-workbench": "1.12.1", "@microsoft/sp-build-web": "1.18.2",
"@microsoft/sp-module-interfaces": "1.18.2",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/es6-promise": "0.0.33", "@types/es6-promise": "0.0.33",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"@types/react": "16.8.8", "@types/react": "17.0.45",
"@types/react-dom": "16.8.3", "@types/react-dom": "17.0.17",
"@types/webpack-env": "1.13.1", "@types/webpack-env": "1.13.1",
"ajv": "5.2.2", "ajv": "5.2.2",
"awesome-typescript-loader": "^3.2.1", "eslint": "8.7.0",
"gulp": "~3.9.1", "eslint-plugin-react-hooks": "4.3.0",
"gulp": "4.0.2",
"gulp-sequence": "1.0.0", "gulp-sequence": "1.0.0",
"gulp-stylelint": "^13.0.0",
"jest": "^23.6.0", "jest": "^23.6.0",
"stylelint": "14.16.1", "typescript": "4.7.4"
"stylelint-config-standard": "^20.0.0",
"stylelint-scss": "^3.14.2",
"tslint-microsoft-contrib": "^5.0.0",
"unlazy-loader": "^0.1.2"
} }
} }

View File

@ -1,7 +1,7 @@
import * as moment from 'moment'; import * as moment from 'moment';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { isEmpty } from '@microsoft/sp-lodash-subset'; import { isEmpty } from '@microsoft/sp-lodash-subset';
import { IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IPersonaProps, ITag } from '@fluentui/react';
import { IQuerySettings } from '../../webparts/contentQuery/components/IQuerySettings'; import { IQuerySettings } from '../../webparts/contentQuery/components/IQuerySettings';
import { IQueryFilter } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/IQueryFilter'; import { IQueryFilter } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/IQueryFilter';
import { QueryFilterOperator } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/QueryFilterOperator'; import { QueryFilterOperator } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/QueryFilterOperator';

View File

@ -1,5 +1,5 @@
import * as strings from 'contentQueryStrings'; import * as strings from 'contentQueryStrings';
import { IDropdownOption, IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IDropdownOption, IPersonaProps, ITag } from '@fluentui/react';
import { SPHttpClient, SPHttpClientResponse } from '@microsoft/sp-http'; import { SPHttpClient, SPHttpClientResponse } from '@microsoft/sp-http';
import { isEmpty } from '@microsoft/sp-lodash-subset'; import { isEmpty } from '@microsoft/sp-lodash-subset';
import { IWebPartContext } from '@microsoft/sp-webpart-base'; import { IWebPartContext } from '@microsoft/sp-webpart-base';
@ -447,7 +447,7 @@ export class ContentQueryService implements IContentQueryService {
return new Promise<boolean>((resolve, reject) => { return new Promise<boolean>((resolve, reject) => {
this.spHttpClient.get(filePath, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => { this.spHttpClient.get(filePath, SPHttpClient.configurations.v1).then((response: SPHttpClientResponse) => {
if (response.ok) { if (response.ok) {
resolve(); resolve(true);
} }
else { else {
reject(response.statusText); reject(response.statusText);

View File

@ -1,4 +1,4 @@
import { IDropdownOption, IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IDropdownOption, IPersonaProps, ITag } from '@fluentui/react';
import { IQueryFilterField } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/IQueryFilterField'; import { IQueryFilterField } from '../../controls/PropertyPaneQueryFilterPanel/components/QueryFilter/IQueryFilterField';
import { IChecklistItem } from '../../controls/PropertyPaneAsyncChecklist/components/AsyncChecklist/IChecklistItem'; import { IChecklistItem } from '../../controls/PropertyPaneAsyncChecklist/components/AsyncChecklist/IChecklistItem';
import { IContentQueryTemplateContext } from '../../webparts/contentQuery/components/IContentQueryTemplateContext'; import { IContentQueryTemplateContext } from '../../webparts/contentQuery/components/IContentQueryTemplateContext';
@ -23,4 +23,4 @@ export interface IContentQueryService {
clearCachedOrderByOptions: () => void; clearCachedOrderByOptions: () => void;
clearCachedFilterFields: () => void; clearCachedFilterFields: () => void;
clearCachedViewFields: () => void; clearCachedViewFields: () => void;
} }

View File

@ -1,4 +1,3 @@
@import "~office-ui-fabric-react/dist/sass/References.scss";
.checklist { .checklist {
.checklistItems { .checklistItems {

View File

@ -1,7 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { clone } from '@microsoft/sp-lodash-subset'; import { clone } from '@microsoft/sp-lodash-subset';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { Spinner, Label, Checkbox } from 'office-ui-fabric-react'; import { Spinner, Label, Checkbox } from '@fluentui/react';
import { IAsyncChecklistProps } from './IAsyncChecklistProps'; import { IAsyncChecklistProps } from './IAsyncChecklistProps';
import { IAsyncChecklistState } from './IAsyncChecklistState'; import { IAsyncChecklistState } from './IAsyncChecklistState';
import { IChecklistItem } from './IChecklistItem'; import { IChecklistItem } from './IChecklistItem';
@ -10,7 +10,7 @@ import styles from './AsyncChecklist.module.scss';
export class AsyncChecklist extends React.Component<IAsyncChecklistProps, IAsyncChecklistState> { export class AsyncChecklist extends React.Component<IAsyncChecklistProps, IAsyncChecklistState> {
/************************************************************************************* /*************************************************************************************
* Stores the checked items * Stores the checked items
*************************************************************************************/ *************************************************************************************/
private checkedItems: string[]; private checkedItems: string[];
@ -62,7 +62,7 @@ export class AsyncChecklist extends React.Component<IAsyncChecklistProps, IAsync
/************************************************************************************* /*************************************************************************************
* Returns whether the checkbox with the specified ID should be checked or not * Returns whether the checkbox with the specified ID should be checked or not
* @param checkboxId * @param checkboxId
*************************************************************************************/ *************************************************************************************/
private isCheckboxChecked(checkboxId: string) { private isCheckboxChecked(checkboxId: string) {
return (this.checkedItems.filter((checkedItem) => { return checkedItem.toLowerCase().trim() == checkboxId.toLowerCase().trim(); }).length > 0); return (this.checkedItems.filter((checkedItem) => { return checkedItem.toLowerCase().trim() == checkboxId.toLowerCase().trim(); }).length > 0);
@ -140,12 +140,12 @@ export class AsyncChecklist extends React.Component<IAsyncChecklistProps, IAsync
return ( return (
<div className={ styles.checklist }> <div className={ styles.checklist }>
<Label>{ this.props.strings.label }</Label> <Label>{ this.props.strings.label }</Label>
{ loading } { loading }
{ !this.state.loading && { !this.state.loading &&
<div className={ styles.checklistItems }> <div className={ styles.checklistItems }>
<div className={ styles.checklistPadding }>{ checklistItems }</div> <div className={ styles.checklistPadding }>{ checklistItems }</div>
</div> </div>

View File

@ -1,4 +1,4 @@
import { IDropdownOption } from 'office-ui-fabric-react'; import { IDropdownOption } from '@fluentui/react';
export interface IPropertyPaneAsyncDropdownProps { export interface IPropertyPaneAsyncDropdownProps {
label: string; label: string;
@ -8,4 +8,4 @@ export interface IPropertyPaneAsyncDropdownProps {
onPropertyChange: (propertyPath: string, newValue: any) => void; onPropertyChange: (propertyPath: string, newValue: any) => void;
selectedKey?: string | number; selectedKey?: string | number;
disabled?: boolean; disabled?: boolean;
} }

View File

@ -3,7 +3,7 @@ import * as ReactDom from 'react-dom';
import { } from "@microsoft/sp-webpart-base"; import { } from "@microsoft/sp-webpart-base";
import { } from "@microsoft/sp-webpart-base"; import { } from "@microsoft/sp-webpart-base";
import { IPropertyPaneField, PropertyPaneFieldType } from "@microsoft/sp-property-pane"; import { IPropertyPaneField, PropertyPaneFieldType } from "@microsoft/sp-property-pane";
import { IDropdownOption } from 'office-ui-fabric-react'; import { IDropdownOption } from '@fluentui/react';
import { IPropertyPaneAsyncDropdownProps } from './IPropertyPaneAsyncDropdownProps'; import { IPropertyPaneAsyncDropdownProps } from './IPropertyPaneAsyncDropdownProps';
import { IPropertyPaneAsyncDropdownInternalProps } from './IPropertyPaneAsyncDropdownInternalProps'; import { IPropertyPaneAsyncDropdownInternalProps } from './IPropertyPaneAsyncDropdownInternalProps';
import { AsyncDropdown } from './components/AsyncDropdown/AsyncDropdown'; import { AsyncDropdown } from './components/AsyncDropdown/AsyncDropdown';
@ -20,8 +20,8 @@ export class PropertyPaneAsyncDropdown implements IPropertyPaneField<IPropertyPa
/***************************************************************************************** /*****************************************************************************************
* Property pane's contructor * Property pane's contructor
* @param targetProperty * @param targetProperty
* @param properties * @param properties
*****************************************************************************************/ *****************************************************************************************/
constructor(targetProperty: string, properties: IPropertyPaneAsyncDropdownProps) { constructor(targetProperty: string, properties: IPropertyPaneAsyncDropdownProps) {
this.targetProperty = targetProperty; this.targetProperty = targetProperty;
@ -80,4 +80,4 @@ export class PropertyPaneAsyncDropdown implements IPropertyPaneField<IPropertyPa
private onChanged(option: IDropdownOption, index?: number): void { private onChanged(option: IDropdownOption, index?: number): void {
this.properties.onPropertyChange(this.targetProperty, option.key); this.properties.onPropertyChange(this.targetProperty, option.key);
} }
} }

View File

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { Dropdown, IDropdownOption, Spinner } from 'office-ui-fabric-react'; import { Dropdown, IDropdownOption, Spinner } from '@fluentui/react';
import { IAsyncDropdownProps } from './IAsyncDropdownProps'; import { IAsyncDropdownProps } from './IAsyncDropdownProps';
import { IAsyncDropdownState } from './IAsyncDropdownState'; import { IAsyncDropdownState } from './IAsyncDropdownState';
import { cloneDeep } from '@microsoft/sp-lodash-subset'; import { cloneDeep } from '@microsoft/sp-lodash-subset';
@ -10,8 +10,8 @@ export class AsyncDropdown extends React.Component<IAsyncDropdownProps, IAsyncDr
/************************************************************************************* /*************************************************************************************
* Component's constructor * Component's constructor
* @param props * @param props
* @param state * @param state
*************************************************************************************/ *************************************************************************************/
constructor(props: IAsyncDropdownProps, state: IAsyncDropdownState) { constructor(props: IAsyncDropdownProps, state: IAsyncDropdownState) {
super(props); super(props);
@ -102,7 +102,7 @@ export class AsyncDropdown extends React.Component<IAsyncDropdownProps, IAsyncDr
* Renders the the AsyncDropdown component * Renders the the AsyncDropdown component
*************************************************************************************/ *************************************************************************************/
public render() { public render() {
const loading = !this.state.processed ? <Spinner label={this.props.loadingLabel} /> : <div />; const loading = !this.state.processed ? <Spinner label={this.props.loadingLabel} /> : <div />;
const error = this.state.error != null ? <div className="ms-TextField-errorMessage ms-u-slideDownIn20">{ Text.format(this.props.errorLabelFormat, this.state.error) }</div> : <div />; const error = this.state.error != null ? <div className="ms-TextField-errorMessage ms-u-slideDownIn20">{ Text.format(this.props.errorLabelFormat, this.state.error) }</div> : <div />;

View File

@ -1,4 +1,4 @@
import { IDropdownOption } from 'office-ui-fabric-react'; import { IDropdownOption } from '@fluentui/react';
export interface IAsyncDropdownProps { export interface IAsyncDropdownProps {
label: string; label: string;
@ -9,4 +9,4 @@ export interface IAsyncDropdownProps {
selectedKey?: string | number; selectedKey?: string | number;
disabled?: boolean; disabled?: boolean;
stateKey?: string; stateKey?: string;
} }

View File

@ -1,8 +1,8 @@
import { IDropdownOption } from 'office-ui-fabric-react'; import { IDropdownOption } from '@fluentui/react';
export interface IAsyncDropdownState { export interface IAsyncDropdownState {
processed: boolean; processed: boolean;
options: IDropdownOption[]; options: IDropdownOption[];
selectedKey: string | number; selectedKey: string | number;
error: string; error: string;
} }

View File

@ -1,4 +1,4 @@
import { IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IPersonaProps, ITag } from '@fluentui/react';
import { IQueryFilter } from './components/QueryFilter/IQueryFilter'; import { IQueryFilter } from './components/QueryFilter/IQueryFilter';
import { IQueryFilterField } from './components/QueryFilter/IQueryFilterField'; import { IQueryFilterField } from './components/QueryFilter/IQueryFilterField';
import { IQueryFilterPanelStrings } from './components/QueryFilterPanel/IQueryFilterPanelStrings'; import { IQueryFilterPanelStrings } from './components/QueryFilterPanel/IQueryFilterPanelStrings';
@ -12,4 +12,4 @@ export interface IPropertyPaneQueryFilterPanelProps {
trimEmptyFiltersOnChange?: boolean; trimEmptyFiltersOnChange?: boolean;
disabled?: boolean; disabled?: boolean;
strings: IQueryFilterPanelStrings; strings: IQueryFilterPanelStrings;
} }

View File

@ -1,7 +1,7 @@
import { IQueryFilterField } from './IQueryFilterField'; import { IQueryFilterField } from './IQueryFilterField';
import { QueryFilterOperator } from './QueryFilterOperator'; import { QueryFilterOperator } from './QueryFilterOperator';
import { QueryFilterJoin } from './QueryFilterJoin'; import { QueryFilterJoin } from './QueryFilterJoin';
import { IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IPersonaProps, ITag } from '@fluentui/react';
export interface IQueryFilter { export interface IQueryFilter {
index: number; index: number;
@ -12,4 +12,4 @@ export interface IQueryFilter {
includeTime?: boolean; includeTime?: boolean;
me?: boolean; me?: boolean;
join: QueryFilterJoin; join: QueryFilterJoin;
} }

View File

@ -1,4 +1,4 @@
import { IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IPersonaProps, ITag } from '@fluentui/react';
import { IQueryFilter } from './IQueryFilter'; import { IQueryFilter } from './IQueryFilter';
import { IQueryFilterField } from './IQueryFilterField'; import { IQueryFilterField } from './IQueryFilterField';
import { IQueryFilterStrings } from './IQueryFilterStrings'; import { IQueryFilterStrings } from './IQueryFilterStrings';
@ -12,4 +12,4 @@ export interface IQueryFilterProps {
onChanged?: (filter: IQueryFilter) => void; onChanged?: (filter: IQueryFilter) => void;
disabled?: boolean; disabled?: boolean;
strings: IQueryFilterStrings; strings: IQueryFilterStrings;
} }

View File

@ -1,4 +1,4 @@
import { IDatePickerStrings } from 'office-ui-fabric-react'; import { IDatePickerStrings } from '@fluentui/react';
export interface IQueryFilterStrings { export interface IQueryFilterStrings {
fieldLabel: string; fieldLabel: string;
@ -33,4 +33,4 @@ export interface IQueryFilterStrings {
datePickerDatePlaceholder: string; datePickerDatePlaceholder: string;
datePickerExpressionPlaceholder: string; datePickerExpressionPlaceholder: string;
datePickerIncludeTime: string; datePickerIncludeTime: string;
} }

View File

@ -1,4 +1,4 @@
@import "~office-ui-fabric-react/dist/sass/References.scss"; @import '~@fluentui/react/dist/sass/References.scss';
.queryFilter { .queryFilter {
background-color: transparent; background-color: transparent;

View File

@ -2,10 +2,10 @@ import * as React
import * as moment from 'moment'; import * as moment from 'moment';
import { cloneDeep, isEmpty } from '@microsoft/sp-lodash-subset'; import { cloneDeep, isEmpty } from '@microsoft/sp-lodash-subset';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { Dropdown, IDropdownOption, TextField, ChoiceGroup, IChoiceGroupOption } from 'office-ui-fabric-react'; import { Dropdown, IDropdownOption, TextField, ChoiceGroup, IChoiceGroupOption } from '@fluentui/react';
import { NormalPeoplePicker, IPersonaProps, IBasePickerSuggestionsProps, Label } from 'office-ui-fabric-react'; import { NormalPeoplePicker, IPersonaProps, IBasePickerSuggestionsProps, Label } from '@fluentui/react';
import { TagPicker, ITag } from 'office-ui-fabric-react'; import { TagPicker, ITag } from '@fluentui/react';
import { DatePicker, Checkbox } from 'office-ui-fabric-react'; import { DatePicker, Checkbox } from '@fluentui/react';
import { IQueryFilter } from './IQueryFilter'; import { IQueryFilter } from './IQueryFilter';
import { QueryFilterOperator } from './QueryFilterOperator'; import { QueryFilterOperator } from './QueryFilterOperator';
import { QueryFilterJoin } from './QueryFilterJoin'; import { QueryFilterJoin } from './QueryFilterJoin';
@ -17,26 +17,26 @@ import styles
export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilterState> { export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilterState> {
/************************************************************************************* /*************************************************************************************
* Stores the IQueryFilter config of the current filter * Stores the IQueryFilter config of the current filter
*************************************************************************************/ *************************************************************************************/
private filter:IQueryFilter; private filter:IQueryFilter;
/************************************************************************************* /*************************************************************************************
* Component's constructor * Component's constructor
* @param props * @param props
* @param state * @param state
*************************************************************************************/ *************************************************************************************/
constructor(props: IQueryFilterProps, state: IQueryFilterState) { constructor(props: IQueryFilterProps, state: IQueryFilterState) {
super(props); super(props);
moment.locale(this.props.strings.datePickerLocale); moment.locale(this.props.strings.datePickerLocale);
this.state = { this.state = {
filter: (this.props.filter ? cloneDeep(this.props.filter) : { index: 0, field: null, operator: QueryFilterOperator.Eq, value: '', join: QueryFilterJoin.Or }), filter: (this.props.filter ? cloneDeep(this.props.filter) : { index: 0, field: null, operator: QueryFilterOperator.Eq, value: '', join: QueryFilterJoin.Or }),
pickersKey: Math.random() pickersKey: Math.random()
}; };
this.onAnyChange = this.onAnyChange.bind(this); this.onAnyChange = this.onAnyChange.bind(this);
} }
@ -44,7 +44,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
/************************************************************************************* /*************************************************************************************
* When the field Dropdown changes * When the field Dropdown changes
*************************************************************************************/ *************************************************************************************/
private onFieldDropdownChange(option: IDropdownOption, index?: number) { private onFieldDropdownChange(event: React.FormEvent<HTMLDivElement>, option?: IDropdownOption, index?: number) {
let field = this.props.fields.filter((f) => { return f.internalName == option.key; }); let field = this.props.fields.filter((f) => { return f.internalName == option.key; });
this.state.filter.field = field != null && field.length > 0 ? field[0] : null; this.state.filter.field = field != null && field.length > 0 ? field[0] : null;
this.state.filter.operator = (this.state.filter.field && (this.state.filter.field.type == QueryFilterFieldType.User || this.state.filter.field.type == QueryFilterFieldType.Taxonomy) ? QueryFilterOperator.ContainsAny : QueryFilterOperator.Eq); this.state.filter.operator = (this.state.filter.field && (this.state.filter.field.type == QueryFilterFieldType.User || this.state.filter.field.type == QueryFilterFieldType.Taxonomy) ? QueryFilterOperator.ContainsAny : QueryFilterOperator.Eq);
@ -60,7 +60,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
/************************************************************************************* /*************************************************************************************
* When the operator Dropdown changes * When the operator Dropdown changes
*************************************************************************************/ *************************************************************************************/
private onOperatorDropdownChange(option: IDropdownOption, index?: number) { private onOperatorDropdownChange(event: React.FormEvent<HTMLDivElement>, option?: IDropdownOption, index?: number) {
this.state.filter.operator = QueryFilterOperator[option.key]; this.state.filter.operator = QueryFilterOperator[option.key];
this.setState({ filter: this.state.filter, pickersKey: this.state.pickersKey }); this.setState({ filter: this.state.filter, pickersKey: this.state.pickersKey });
this.onAnyChange(); this.onAnyChange();
@ -70,7 +70,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
/************************************************************************************* /*************************************************************************************
* When the TextField value changes * When the TextField value changes
*************************************************************************************/ *************************************************************************************/
private onValueTextFieldChange(newValue: string): string { private onValueTextFieldChange(event: React.FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string): string {
if(this.state.filter.value != newValue) { if(this.state.filter.value != newValue) {
this.state.filter.value = newValue; this.state.filter.value = newValue;
this.onAnyChange(); this.onAnyChange();
@ -118,7 +118,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
this.setState({ filter: this.state.filter, pickersKey: this.state.pickersKey }); this.setState({ filter: this.state.filter, pickersKey: this.state.pickersKey });
this.onAnyChange(); this.onAnyChange();
} }
/************************************************************************************* /*************************************************************************************
* When the date expression text field value changes * When the date expression text field value changes
@ -129,7 +129,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
let regex = new RegExp(/^\[Today\](\s{0,}[\+-]\s{0,}\[{0,1}\d{1,4}\]{0,1}){0,1}$/); let regex = new RegExp(/^\[Today\](\s{0,}[\+-]\s{0,}\[{0,1}\d{1,4}\]{0,1}){0,1}$/);
let isValid = regex.test(newValue) || isEmpty(newValue); let isValid = regex.test(newValue) || isEmpty(newValue);
let errorMsg = isValid ? '' : this.props.strings.datePickerExpressionError; let errorMsg = isValid ? '' : this.props.strings.datePickerExpressionError;
if(isValid) { if(isValid) {
// If the change is NOT triggered by the date picker change // If the change is NOT triggered by the date picker change
if(!(isEmpty(newValue) && this.state.filter.value != null)) { if(!(isEmpty(newValue) && this.state.filter.value != null)) {
@ -240,11 +240,18 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
* Returns the options for the operator Dropdown component * Returns the options for the operator Dropdown component
*************************************************************************************/ *************************************************************************************/
private getJoinGroupOptions(): IChoiceGroupOption[] { private getJoinGroupOptions(): IChoiceGroupOption[] {
/*
let options:IChoiceGroupOption[] = [ let options:IChoiceGroupOption[] = [
{ key: QueryFilterJoin[QueryFilterJoin.And], text: this.props.strings.andLabel, checked: (this.state.filter.join == QueryFilterJoin.And) }, { key: QueryFilterJoin[QueryFilterJoin.And], text: this.props.strings.andLabel, checked: (this.state.filter.join == QueryFilterJoin.And) },
{ key: QueryFilterJoin[QueryFilterJoin.Or], text: this.props.strings.orLabel, checked: (this.state.filter.join == QueryFilterJoin.Or) } { key: QueryFilterJoin[QueryFilterJoin.Or], text: this.props.strings.orLabel, checked: (this.state.filter.join == QueryFilterJoin.Or) }
]; ];
return options; return options;
*/
let options:IChoiceGroupOption[] = [
{ key: QueryFilterJoin[QueryFilterJoin.And], text: this.props.strings.andLabel},
{ key: QueryFilterJoin[QueryFilterJoin.Or], text: this.props.strings.orLabel}
];
return options;
} }
@ -338,20 +345,21 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
<div className={styles.paddingContainer}> <div className={styles.paddingContainer}>
<Dropdown label={this.props.strings.fieldLabel} <Dropdown label={this.props.strings.fieldLabel}
disabled={this.props.disabled} disabled={this.props.disabled}
onChanged={this.onFieldDropdownChange.bind(this)} onChange={this.onFieldDropdownChange.bind(this)}
selectedKey={filterFieldKey} selectedKey={filterFieldKey}
options={this.getFieldDropdownOptions()} /> options={this.getFieldDropdownOptions()} />
<Dropdown label={this.props.strings.operatorLabel} <Dropdown label={this.props.strings.operatorLabel}
disabled={this.props.disabled} disabled={this.props.disabled}
onChanged={this.onOperatorDropdownChange.bind(this)} onChange={this.onOperatorDropdownChange.bind(this)}
selectedKey={QueryFilterOperator[this.state.filter.operator]} selectedKey={QueryFilterOperator[this.state.filter.operator]}
options={this.getOperatorDropdownOptions()} /> options={this.getOperatorDropdownOptions()} />
{ showTextField && { showTextField &&
<TextField label={this.props.strings.valueLabel} <TextField label={this.props.strings.valueLabel}
disabled={this.props.disabled} disabled={this.props.disabled}
onGetErrorMessage={ this.onValueTextFieldChange.bind(this) } //onGetErrorMessage={ this.onValueTextFieldChange.bind(this) }
onChange={this.onValueTextFieldChange.bind(this)}
deferredValidationTime={500} deferredValidationTime={500}
value={ this.state.filter.value != null ? this.state.filter.value as string : '' } /> value={ this.state.filter.value != null ? this.state.filter.value as string : '' } />
} }
@ -390,7 +398,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
{ showDatePicker && { showDatePicker &&
<div> <div>
<DatePicker <DatePicker
label={ this.props.strings.valueLabel } label={ this.props.strings.valueLabel }
placeholder={ this.props.strings.datePickerDatePlaceholder } placeholder={ this.props.strings.datePickerDatePlaceholder }
allowTextInput={ true } allowTextInput={ true }
@ -399,7 +407,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
parseDateFromString={ this.onDatePickerParse.bind(this) } parseDateFromString={ this.onDatePickerParse.bind(this) }
onSelectDate={ this.onDatePickerChange.bind(this) } onSelectDate={ this.onDatePickerChange.bind(this) }
strings={ this.props.strings.datePickerStrings } /> strings={ this.props.strings.datePickerStrings } />
<TextField <TextField
placeholder={ this.props.strings.datePickerExpressionPlaceholder } placeholder={ this.props.strings.datePickerExpressionPlaceholder }
onGetErrorMessage={ this.onDateExpressionChange.bind(this) } onGetErrorMessage={ this.onDateExpressionChange.bind(this) }
deferredValidationTime={ 500 } deferredValidationTime={ 500 }
@ -411,7 +419,7 @@ export class QueryFilter extends React.Component<IQueryFilterProps, IQueryFilter
</div> </div>
} }
<ChoiceGroup options={this.getJoinGroupOptions()} <ChoiceGroup options={this.getJoinGroupOptions()}
onChange={this.onJoinChoiceChange.bind(this)} onChange={this.onJoinChoiceChange.bind(this)}
disabled={this.props.disabled} /> disabled={this.props.disabled} />
</div> </div>

View File

@ -1,4 +1,4 @@
import { IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IPersonaProps, ITag } from '@fluentui/react';
import { IQueryFilter } from '../QueryFilter/IQueryFilter'; import { IQueryFilter } from '../QueryFilter/IQueryFilter';
import { IQueryFilterField } from '../QueryFilter/IQueryFilterField'; import { IQueryFilterField } from '../QueryFilter/IQueryFilterField';
import { IQueryFilterPanelStrings } from './IQueryFilterPanelStrings'; import { IQueryFilterPanelStrings } from './IQueryFilterPanelStrings';
@ -13,4 +13,4 @@ export interface IQueryFilterPanelProps {
trimEmptyFiltersOnChange?: boolean; trimEmptyFiltersOnChange?: boolean;
strings: IQueryFilterPanelStrings; strings: IQueryFilterPanelStrings;
stateKey?: string; stateKey?: string;
} }

View File

@ -1,4 +1,4 @@
@import "~office-ui-fabric-react/dist/sass/References.scss"; @import '~@fluentui/react/dist/sass/References.scss';
.queryFilterPanel { .queryFilterPanel {
.queryFilterPanelItems { .queryFilterPanelItems {

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import { cloneDeep } from '@microsoft/sp-lodash-subset'; import { cloneDeep } from '@microsoft/sp-lodash-subset';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { isEmpty } from '@microsoft/sp-lodash-subset'; import { isEmpty } from '@microsoft/sp-lodash-subset';
import { Spinner, CommandButton, ButtonType, Label } from 'office-ui-fabric-react'; import { Spinner, CommandButton, ButtonType, Label } from '@fluentui/react';
import { QueryFilter } from '../QueryFilter/QueryFilter'; import { QueryFilter } from '../QueryFilter/QueryFilter';
import { IQueryFilter } from '../QueryFilter/IQueryFilter'; import { IQueryFilter } from '../QueryFilter/IQueryFilter';
import { QueryFilterOperator } from '../QueryFilter/QueryFilterOperator'; import { QueryFilterOperator } from '../QueryFilter/QueryFilterOperator';

View File

@ -1,4 +1,4 @@
@import "~office-ui-fabric-react/dist/sass/References.scss"; @import '~@fluentui/react/dist/sass/References.scss';
.ace_editor.ace_autocomplete { .ace_editor.ace_autocomplete {
z-index: 2000000 !important; z-index: 2000000 !important;

View File

@ -1,3 +1,4 @@
@import '~@fluentui/react/dist/sass/References.scss';
.textDialog { .textDialog {
max-width: 100%; max-width: 100%;
} }

View File

@ -1,7 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { Dialog, DialogType, DialogFooter } from 'office-ui-fabric-react'; import { Dialog, DialogType, DialogFooter } from '@fluentui/react';
import { Button, ButtonType, Label } from 'office-ui-fabric-react'; import { Button, ButtonType, Label } from '@fluentui/react';
import { TextField } from 'office-ui-fabric-react'; import { TextField } from '@fluentui/react';
import { ITextDialogProps } from './ITextDialogProps'; import { ITextDialogProps } from './ITextDialogProps';
import { ITextDialogState } from './ITextDialogState'; import { ITextDialogState } from './ITextDialogState';
import AceEditor from 'react-ace'; import AceEditor from 'react-ace';
@ -17,8 +17,8 @@ export class TextDialog extends React.Component<ITextDialogProps, ITextDialogSta
/************************************************************************************* /*************************************************************************************
* Component's constructor * Component's constructor
* @param props * @param props
* @param state * @param state
*************************************************************************************/ *************************************************************************************/
constructor(props: ITextDialogProps, state: ITextDialogState) { constructor(props: ITextDialogProps, state: ITextDialogState) {
super(props); super(props);
@ -79,7 +79,7 @@ export class TextDialog extends React.Component<ITextDialogProps, ITextDialogSta
return ( return (
<div> <div>
<Label>{ this.props.strings.dialogButtonLabel }</Label> <Label>{ this.props.strings.dialogButtonLabel }</Label>
<Button label={ this.props.strings.dialogButtonLabel } onClick={ this.showDialog.bind(this) }>{ this.props.strings.dialogButtonText }</Button> <Button label={ this.props.strings.dialogButtonLabel } onClick={ this.showDialog.bind(this) }>{ this.props.strings.dialogButtonText }</Button>
<Dialog type={ DialogType.normal } <Dialog type={ DialogType.normal }
@ -89,7 +89,7 @@ export class TextDialog extends React.Component<ITextDialogProps, ITextDialogSta
subText={ this.props.strings.dialogSubText } subText={ this.props.strings.dialogSubText }
isBlocking={ true } isBlocking={ true }
containerClassName={ 'ms-dialogMainOverride ' + styles.textDialog }> containerClassName={ 'ms-dialogMainOverride ' + styles.textDialog }>
<AceEditor <AceEditor
width="100%" width="100%"
mode="html" mode="html"

View File

@ -11,7 +11,7 @@ import { IPropertyPaneToggleProps, PropertyPaneToggle } from "@microsoft/sp-prop
import { IPropertyPaneLabelProps, PropertyPaneLabel } from "@microsoft/sp-property-pane"; import { IPropertyPaneLabelProps, PropertyPaneLabel } from "@microsoft/sp-property-pane";
import { IPropertyPaneButtonProps, PropertyPaneButton, PropertyPaneButtonType } from "@microsoft/sp-property-pane"; import { IPropertyPaneButtonProps, PropertyPaneButton, PropertyPaneButtonType } from "@microsoft/sp-property-pane";
import { update, get, isEmpty } from '@microsoft/sp-lodash-subset'; import { update, get, isEmpty } from '@microsoft/sp-lodash-subset';
import { IDropdownOption, IPersonaProps, ITag } from 'office-ui-fabric-react'; import { IDropdownOption, IPersonaProps, ITag } from '@fluentui/react';
import ContentQuery from './components/ContentQuery'; import ContentQuery from './components/ContentQuery';
import { IContentQueryProps } from './components/IContentQueryProps'; import { IContentQueryProps } from './components/IContentQueryProps';
import { IQuerySettings } from './components/IQuerySettings'; import { IQuerySettings } from './components/IQuerySettings';

View File

@ -1,7 +1,7 @@
@import "~office-ui-fabric-react/dist/sass/References.scss"; @import '~@fluentui/react/dist/sass/References.scss';
.cqwp { .cqwp {
.cqwpValidations { .cqwpValidations {
padding-top: 0; padding-top: 0;
padding-left: 20px; padding-left: 20px;

View File

@ -1,7 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import * as Handlebars from "handlebars"; import * as Handlebars from "handlebars";
import * as strings from 'contentQueryStrings'; import * as strings from 'contentQueryStrings';
import { Spinner } from 'office-ui-fabric-react'; import { Spinner } from '@fluentui/react';
import { isEmpty } from '@microsoft/sp-lodash-subset'; import { isEmpty } from '@microsoft/sp-lodash-subset';
import { Text } from '@microsoft/sp-core-library'; import { Text } from '@microsoft/sp-core-library';
import { IContentQueryProps } from './IContentQueryProps'; import { IContentQueryProps } from './IContentQueryProps';
@ -10,7 +10,7 @@ import { IContentQueryTemplateContext } from './IContentQueryTemplat
import { SPComponentLoader } from '@microsoft/sp-loader'; import { SPComponentLoader } from '@microsoft/sp-loader';
import styles from './ContentQuery.module.scss'; import styles from './ContentQuery.module.scss';
import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder"; import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder";
import { Icon } from 'office-ui-fabric-react/lib/components/Icon'; import { Icon } from '@fluentui/react';
import { IMandatoryFieldsStatus } from './IMandatoryFieldsStatus'; import { IMandatoryFieldsStatus } from './IMandatoryFieldsStatus';
import { IReadonlyTheme } from '@microsoft/sp-component-base'; import { IReadonlyTheme } from '@microsoft/sp-component-base';
@ -80,7 +80,7 @@ export default class ContentQuery extends React.Component<IContentQueryProps, IC
}); });
} }
else { else {
resolve(); resolve(null);
} }
} }
next(); next();

View File

@ -1,6 +1,7 @@
{ {
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json", "extends": "./node_modules/@microsoft/rush-stack-compiler-4.7/includes/tsconfig-web.json",
"compilerOptions": { "compilerOptions": {
"noImplicitAny": false,
"target": "es5", "target": "es5",
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"module": "esnext", "module": "esnext",
@ -25,15 +26,12 @@
"lib": [ "lib": [
"es5", "es5",
"dom", "dom",
"es2015.collection" "es2015.collection",
"es2015.promise"
] ]
}, },
"include": [ "include": [
"src/**/*.ts", "src/**/*.ts",
"src/**/*.tsx" "src/**/*.tsx"
],
"exclude": [
"node_modules",
"lib"
] ]
} }

View File

@ -1,26 +0,0 @@
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json",
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"variable-name": false,
"whitespace": false
}
}