@kwiz/fluentui 1.0.74 → 1.0.76
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/.github/workflows/npm-publish.yml +24 -24
- package/LICENSE +21 -21
- package/README.md +53 -53
- package/dist/@types/forwardRef.d.ts +0 -0
- package/dist/@types/forwardRef.js +1 -0
- package/dist/@types/forwardRef.js.map +1 -0
- package/dist/controls/error-boundary copy.d.ts +23 -0
- package/dist/controls/error-boundary copy.js +33 -0
- package/dist/controls/error-boundary copy.js.map +1 -0
- package/dist/controls/menu.d.ts +3 -1
- package/dist/controls/menu.js +44 -26
- package/dist/controls/menu.js.map +1 -1
- package/dist/controls/search.js +19 -11
- package/dist/controls/search.js.map +1 -1
- package/dist/controls/svg.js +21 -21
- package/dist/controls/svg.js.map +1 -1
- package/dist/helpers/common.d.ts +4 -0
- package/dist/helpers/common.js +2 -0
- package/dist/helpers/common.js.map +1 -0
- package/dist/helpers/context.d.ts +26 -0
- package/dist/helpers/context.js +15 -0
- package/dist/helpers/context.js.map +1 -0
- package/dist/helpers/drag-drop/exports.d.ts +12 -0
- package/dist/helpers/drag-drop/exports.js +3 -0
- package/dist/helpers/drag-drop/exports.js.map +1 -0
- package/dist/helpers/exports.d.ts +7 -0
- package/dist/helpers/exports.js +8 -0
- package/dist/helpers/exports.js.map +1 -0
- package/dist/helpers/hooks.d.ts +3 -1
- package/dist/helpers/hooks.js +18 -0
- package/dist/helpers/hooks.js.map +1 -1
- package/package.json +85 -84
- package/src/_modules/config.ts +9 -9
- package/src/_modules/constants.ts +3 -3
- package/src/controls/ColorPickerDialog.tsx +83 -83
- package/src/controls/accordion.tsx +62 -62
- package/src/controls/button.tsx +180 -180
- package/src/controls/canvas/CustomEventTargetBase.ts +32 -32
- package/src/controls/canvas/DrawPad.tsx +296 -296
- package/src/controls/canvas/DrawPadManager.ts +694 -694
- package/src/controls/canvas/bezier.ts +109 -109
- package/src/controls/canvas/point.ts +44 -44
- package/src/controls/card-list.tsx +31 -31
- package/src/controls/card.tsx +77 -77
- package/src/controls/centered.tsx +14 -14
- package/src/controls/date.tsx +87 -87
- package/src/controls/diagram-picker.tsx +96 -96
- package/src/controls/divider.tsx +15 -15
- package/src/controls/dropdown.tsx +66 -66
- package/src/controls/error-boundary.tsx +41 -41
- package/src/controls/field-editor.tsx +42 -42
- package/src/controls/file-upload.tsx +155 -155
- package/src/controls/horizontal.tsx +48 -48
- package/src/controls/html-editor/editor.tsx +182 -182
- package/src/controls/index.ts +33 -33
- package/src/controls/input.tsx +160 -160
- package/src/controls/kwizoverflow.tsx +106 -106
- package/src/controls/list.tsx +119 -119
- package/src/controls/loading.tsx +10 -10
- package/src/controls/menu.tsx +195 -173
- package/src/controls/merge-text.tsx +126 -126
- package/src/controls/please-wait.tsx +32 -32
- package/src/controls/progress-bar.tsx +109 -109
- package/src/controls/prompt.tsx +121 -121
- package/src/controls/qrcode.tsx +36 -36
- package/src/controls/search.tsx +71 -61
- package/src/controls/section.tsx +133 -133
- package/src/controls/svg.tsx +138 -138
- package/src/controls/toolbar.tsx +46 -46
- package/src/controls/vertical-content.tsx +49 -49
- package/src/controls/vertical.tsx +42 -42
- package/src/helpers/block-nav.tsx +88 -88
- package/src/helpers/context-const.ts +29 -29
- package/src/helpers/context-export.tsx +77 -77
- package/src/helpers/context-internal.ts +13 -13
- package/src/helpers/drag-drop/drag-drop-container.tsx +53 -53
- package/src/helpers/drag-drop/drag-drop-context-internal.tsx +9 -9
- package/src/helpers/drag-drop/drag-drop-context.tsx +61 -61
- package/src/helpers/drag-drop/drag-drop.types.ts +21 -21
- package/src/helpers/drag-drop/index.ts +12 -12
- package/src/helpers/drag-drop/readme.md +75 -75
- package/src/helpers/drag-drop/use-draggable.ts +47 -47
- package/src/helpers/drag-drop/use-droppable.ts +38 -38
- package/src/helpers/forwardRef.ts +7 -7
- package/src/helpers/hooks-events.ts +149 -149
- package/src/helpers/hooks.tsx +162 -141
- package/src/helpers/index.ts +8 -8
- package/src/helpers/use-alerts.tsx +74 -74
- package/src/helpers/use-editable-control.tsx +37 -37
- package/src/helpers/use-toast.tsx +29 -29
- package/src/index.ts +2 -2
- package/src/styles/index.ts +1 -1
- package/src/styles/styles.ts +104 -104
- package/src/styles/theme.ts +90 -90
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/helpers/common.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from "react";
|
2
|
+
export interface iKWIZFluentContext {
|
3
|
+
/**
|
4
|
+
* Where the portal children are mounted on DOM
|
5
|
+
*
|
6
|
+
* @default a new element on document.body without any styling
|
7
|
+
*/
|
8
|
+
mountNode?: HTMLElement | null | {
|
9
|
+
element?: HTMLElement | null;
|
10
|
+
className?: string;
|
11
|
+
};
|
12
|
+
/**
|
13
|
+
* Controls the colors and borders of the input.
|
14
|
+
*
|
15
|
+
* @default 'underline'
|
16
|
+
*/
|
17
|
+
inputAppearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';
|
18
|
+
/**
|
19
|
+
* A button can be rounded, circular, or square.
|
20
|
+
*
|
21
|
+
* @default 'rounded'
|
22
|
+
*/
|
23
|
+
buttonShape?: 'rounded' | 'circular' | 'square';
|
24
|
+
}
|
25
|
+
export declare const KWIZFluentContext: React.Context<iKWIZFluentContext>;
|
26
|
+
export declare function useKWIZFluentContext(): iKWIZFluentContext;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { isNullOrUndefined } from "@kwiz/common";
|
2
|
+
import React from "react";
|
3
|
+
//create context
|
4
|
+
export const KWIZFluentContext = React.createContext(null);
|
5
|
+
//use context from within controls
|
6
|
+
export function useKWIZFluentContext() {
|
7
|
+
let ctx = React.useContext(KWIZFluentContext) || {};
|
8
|
+
//set defaults
|
9
|
+
if (isNullOrUndefined(ctx.inputAppearance))
|
10
|
+
ctx.inputAppearance = "underline";
|
11
|
+
if (isNullOrUndefined(ctx.buttonShape))
|
12
|
+
ctx.buttonShape = "circular";
|
13
|
+
return ctx;
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=context.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/helpers/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAqB,IAAI,CAAC,CAAC;AAC/E,kCAAkC;AAClC,MAAM,UAAU,oBAAoB;IAChC,IAAI,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACpD,cAAc;IACd,IAAI,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;QACtC,GAAG,CAAC,eAAe,GAAG,WAAW,CAAC;IACtC,IAAI,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC;QAClC,GAAG,CAAC,WAAW,GAAG,UAAU,CAAC;IACjC,OAAO,GAAG,CAAC;AACf,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { NativeTypes } from 'react-dnd-html5-backend';
|
2
|
+
import { iDraggedItemType } from './use-draggable';
|
3
|
+
import { iDroppableProps } from './use-droppable';
|
4
|
+
export { DragDropContainer } from './drag-drop-container';
|
5
|
+
export { DragDropContextProvider, useDragDropContext } from "./drag-drop-context";
|
6
|
+
export type { iDraggedItemType } from "./use-draggable";
|
7
|
+
export type { iDroppableProps } from "./use-droppable";
|
8
|
+
type fileNativeType = typeof NativeTypes.FILE;
|
9
|
+
interface dragFiles extends iDraggedItemType<fileNativeType> {
|
10
|
+
files: FileList;
|
11
|
+
}
|
12
|
+
export type dropFiles = iDroppableProps<fileNativeType, dragFiles>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../src/helpers/drag-drop/exports.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/helpers/exports.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
package/dist/helpers/hooks.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { MutableRefObject, SetStateAction } from "react";
|
1
|
+
import { HTMLAttributes, MutableRefObject, SetStateAction } from "react";
|
2
2
|
/** Empty array ensures that effect is only run on mount */
|
3
3
|
export declare const useEffectOnlyOnMount: any[];
|
4
4
|
type stateExOptions<ValueType> = {
|
@@ -21,4 +21,6 @@ export declare function useRefWithState<T>(initialValue?: T, stateOptions?: stat
|
|
21
21
|
/** for setting on element: ref={e.set} */
|
22
22
|
set: (newValue: T) => void;
|
23
23
|
};
|
24
|
+
/** return props to make div appear as clickable, and accept enter key as click */
|
25
|
+
export declare function useClickableDiv(): HTMLAttributes<HTMLDivElement>;
|
24
26
|
export {};
|
package/dist/helpers/hooks.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
import { makeStyles } from "@fluentui/react-components";
|
1
2
|
import { isFunction, isNotEmptyArray, isNullOrEmptyString, isPrimitiveValue, jsonClone, jsonStringify, LoggerLevel, objectsEqual, wrapFunction } from "@kwiz/common";
|
2
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
3
4
|
import { GetLogger } from "../_modules/config";
|
5
|
+
import { mixins } from "../styles/styles";
|
4
6
|
/** Empty array ensures that effect is only run on mount */
|
5
7
|
export const useEffectOnlyOnMount = [];
|
6
8
|
function extractStringValue(e) {
|
@@ -123,4 +125,20 @@ export function useRefWithState(initialValue, stateOptions = { skipUpdateIfSame:
|
|
123
125
|
set: setRef
|
124
126
|
};
|
125
127
|
}
|
128
|
+
const useStyles = makeStyles({
|
129
|
+
clickable: mixins.clickable,
|
130
|
+
});
|
131
|
+
/** return props to make div appear as clickable, and accept enter key as click */
|
132
|
+
export function useClickableDiv() {
|
133
|
+
const cssNames = useStyles();
|
134
|
+
const props = {
|
135
|
+
className: cssNames.clickable,
|
136
|
+
tabIndex: 0,
|
137
|
+
onKeyDown: e => {
|
138
|
+
if (e.key === "Enter")
|
139
|
+
e.target.click();
|
140
|
+
}
|
141
|
+
};
|
142
|
+
return props;
|
143
|
+
}
|
126
144
|
//# sourceMappingURL=hooks.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/helpers/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrK,OAAO,
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/helpers/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrK,OAAO,EAAoD,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB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,UAAU,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC,SAAS;CAC9B,CAAC,CAAC;AAEH,kFAAkF;AAClF,MAAM,UAAU,eAAe;IAC3B,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAE7B,MAAM,KAAK,GAAmC;QAC1C,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC,CAAC,EAAE;YACX,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO;gBAAG,CAAC,CAAC,MAAyB,CAAC,KAAK,EAAE,CAAC;QAChE,CAAC;KACJ,CAAC;IAEF,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
@@ -1,84 +1,85 @@
|
|
1
|
-
{
|
2
|
-
"name": "@kwiz/fluentui",
|
3
|
-
"version": "1.0.
|
4
|
-
"description": "KWIZ common controls for FluentUI",
|
5
|
-
"module": "dist/index.js",
|
6
|
-
"types": "dist/index.d.ts",
|
7
|
-
"exports": {
|
8
|
-
".": {
|
9
|
-
"types": "./dist/index.d.ts",
|
10
|
-
"import": "./dist/index.js",
|
11
|
-
"default": "./dist/index.js"
|
12
|
-
},
|
13
|
-
"./package.json": "./package.json"
|
14
|
-
},
|
15
|
-
"scripts": {
|
16
|
-
"watch": "tsc -watch",
|
17
|
-
"build": "npm run test && tsc",
|
18
|
-
"build-explain": "tsc --explainFiles",
|
19
|
-
"check-dependencies": "madge --circular ./src",
|
20
|
-
"create-link": "npm link",
|
21
|
-
"test": "depcruise src && node --import tsx --test src",
|
22
|
-
"link-local-kwiz": "npm link @kwiz/common",
|
23
|
-
"__update-kwiz-packages": "npm install @kwiz/common@latest",
|
24
|
-
"npm-v-patch": "npm version patch && git push origin main:main && git push --tags",
|
25
|
-
"npm-v-major": "npm version major && git push origin main:main && git push --tags",
|
26
|
-
"npm-publish": "npm publish --access public",
|
27
|
-
"reset-repo": "git fetch origin && git reset --hard origin/main"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
"
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"
|
36
|
-
|
37
|
-
|
38
|
-
"
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
"
|
43
|
-
|
44
|
-
"
|
45
|
-
|
46
|
-
|
47
|
-
"
|
48
|
-
"
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
"
|
53
|
-
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
"@fluentui/react-
|
63
|
-
"@
|
64
|
-
"@
|
65
|
-
"@mismerge/
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"jodit
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"react-dnd
|
73
|
-
"react-
|
74
|
-
"
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
"@fluentui/react-
|
79
|
-
"@
|
80
|
-
"@types/react
|
81
|
-
"react": ">=16.
|
82
|
-
"react
|
83
|
-
|
84
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@kwiz/fluentui",
|
3
|
+
"version": "1.0.76",
|
4
|
+
"description": "KWIZ common controls for FluentUI",
|
5
|
+
"module": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"exports": {
|
8
|
+
".": {
|
9
|
+
"types": "./dist/index.d.ts",
|
10
|
+
"import": "./dist/index.js",
|
11
|
+
"default": "./dist/index.js"
|
12
|
+
},
|
13
|
+
"./package.json": "./package.json"
|
14
|
+
},
|
15
|
+
"scripts": {
|
16
|
+
"watch": "tsc -watch",
|
17
|
+
"build": "npm run test && tsc",
|
18
|
+
"build-explain": "tsc --explainFiles",
|
19
|
+
"check-dependencies": "madge --circular ./src",
|
20
|
+
"create-link": "npm link",
|
21
|
+
"test": "depcruise src && node --import tsx --test src",
|
22
|
+
"link-local-kwiz": "npm link @kwiz/common",
|
23
|
+
"__update-kwiz-packages": "npm install @kwiz/common@latest",
|
24
|
+
"npm-v-patch": "npm version patch && git push origin main:main && git push --tags",
|
25
|
+
"npm-v-major": "npm version major && git push origin main:main && git push --tags",
|
26
|
+
"npm-publish": "npm publish --access public",
|
27
|
+
"reset-repo": "git fetch origin && git reset --hard origin/main",
|
28
|
+
"clear-npm-cache": "npm cache clean --force"
|
29
|
+
},
|
30
|
+
"repository": {
|
31
|
+
"type": "git",
|
32
|
+
"url": "git+https://github.com/KWizCom/fluentui.git"
|
33
|
+
},
|
34
|
+
"keywords": [
|
35
|
+
"KWIZ",
|
36
|
+
"FluentUI"
|
37
|
+
],
|
38
|
+
"author": "Shai Petel",
|
39
|
+
"contributors": [
|
40
|
+
"Shai Petel"
|
41
|
+
],
|
42
|
+
"license": "MIT",
|
43
|
+
"bugs": {
|
44
|
+
"url": "https://github.com/KWizCom/fluentui/issues",
|
45
|
+
"email": "support@kwizcom.com"
|
46
|
+
},
|
47
|
+
"homepage": "https://github.com/KWizCom/fluentui#readme",
|
48
|
+
"private": false,
|
49
|
+
"engines": {
|
50
|
+
"node": ">=16"
|
51
|
+
},
|
52
|
+
"packageManager": "npm@9.5.1",
|
53
|
+
"devDependencies": {
|
54
|
+
"@types/qrcode": "^1.5.5",
|
55
|
+
"dependency-cruiser": "^16.8.0",
|
56
|
+
"fs-extra": "^11.2.0",
|
57
|
+
"madge": "^6.1.0",
|
58
|
+
"tsx": "^4.7.1",
|
59
|
+
"typescript": "^5.3.3"
|
60
|
+
},
|
61
|
+
"dependencies": {
|
62
|
+
"@fluentui/react-datepicker-compat": "^0.4.53",
|
63
|
+
"@fluentui/react-timepicker-compat": "^0.2.42",
|
64
|
+
"@kwiz/common": "^1.0.120",
|
65
|
+
"@mismerge/core": "^1.2.1",
|
66
|
+
"@mismerge/react": "^1.0.1",
|
67
|
+
"esbuild": "^0.19.12",
|
68
|
+
"get-tsconfig": "^4.7.2",
|
69
|
+
"jodit": "^4.2.47",
|
70
|
+
"jodit-react": "^4.1.2",
|
71
|
+
"qrcode": "^1.5.4",
|
72
|
+
"react-dnd": "^16.0.1",
|
73
|
+
"react-dnd-html5-backend": "^16.0.1",
|
74
|
+
"react-pick-color": "^2.0.0",
|
75
|
+
"resolve-pkg-maps": "^1.0.0"
|
76
|
+
},
|
77
|
+
"peerDependencies": {
|
78
|
+
"@fluentui/react-components": ">=9.54.17 <10.0.0",
|
79
|
+
"@fluentui/react-icons": "^2.0.269",
|
80
|
+
"@types/react": ">=16.14.0 <19.0.0",
|
81
|
+
"@types/react-dom": ">=16.9.0 <19.0.0",
|
82
|
+
"react": ">=16.14.0 <19.0.0",
|
83
|
+
"react-dom": ">=16.14.0 <19.0.0"
|
84
|
+
}
|
85
|
+
}
|
package/src/_modules/config.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { config } from "@kwiz/common";
|
2
|
-
import { BuildNumber, ReleaseStatus } from "./constants";
|
3
|
-
|
4
|
-
export const { logger: GetLogger } = config({
|
5
|
-
BuildNumber: BuildNumber,
|
6
|
-
IsLocalDev: false,
|
7
|
-
ReleaseStatus: ReleaseStatus,
|
8
|
-
ProjectName: "[fluentui]"
|
9
|
-
});
|
1
|
+
import { config } from "@kwiz/common";
|
2
|
+
import { BuildNumber, ReleaseStatus } from "./constants";
|
3
|
+
|
4
|
+
export const { logger: GetLogger } = config({
|
5
|
+
BuildNumber: BuildNumber,
|
6
|
+
IsLocalDev: false,
|
7
|
+
ReleaseStatus: ReleaseStatus,
|
8
|
+
ProjectName: "[fluentui]"
|
9
|
+
});
|
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
export var BuildNumber = 'unset';
|
3
|
-
export const ReleaseStatus = "npm";
|
1
|
+
|
2
|
+
export var BuildNumber = 'unset';
|
3
|
+
export const ReleaseStatus = "npm";
|
@@ -1,84 +1,84 @@
|
|
1
|
-
import { Field } from "@fluentui/react-components";
|
2
|
-
import { ColorRegular } from "@fluentui/react-icons";
|
3
|
-
import { isFunction, isNullOrEmptyString, isNumber } from "@kwiz/common";
|
4
|
-
import * as React from "react";
|
5
|
-
import ColorPicker, { Color } from 'react-pick-color';
|
6
|
-
import { useEffectOnlyOnMount, useStateEX } from "../helpers";
|
7
|
-
import { ButtonEX } from "./button";
|
8
|
-
import { InputEx } from "./input";
|
9
|
-
import { Prompter } from "./prompt";
|
10
|
-
export interface iProps {
|
11
|
-
label?: string;
|
12
|
-
value: string;
|
13
|
-
onChange: (newValue: string) => void;
|
14
|
-
required?: boolean;
|
15
|
-
showValidationErrors?: boolean;
|
16
|
-
underlined?: boolean;
|
17
|
-
width?: number;
|
18
|
-
buttonOnly?: boolean;
|
19
|
-
placeholder?: string;
|
20
|
-
disabled?: boolean;
|
21
|
-
|
22
|
-
/** specify a specific mount node for this dialog */
|
23
|
-
mountNode?: HTMLElement | null | {
|
24
|
-
element?: HTMLElement | null;
|
25
|
-
className?: string;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
export const ColorPickerEx: React.FunctionComponent<iProps> = (props) => {
|
30
|
-
const [isOpen, setIsOpen] = useStateEX<boolean>(false);
|
31
|
-
const [selectedColor, setSelectedColor] = useStateEX<string>(props.value);
|
32
|
-
|
33
|
-
const getColorCells = React.useCallback(() => {
|
34
|
-
let cells: Color[] = [
|
35
|
-
"white", "black"
|
36
|
-
];
|
37
|
-
return cells;
|
38
|
-
}, useEffectOnlyOnMount);
|
39
|
-
return <>
|
40
|
-
{props.buttonOnly
|
41
|
-
? <ButtonEX disabled={props.disabled}
|
42
|
-
title="Open color picker"
|
43
|
-
icon={<ColorRegular
|
44
|
-
color={selectedColor} />
|
45
|
-
}
|
46
|
-
onClick={(e) => setIsOpen(true)} />
|
47
|
-
: <Field label={props.label}
|
48
|
-
required={props.required === true}
|
49
|
-
validationMessage={props.showValidationErrors && props.required === true && isNullOrEmptyString(selectedColor) ? "You can't leave this blank." : undefined}
|
50
|
-
>
|
51
|
-
<InputEx disabled={props.disabled}
|
52
|
-
placeholder={props.placeholder || "Enter value here"}
|
53
|
-
style={isNumber(props.width) ? { width: props.width } : undefined}
|
54
|
-
value={selectedColor}
|
55
|
-
onChange={(e, data) => {
|
56
|
-
setSelectedColor(data.value);
|
57
|
-
if (isFunction(props.onChange)) {
|
58
|
-
props.onChange(data.value);
|
59
|
-
}
|
60
|
-
}}
|
61
|
-
contentAfter={<ButtonEX disabled={props.disabled}
|
62
|
-
title="Open color picker"
|
63
|
-
icon={<ColorRegular
|
64
|
-
color={selectedColor} />
|
65
|
-
}
|
66
|
-
onClick={(e) => setIsOpen(true)} />
|
67
|
-
}
|
68
|
-
/>
|
69
|
-
</Field>}
|
70
|
-
{isOpen && <Prompter maxWidth={332} mountNode={props.mountNode}
|
71
|
-
hideOk hideCancel onCancel={() => {
|
72
|
-
if (isFunction(props.onChange)) {
|
73
|
-
props.onChange(selectedColor);
|
74
|
-
}
|
75
|
-
setIsOpen(false);
|
76
|
-
}} showCancelInTitle
|
77
|
-
title={props.label || "Choose a color"}
|
78
|
-
>
|
79
|
-
<ColorPicker color={selectedColor} onChange={color => setSelectedColor(color.hex)}
|
80
|
-
presets={getColorCells()}
|
81
|
-
/>
|
82
|
-
</Prompter>}
|
83
|
-
</>;
|
1
|
+
import { Field } from "@fluentui/react-components";
|
2
|
+
import { ColorRegular } from "@fluentui/react-icons";
|
3
|
+
import { isFunction, isNullOrEmptyString, isNumber } from "@kwiz/common";
|
4
|
+
import * as React from "react";
|
5
|
+
import ColorPicker, { Color } from 'react-pick-color';
|
6
|
+
import { useEffectOnlyOnMount, useStateEX } from "../helpers";
|
7
|
+
import { ButtonEX } from "./button";
|
8
|
+
import { InputEx } from "./input";
|
9
|
+
import { Prompter } from "./prompt";
|
10
|
+
export interface iProps {
|
11
|
+
label?: string;
|
12
|
+
value: string;
|
13
|
+
onChange: (newValue: string) => void;
|
14
|
+
required?: boolean;
|
15
|
+
showValidationErrors?: boolean;
|
16
|
+
underlined?: boolean;
|
17
|
+
width?: number;
|
18
|
+
buttonOnly?: boolean;
|
19
|
+
placeholder?: string;
|
20
|
+
disabled?: boolean;
|
21
|
+
|
22
|
+
/** specify a specific mount node for this dialog */
|
23
|
+
mountNode?: HTMLElement | null | {
|
24
|
+
element?: HTMLElement | null;
|
25
|
+
className?: string;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export const ColorPickerEx: React.FunctionComponent<iProps> = (props) => {
|
30
|
+
const [isOpen, setIsOpen] = useStateEX<boolean>(false);
|
31
|
+
const [selectedColor, setSelectedColor] = useStateEX<string>(props.value);
|
32
|
+
|
33
|
+
const getColorCells = React.useCallback(() => {
|
34
|
+
let cells: Color[] = [
|
35
|
+
"white", "black"
|
36
|
+
];
|
37
|
+
return cells;
|
38
|
+
}, useEffectOnlyOnMount);
|
39
|
+
return <>
|
40
|
+
{props.buttonOnly
|
41
|
+
? <ButtonEX disabled={props.disabled}
|
42
|
+
title="Open color picker"
|
43
|
+
icon={<ColorRegular
|
44
|
+
color={selectedColor} />
|
45
|
+
}
|
46
|
+
onClick={(e) => setIsOpen(true)} />
|
47
|
+
: <Field label={props.label}
|
48
|
+
required={props.required === true}
|
49
|
+
validationMessage={props.showValidationErrors && props.required === true && isNullOrEmptyString(selectedColor) ? "You can't leave this blank." : undefined}
|
50
|
+
>
|
51
|
+
<InputEx disabled={props.disabled}
|
52
|
+
placeholder={props.placeholder || "Enter value here"}
|
53
|
+
style={isNumber(props.width) ? { width: props.width } : undefined}
|
54
|
+
value={selectedColor}
|
55
|
+
onChange={(e, data) => {
|
56
|
+
setSelectedColor(data.value);
|
57
|
+
if (isFunction(props.onChange)) {
|
58
|
+
props.onChange(data.value);
|
59
|
+
}
|
60
|
+
}}
|
61
|
+
contentAfter={<ButtonEX disabled={props.disabled}
|
62
|
+
title="Open color picker"
|
63
|
+
icon={<ColorRegular
|
64
|
+
color={selectedColor} />
|
65
|
+
}
|
66
|
+
onClick={(e) => setIsOpen(true)} />
|
67
|
+
}
|
68
|
+
/>
|
69
|
+
</Field>}
|
70
|
+
{isOpen && <Prompter maxWidth={332} mountNode={props.mountNode}
|
71
|
+
hideOk hideCancel onCancel={() => {
|
72
|
+
if (isFunction(props.onChange)) {
|
73
|
+
props.onChange(selectedColor);
|
74
|
+
}
|
75
|
+
setIsOpen(false);
|
76
|
+
}} showCancelInTitle
|
77
|
+
title={props.label || "Choose a color"}
|
78
|
+
>
|
79
|
+
<ColorPicker color={selectedColor} onChange={color => setSelectedColor(color.hex)}
|
80
|
+
presets={getColorCells()}
|
81
|
+
/>
|
82
|
+
</Prompter>}
|
83
|
+
</>;
|
84
84
|
};
|