@kwiz/fluentui 1.0.73 → 1.0.75
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.js +2 -2
- 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/use-editable-control.d.ts +1 -1
- package/dist/helpers/use-editable-control.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 +173 -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 +141 -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
@@ -1,24 +1,24 @@
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
2
|
-
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
3
|
-
|
4
|
-
name: Node.js Package
|
5
|
-
|
6
|
-
on:
|
7
|
-
push:
|
8
|
-
tags:
|
9
|
-
- 'v*.*.*' # run every time we commit with a new version number
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
build-publish-npm:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v4
|
16
|
-
- uses: actions/setup-node@v4
|
17
|
-
with:
|
18
|
-
node-version: 18
|
19
|
-
registry-url: https://registry.npmjs.org/
|
20
|
-
- run: npm ci
|
21
|
-
- run: npm run build
|
22
|
-
- run: npm run npm-publish
|
23
|
-
env:
|
24
|
-
NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
3
|
+
|
4
|
+
name: Node.js Package
|
5
|
+
|
6
|
+
on:
|
7
|
+
push:
|
8
|
+
tags:
|
9
|
+
- 'v*.*.*' # run every time we commit with a new version number
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
build-publish-npm:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
- uses: actions/setup-node@v4
|
17
|
+
with:
|
18
|
+
node-version: 18
|
19
|
+
registry-url: https://registry.npmjs.org/
|
20
|
+
- run: npm ci
|
21
|
+
- run: npm run build
|
22
|
+
- run: npm run npm-publish
|
23
|
+
env:
|
24
|
+
NODE_AUTH_TOKEN: ${{secrets.KWIZ_NPM_TOKEN}}
|
package/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2024 KWIZ Corp
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 KWIZ Corp
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
@@ -1,53 +1,53 @@
|
|
1
|
-
# fluentui
|
2
|
-
|
3
|
-
For local debugging, if you plan to use `npm link` - there is a known issue with react that will potentially break your application.
|
4
|
-
|
5
|
-
To fix that, you must mark react and fluentui imports as external.
|
6
|
-
The best way of doing it is using webpack to build your app, and adding this:
|
7
|
-
```json
|
8
|
-
resolve: {
|
9
|
-
...
|
10
|
-
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules']//important! needed for @kwiz/fluentui to work correctly when linked
|
11
|
-
}
|
12
|
-
```
|
13
|
-
|
14
|
-
Otherwise during dev, you'll have to link the react package in this project to load the react from node_modules in your caller application. For example:
|
15
|
-
|
16
|
-
```
|
17
|
-
npm link ..\\test-project\\node_modules\\react\\ ..\\..test-project\\node_modules\\@types\\react\\
|
18
|
-
```
|
19
|
-
|
20
|
-
To successfully use these controls you should create a context, and wrapt it in a drag/drop provider.
|
21
|
-
|
22
|
-
We recommend using the provider control:
|
23
|
-
|
24
|
-
```ts
|
25
|
-
<KWIZFluentProvider ctx={{ buttonShape: "rounded" }}>
|
26
|
-
<FluentProvider theme={webLightTheme}>
|
27
|
-
{content}
|
28
|
-
</FluentProvider>
|
29
|
-
</KWIZFluentProvider>
|
30
|
-
|
31
|
-
```
|
32
|
-
|
33
|
-
Or you can use the following code:
|
34
|
-
|
35
|
-
```ts
|
36
|
-
// it is no longer needed to send in a root node const root = React.useRef<HTMLDivElement>(null);
|
37
|
-
const { KWIZFluentContext, value: kwizFluentContext } =
|
38
|
-
useKWIZFluentContextProvider({
|
39
|
-
ctx: {
|
40
|
-
buttonShape: "rounded",
|
41
|
-
},
|
42
|
-
//root,
|
43
|
-
});
|
44
|
-
|
45
|
-
//...
|
46
|
-
<KWIZFluentContext.Provider value={kwizFluentContext}>
|
47
|
-
<DragDropContextProvider>
|
48
|
-
<FluentProvider theme={webLightTheme} /*ref={root}*/>
|
49
|
-
{content}
|
50
|
-
</FluentProvider>
|
51
|
-
</DragDropContextProvider>
|
52
|
-
</KWIZFluentContext.Provider>;
|
53
|
-
```
|
1
|
+
# fluentui
|
2
|
+
|
3
|
+
For local debugging, if you plan to use `npm link` - there is a known issue with react that will potentially break your application.
|
4
|
+
|
5
|
+
To fix that, you must mark react and fluentui imports as external.
|
6
|
+
The best way of doing it is using webpack to build your app, and adding this:
|
7
|
+
```json
|
8
|
+
resolve: {
|
9
|
+
...
|
10
|
+
modules: [path.resolve(__dirname, 'node_modules'), 'node_modules']//important! needed for @kwiz/fluentui to work correctly when linked
|
11
|
+
}
|
12
|
+
```
|
13
|
+
|
14
|
+
Otherwise during dev, you'll have to link the react package in this project to load the react from node_modules in your caller application. For example:
|
15
|
+
|
16
|
+
```
|
17
|
+
npm link ..\\test-project\\node_modules\\react\\ ..\\..test-project\\node_modules\\@types\\react\\
|
18
|
+
```
|
19
|
+
|
20
|
+
To successfully use these controls you should create a context, and wrapt it in a drag/drop provider.
|
21
|
+
|
22
|
+
We recommend using the provider control:
|
23
|
+
|
24
|
+
```ts
|
25
|
+
<KWIZFluentProvider ctx={{ buttonShape: "rounded" }}>
|
26
|
+
<FluentProvider theme={webLightTheme}>
|
27
|
+
{content}
|
28
|
+
</FluentProvider>
|
29
|
+
</KWIZFluentProvider>
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
Or you can use the following code:
|
34
|
+
|
35
|
+
```ts
|
36
|
+
// it is no longer needed to send in a root node const root = React.useRef<HTMLDivElement>(null);
|
37
|
+
const { KWIZFluentContext, value: kwizFluentContext } =
|
38
|
+
useKWIZFluentContextProvider({
|
39
|
+
ctx: {
|
40
|
+
buttonShape: "rounded",
|
41
|
+
},
|
42
|
+
//root,
|
43
|
+
});
|
44
|
+
|
45
|
+
//...
|
46
|
+
<KWIZFluentContext.Provider value={kwizFluentContext}>
|
47
|
+
<DragDropContextProvider>
|
48
|
+
<FluentProvider theme={webLightTheme} /*ref={root}*/>
|
49
|
+
{content}
|
50
|
+
</FluentProvider>
|
51
|
+
</DragDropContextProvider>
|
52
|
+
</KWIZFluentContext.Provider>;
|
53
|
+
```
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
//# sourceMappingURL=forwardRef.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"forwardRef.js","sourceRoot":"","sources":["../../src/@types/forwardRef.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
2
|
+
interface iProps {
|
3
|
+
errorComponent?: JSX.Element;
|
4
|
+
/** If changeMarker changes, it will check the error again */
|
5
|
+
changeMarker: string | number;
|
6
|
+
}
|
7
|
+
interface iState {
|
8
|
+
hasError: boolean;
|
9
|
+
marker: string | number;
|
10
|
+
}
|
11
|
+
export declare class ErrorBoundary extends React.Component<PropsWithChildren<iProps>, iState> {
|
12
|
+
constructor(props: iProps);
|
13
|
+
static getDerivedStateFromError(error: any): {
|
14
|
+
hasError: boolean;
|
15
|
+
};
|
16
|
+
static getDerivedStateFromProps(props: iProps, state: iState): {
|
17
|
+
hasError: boolean;
|
18
|
+
marker: string | number;
|
19
|
+
};
|
20
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
21
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | JSX.Element;
|
22
|
+
}
|
23
|
+
export {};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { GetLogger } from "_modules";
|
3
|
+
import React from "react";
|
4
|
+
const logger = GetLogger("ErrorBoundary");
|
5
|
+
export class ErrorBoundary extends React.Component {
|
6
|
+
constructor(props) {
|
7
|
+
super(props);
|
8
|
+
this.state = { hasError: false, marker: props.changeMarker };
|
9
|
+
}
|
10
|
+
static getDerivedStateFromError(error) {
|
11
|
+
// Update state so the next render will show the fallback UI.
|
12
|
+
return { hasError: true };
|
13
|
+
}
|
14
|
+
static getDerivedStateFromProps(props, state) {
|
15
|
+
if (props.changeMarker !== state.marker)
|
16
|
+
return { hasError: false, marker: props.changeMarker };
|
17
|
+
else
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
componentDidCatch(error, errorInfo) {
|
21
|
+
// You can also log the error to an error reporting service
|
22
|
+
logger.error(error);
|
23
|
+
logger.error(errorInfo);
|
24
|
+
}
|
25
|
+
render() {
|
26
|
+
if (this.state.hasError) {
|
27
|
+
// You can render any custom fallback UI
|
28
|
+
return this.props.errorComponent || _jsx("h1", { children: "Something went wrong." });
|
29
|
+
}
|
30
|
+
return this.props.children;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=error-boundary%20copy.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"error-boundary copy.js","sourceRoot":"","sources":["../../src/controls/error-boundary copy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;AAQ1C,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAA4C;IACjF,YAAY,KAAa;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAK;QACjC,6DAA6D;QAC7D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC9B,CAAC;IACD,MAAM,CAAC,wBAAwB,CAAC,KAAa,EAAE,KAAa;QACxD,IAAI,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,MAAM;YACnC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;;YACtD,OAAO,IAAI,CAAC;IACrB,CAAC;IAED,iBAAiB,CAAC,KAAK,EAAE,SAAS;QAC9B,2DAA2D;QAC3D,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACtB,wCAAwC;YACxC,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,iDAA8B,CAAC;QACvE,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACJ"}
|
package/dist/controls/menu.js
CHANGED
@@ -3,8 +3,8 @@ import { Menu, MenuDivider, MenuGroup, MenuGroupHeader, MenuItem, MenuList, Menu
|
|
3
3
|
import { ChevronLeftRegular, ChevronRightRegular } from '@fluentui/react-icons';
|
4
4
|
import { isNotEmptyArray, isNotEmptyString, isNullOrEmptyString, isNullOrUndefined, isNumber, isString, isUndefined, jsonClone, stopEvent } from '@kwiz/common';
|
5
5
|
import React from 'react';
|
6
|
-
import { useKWIZFluentContext } from '../helpers/context-internal';
|
7
6
|
import { useStateEX } from '../helpers';
|
7
|
+
import { useKWIZFluentContext } from '../helpers/context-internal';
|
8
8
|
import { ButtonEX } from './button';
|
9
9
|
import { Horizontal } from './horizontal';
|
10
10
|
import { Search } from './search';
|
@@ -63,7 +63,7 @@ export const MenuEx = (props) => {
|
|
63
63
|
});
|
64
64
|
const paged = menuItems.length > pageSize;
|
65
65
|
const filtered = menuItems.length > filterThreshold || !isNullOrEmptyString(myLevelFilter);
|
66
|
-
const filterControl = filtered && _jsx(Search, {
|
66
|
+
const filterControl = filtered && _jsx(Search, { defaultValue: myLevelFilter || "", onChangeDeferred: (newValue) => {
|
67
67
|
const s = jsonClone(filterPerLevel);
|
68
68
|
s[level] = newValue ? newValue.toLowerCase() : "";
|
69
69
|
setFilterPerLevel(s);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/controls/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAiB,WAAW,EAAE,qBAAqB,EAA+B,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5M,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAe,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7K,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/controls/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAiB,WAAW,EAAE,qBAAqB,EAA+B,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5M,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAe,e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AE,GAAG,CAAC,SAAS,IAAM,KAAK,CAAC,SAAS,IAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE;YACrG,IAAI,IAAI,CAAC,IAAI;gBAAE,SAAS,iCAAM,MAAM,KAAE,CAAC,EAAE,IAAI,IAAG,CAAC;iBAC5C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,SAAS,iCAAM,MAAM,KAAE,CAAC,EAAE,KAAK,IAAG,CAAC;QAC9D,CAAC,aACG,KAAC,WAAW,IAAC,wBAAwB,kBAChC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;oBACpB,CAAC,CAAC,KAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;4BAC7C,SAAS,CAAC,CAAC,CAAC,CAAC;wBACjB,CAAC,GAAI;oBACL,CAAC,CAAC,QAAQ,CAAE,KAAK,CAAC,OAAyB,CAAC,KAAK,CAAC;wBAC9C,CAAC,CAAC,KAAC,QAAQ,oBAAM,KAAK,CAAC,OAAyB,IAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gCAC7D,SAAS,CAAC,CAAC,CAAC,CAAC;4BACjB,CAAC,IAAI;wBACL,CAAC,CAAC,KAAK,CAAC,OAAsB,GAC5B,EACd,KAAC,WAAW,oBAAK,KAAK,CAAC,gBAAgB,cACnC,KAAC,QAAQ,oBAAK,KAAK,CAAC,aAAa,cAC5B,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,IACrB,IACD,KACX,CACV,CAAC;AACN,CAAC,CAAA"}
|
package/dist/controls/search.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { Input, makeStyles, mergeClasses } from '@fluentui/react-components';
|
3
3
|
import { DismissRegular, SearchRegular } from "@fluentui/react-icons";
|
4
|
-
import { debounce, isNullOrEmptyString } from '@kwiz/common';
|
5
|
-
import React, { useRef } from 'react';
|
4
|
+
import { debounce, isNullOrEmptyString, isNullOrUndefined } from '@kwiz/common';
|
5
|
+
import React, { useEffect, useRef } from 'react';
|
6
6
|
import { GetLogger } from '../_modules/config';
|
7
|
+
import { useEffectOnlyOnMount, useStateEX } from '../helpers';
|
7
8
|
import { mixins } from '../styles/styles';
|
8
9
|
const logger = GetLogger("Search");
|
9
10
|
const useStyles = makeStyles({
|
@@ -20,23 +21,30 @@ export const Search = (props) => {
|
|
20
21
|
//keep updating the ref
|
21
22
|
React.useEffect(() => { refonChangeDeferred.current = props.onChangeDeferred; }, [props.onChangeDeferred]);
|
22
23
|
//cannot call debounce every render, since it won't be the same debounced instance...
|
23
|
-
var notifyParent = React.
|
24
|
+
var notifyParent = React.useCallback(debounce(v => {
|
24
25
|
var _a;
|
25
26
|
logger.log(`Set: ${v}`);
|
26
27
|
//Call the latest ref - we don't want to call an old version of this function
|
27
28
|
(_a = refonChangeDeferred.current) === null || _a === void 0 ? void 0 : _a.call(refonChangeDeferred, v);
|
28
29
|
}, delay * 1000), [delay]);
|
29
|
-
const currentValue = props.value || "";
|
30
|
-
|
31
|
-
|
32
|
-
(
|
33
|
-
|
30
|
+
const [currentValue, setCurrentValue] = useStateEX(props.value || props.defaultValue || "", { skipUpdateIfSame: true });
|
31
|
+
useEffect(() => {
|
32
|
+
if (!isNullOrUndefined(props.value))
|
33
|
+
setCurrentValue(props.value);
|
34
|
+
}, [props.value]);
|
35
|
+
var changeValue = React.useCallback((newValue) => {
|
36
|
+
var _a;
|
37
|
+
newValue = newValue || ""; //no null or undefined here
|
38
|
+
setCurrentValue(newValue); //keep our state updated in sync
|
39
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, newValue); //if parent is using search as managed control, keep it up to date in sync
|
40
|
+
notifyParent(newValue); //trigger a search async
|
41
|
+
}, useEffectOnlyOnMount);
|
42
|
+
return (_jsx(Input, Object.assign({}, props, { autoFocus: true, defaultValue: undefined, value: currentValue, onChange: (e, data) => {
|
43
|
+
changeValue(data.value);
|
34
44
|
}, className: mergeClasses(cssNames.root, props.main && cssNames.main), contentBefore: !isNullOrEmptyString(currentValue) ? undefined : _jsx(SearchRegular, { className: cssNames.searchIcon }), contentAfter: isNullOrEmptyString(currentValue)
|
35
45
|
? undefined
|
36
46
|
: _jsx(DismissRegular, { className: cssNames.clickable, onClick: () => {
|
37
|
-
|
38
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, "");
|
39
|
-
notifyParent("");
|
47
|
+
changeValue("");
|
40
48
|
} }) })));
|
41
49
|
};
|
42
50
|
//# sourceMappingURL=search.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/controls/search.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAc,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/controls/search.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAc,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,YAAY,CA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A"}
|
package/dist/controls/svg.js
CHANGED
@@ -3,7 +3,7 @@ import { tokens } from '@fluentui/react-components';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
4
4
|
import { createRoot } from 'react-dom/client';
|
5
5
|
export const YouTubeIcon = (props) => {
|
6
|
-
return (_jsx("svg", { height: `${props.size}px`, width: `${props.size}px`, version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 461.001 461.001", xmlSpace: "preserve", children: _jsx("g", { children: _jsx("path", { style: { fill: "#F61C0D" }, d: "M365.257,67.393H95.744C42.866,67.393,0,110.259,0,163.137v134.728\nc0,52.878,42.866,95.744,95.744,95.744h269.513c52.878,0,95.744-42.866,95.744-95.744V163.137\nC461.001,110.259,418.135,67.393,365.257,67.393z M300.506,237.056l-126.06,60.123c-3.359,1.602-7.239-0.847-7.239-4.568V168.607\nc0-3.774,3.982-6.22,7.348-4.514l126.06,63.881C304.363,229.873,304.298,235.248,300.506,237.056z" }) }) }));
|
6
|
+
return (_jsx("svg", { height: `${props.size}px`, width: `${props.size}px`, version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 461.001 461.001", xmlSpace: "preserve", children: _jsx("g", { children: _jsx("path", { style: { fill: "#F61C0D" }, d: "M365.257,67.393H95.744C42.866,67.393,0,110.259,0,163.137v134.728\r\nc0,52.878,42.866,95.744,95.744,95.744h269.513c52.878,0,95.744-42.866,95.744-95.744V163.137\r\nC461.001,110.259,418.135,67.393,365.257,67.393z M300.506,237.056l-126.06,60.123c-3.359,1.602-7.239-0.847-7.239-4.568V168.607\r\nc0-3.774,3.982-6.22,7.348-4.514l126.06,63.881C304.363,229.873,304.298,235.248,300.506,237.056z" }) }) }));
|
7
7
|
};
|
8
8
|
export const MermaidIcon = (props) => {
|
9
9
|
return (_jsxs("svg", { height: `${props.size}px`, width: `${props.size}px`, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 490.16 490.16", children: [_jsx("defs", { children: _jsx("style", { children: `.mm-cls-1{fill:#ff3670;}.mm-cls-2{fill:#fff;}` }) }), _jsx("rect", { className: "mm-cls-1", width: "490.16", height: "490.16", rx: "84.61" }), _jsx("path", { className: "mm-cls-2", d: "M407.48,111.18A165.2,165.2,0,0,0,245.08,220,165.2,165.2,0,0,0,82.68,111.18a165.5,165.5,0,0,0,72.06,143.64,88.81,88.81,0,0,1,38.53,73.45v50.86H296.9V328.27a88.8,88.8,0,0,1,38.52-73.45,165.41,165.41,0,0,0,72.06-143.64Z" }), _jsx("path", { className: "mm-cls-2", d: "M160.63,328.27a56.09,56.09,0,0,0-24.27-46.49,198.74,198.74,0,0,1-28.54-23.66A196.87,196.87,0,0,1,82.53,227V379.13h78.1Z" }), _jsx("path", { className: "mm-cls-2", d: "M329.53,328.27a56.09,56.09,0,0,1,24.27-46.49,198.74,198.74,0,0,0,28.54-23.66A196.87,196.87,0,0,0,407.63,227V379.13h-78.1Z" })] }));
|
@@ -12,7 +12,7 @@ export const TeamsIcon = (props) => {
|
|
12
12
|
return (_jsxs("svg", { height: `${props.size}px`, width: `${props.size}px`, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2228.833 2073.333", children: [_jsx("path", { fill: "#5059C9", d: "M1554.637,777.5h575.713c54.391,0,98.483,44.092,98.483,98.483c0,0,0,0,0,0v524.398 c0,199.901-162.051,361.952-361.952,361.952h0h-1.711c-199.901,0.028-361.975-162-362.004-361.901c0-0.017,0-0.034,0-0.052V828.971 C1503.167,800.544,1526.211,777.5,1554.637,777.5L1554.637,777.5z" }), _jsx("circle", { fill: "#5059C9", cx: "1943.75", cy: "440.583", r: "233.25" }), _jsx("circle", { fill: "#7B83EB", cx: "1218.083", cy: "336.917", r: "336.917" }), _jsx("path", { fill: "#7B83EB", d: "M1667.323,777.5H717.01c-53.743,1.33-96.257,45.931-95.01,99.676v598.105 c-7.505,322.519,247.657,590.16,570.167,598.053c322.51-7.893,577.671-275.534,570.167-598.053V877.176 C1763.579,823.431,1721.066,778.83,1667.323,777.5z" }), _jsx("path", { opacity: ".1", d: "M1244,777.5v838.145c-0.258,38.435-23.549,72.964-59.09,87.598 c-11.316,4.787-23.478,7.254-35.765,7.257H667.613c-6.738-17.105-12.958-34.21-18.142-51.833 c-18.144-59.477-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1244z" }), _jsx("path", { opacity: ".2", d: "M1192.167,777.5v889.978c-0.002,12.287-2.47,24.449-7.257,35.765 c-14.634,35.541-49.163,58.833-87.598,59.09H691.975c-8.812-17.105-17.105-34.21-24.362-51.833 c-7.257-17.623-12.958-34.21-18.142-51.833c-18.144-59.476-27.402-121.307-27.472-183.49V877.02 c-1.246-53.659,41.198-98.19,94.855-99.52H1192.167z" }), _jsx("path", { opacity: ".2", d: "M1192.167,777.5v786.312c-0.395,52.223-42.632,94.46-94.855,94.855h-447.84 c-18.144-59.476-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1192.167z" }), _jsx("path", { opacity: ".2", d: "M1140.333,777.5v786.312c-0.395,52.223-42.632,94.46-94.855,94.855H649.472 c-18.144-59.476-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1140.333z" }), _jsx("path", { opacity: ".1", d: "M1244,509.522v163.275c-8.812,0.518-17.105,1.037-25.917,1.037 c-8.812,0-17.105-0.518-25.917-1.037c-17.496-1.161-34.848-3.937-51.833-8.293c-104.963-24.857-191.679-98.469-233.25-198.003 c-7.153-16.715-12.706-34.071-16.587-51.833h258.648C1201.449,414.866,1243.801,457.217,1244,509.522z" }), _jsx("path", { opacity: ".2", d: "M1192.167,561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293 c-104.963-24.857-191.679-98.469-233.25-198.003h190.228C1149.616,466.699,1191.968,509.051,1192.167,561.355z" }), _jsx("path", { opacity: ".2", d: "M1192.167,561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293 c-104.963-24.857-191.679-98.469-233.25-198.003h190.228C1149.616,466.699,1191.968,509.051,1192.167,561.355z" }), _jsx("path", { opacity: ".2", d: "M1140.333,561.355v103.148c-104.963-24.857-191.679-98.469-233.25-198.003 h138.395C1097.783,466.699,1140.134,509.051,1140.333,561.355z" }), _jsxs("linearGradient", { id: "a", gradientUnits: "userSpaceOnUse", x1: "198.099", y1: "1683.0726", x2: "942.2344", y2: "394.2607", gradientTransform: "matrix(1 0 0 -1 0 2075.3333)", children: [_jsx("stop", { offset: "0", stopColor: "#5a62c3" }), _jsx("stop", { offset: ".5", stopColor: "#4d55bd" }), _jsx("stop", { offset: "1", stopColor: "#3940ab" })] }), _jsx("path", { fill: "url(#a)", d: "M95.01,466.5h950.312c52.473,0,95.01,42.538,95.01,95.01v950.312c0,52.473-42.538,95.01-95.01,95.01 H95.01c-52.473,0-95.01-42.538-95.01-95.01V561.51C0,509.038,42.538,466.5,95.01,466.5z" }), _jsx("path", { fill: "#FFF", d: "M820.211,828.193H630.241v517.297H509.211V828.193H320.123V727.844h500.088V828.193z" })] }));
|
13
13
|
};
|
14
14
|
export const SVGLinkIcon = (props) => {
|
15
|
-
return (_jsx("svg", { fill: tokens.colorNeutralForeground1, height: `${props.size}px`, width: `${props.size}px`, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 490.16 490.16", children: _jsx("g", { children: _jsxs("g", { children: [_jsx("path", { d: "M409.657,32.474c-43.146-43.146-113.832-43.146-156.978,0l-84.763,84.762c29.07-8.262,60.589-6.12,88.129,6.732\n\t\t\tl44.063-44.064c17.136-17.136,44.982-17.136,62.118,0c17.136,17.136,17.136,44.982,0,62.118l-55.386,55.386l-36.414,36.414\n\t\t\tc-17.136,17.136-44.982,17.136-62.119,0l-47.43,47.43c11.016,11.017,23.868,19.278,37.332,24.48\n\t\t\tc36.415,14.382,78.643,8.874,110.467-16.219c3.06-2.447,6.426-5.201,9.18-8.262l57.222-57.222l34.578-34.578\n\t\t\tC453.109,146.306,453.109,75.926,409.657,32.474z" }), _jsx("path", { d: "M184.135,320.114l-42.228,42.228c-17.136,17.137-44.982,17.137-62.118,0c-17.136-17.136-17.136-44.981,0-62.118\n\t\t\tl91.8-91.799c17.136-17.136,44.982-17.136,62.119,0l47.43-47.43c-11.016-11.016-23.868-19.278-37.332-24.48\n\t\t\tc-38.25-15.3-83.232-8.262-115.362,20.502c-1.53,1.224-3.06,2.754-4.284,3.978l-91.8,91.799\n\t\t\tc-43.146,43.146-43.146,113.832,0,156.979c43.146,43.146,113.832,43.146,156.978,0l82.927-83.845\n\t\t\tC230.035,335.719,220.243,334.496,184.135,320.114z" })] }) }) }));
|
15
|
+
return (_jsx("svg", { fill: tokens.colorNeutralForeground1, height: `${props.size}px`, width: `${props.size}px`, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 490.16 490.16", children: _jsx("g", { children: _jsxs("g", { children: [_jsx("path", { d: "M409.657,32.474c-43.146-43.146-113.832-43.146-156.978,0l-84.763,84.762c29.07-8.262,60.589-6.12,88.129,6.732\r\n\t\t\tl44.063-44.064c17.136-17.136,44.982-17.136,62.118,0c17.136,17.136,17.136,44.982,0,62.118l-55.386,55.386l-36.414,36.414\r\n\t\t\tc-17.136,17.136-44.982,17.136-62.119,0l-47.43,47.43c11.016,11.017,23.868,19.278,37.332,24.48\r\n\t\t\tc36.415,14.382,78.643,8.874,110.467-16.219c3.06-2.447,6.426-5.201,9.18-8.262l57.222-57.222l34.578-34.578\r\n\t\t\tC453.109,146.306,453.109,75.926,409.657,32.474z" }), _jsx("path", { d: "M184.135,320.114l-42.228,42.228c-17.136,17.137-44.982,17.137-62.118,0c-17.136-17.136-17.136-44.981,0-62.118\r\n\t\t\tl91.8-91.799c17.136-17.136,44.982-17.136,62.119,0l47.43-47.43c-11.016-11.016-23.868-19.278-37.332-24.48\r\n\t\t\tc-38.25-15.3-83.232-8.262-115.362,20.502c-1.53,1.224-3.06,2.754-4.284,3.978l-91.8,91.799\r\n\t\t\tc-43.146,43.146-43.146,113.832,0,156.979c43.146,43.146,113.832,43.146,156.978,0l82.927-83.845\r\n\t\t\tC230.035,335.719,220.243,334.496,184.135,320.114z" })] }) }) }));
|
16
16
|
};
|
17
17
|
export const SVGSplitIcon = (props) => {
|
18
18
|
return _jsx("svg", { fill: tokens.colorNeutralForeground1, height: `${props.size}px`, width: `${props.size}px`, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 17 17", children: _jsx("path", { d: "M10.646 13.146l0.707 0.707-2.853 2.854-2.854-2.854 0.707-0.707 1.647 1.647v-3.772h1v3.772l1.646-1.647zM8 2.207v3.772h1v-3.772l1.646 1.646 0.707-0.707-2.853-2.853-2.854 2.853 0.707 0.707 1.647-1.646zM0 8v1h17v-1h-17z" }) });
|
@@ -22,31 +22,31 @@ export const HubSpotIcon = (props) => {
|
|
22
22
|
};
|
23
23
|
//get icons as html
|
24
24
|
export const GetSVGLinkIcon = (props) => {
|
25
|
-
return (`<svg fill="${tokens.colorNeutralForeground1}" height="${props.size}px" width="${props.size}px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 490.16 490.16">
|
26
|
-
<g>
|
27
|
-
<g>
|
28
|
-
<path d="M409.657,32.474c-43.146-43.146-113.832-43.146-156.978,0l-84.763,84.762c29.07-8.262,60.589-6.12,88.129,6.732
|
29
|
-
l44.063-44.064c17.136-17.136,44.982-17.136,62.118,0c17.136,17.136,17.136,44.982,0,62.118l-55.386,55.386l-36.414,36.414
|
30
|
-
c-17.136,17.136-44.982,17.136-62.119,0l-47.43,47.43c11.016,11.017,23.868,19.278,37.332,24.48
|
31
|
-
c36.415,14.382,78.643,8.874,110.467-16.219c3.06-2.447,6.426-5.201,9.18-8.262l57.222-57.222l34.578-34.578
|
32
|
-
C453.109,146.306,453.109,75.926,409.657,32.474z"/>
|
33
|
-
<path d="M184.135,320.114l-42.228,42.228c-17.136,17.137-44.982,17.137-62.118,0c-17.136-17.136-17.136-44.981,0-62.118
|
34
|
-
l91.8-91.799c17.136-17.136,44.982-17.136,62.119,0l47.43-47.43c-11.016-11.016-23.868-19.278-37.332-24.48
|
35
|
-
c-38.25-15.3-83.232-8.262-115.362,20.502c-1.53,1.224-3.06,2.754-4.284,3.978l-91.8,91.799
|
36
|
-
c-43.146,43.146-43.146,113.832,0,156.979c43.146,43.146,113.832,43.146,156.978,0l82.927-83.845
|
37
|
-
C230.035,335.719,220.243,334.496,184.135,320.114z"/>
|
38
|
-
</g>
|
39
|
-
</g>
|
25
|
+
return (`<svg fill="${tokens.colorNeutralForeground1}" height="${props.size}px" width="${props.size}px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 490.16 490.16">
|
26
|
+
<g>
|
27
|
+
<g>
|
28
|
+
<path d="M409.657,32.474c-43.146-43.146-113.832-43.146-156.978,0l-84.763,84.762c29.07-8.262,60.589-6.12,88.129,6.732
|
29
|
+
l44.063-44.064c17.136-17.136,44.982-17.136,62.118,0c17.136,17.136,17.136,44.982,0,62.118l-55.386,55.386l-36.414,36.414
|
30
|
+
c-17.136,17.136-44.982,17.136-62.119,0l-47.43,47.43c11.016,11.017,23.868,19.278,37.332,24.48
|
31
|
+
c36.415,14.382,78.643,8.874,110.467-16.219c3.06-2.447,6.426-5.201,9.18-8.262l57.222-57.222l34.578-34.578
|
32
|
+
C453.109,146.306,453.109,75.926,409.657,32.474z"/>
|
33
|
+
<path d="M184.135,320.114l-42.228,42.228c-17.136,17.137-44.982,17.137-62.118,0c-17.136-17.136-17.136-44.981,0-62.118
|
34
|
+
l91.8-91.799c17.136-17.136,44.982-17.136,62.119,0l47.43-47.43c-11.016-11.016-23.868-19.278-37.332-24.48
|
35
|
+
c-38.25-15.3-83.232-8.262-115.362,20.502c-1.53,1.224-3.06,2.754-4.284,3.978l-91.8,91.799
|
36
|
+
c-43.146,43.146-43.146,113.832,0,156.979c43.146,43.146,113.832,43.146,156.978,0l82.927-83.845
|
37
|
+
C230.035,335.719,220.243,334.496,184.135,320.114z"/>
|
38
|
+
</g>
|
39
|
+
</g>
|
40
40
|
</svg>`);
|
41
41
|
};
|
42
42
|
export const GetSVGSplitIcon = (props) => {
|
43
|
-
return `<svg fill="${tokens.colorNeutralForeground1}" height="${props.size}px" width="${props.size}px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17">
|
44
|
-
<path d="M10.646 13.146l0.707 0.707-2.853 2.854-2.854-2.854 0.707-0.707 1.647 1.647v-3.772h1v3.772l1.646-1.647zM8 2.207v3.772h1v-3.772l1.646 1.646 0.707-0.707-2.853-2.853-2.854 2.853 0.707 0.707 1.647-1.646zM0 8v1h17v-1h-17z" />
|
43
|
+
return `<svg fill="${tokens.colorNeutralForeground1}" height="${props.size}px" width="${props.size}px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17">
|
44
|
+
<path d="M10.646 13.146l0.707 0.707-2.853 2.854-2.854-2.854 0.707-0.707 1.647 1.647v-3.772h1v3.772l1.646-1.647zM8 2.207v3.772h1v-3.772l1.646 1.646 0.707-0.707-2.853-2.853-2.854 2.853 0.707 0.707 1.647-1.646zM0 8v1h17v-1h-17z" />
|
45
45
|
</svg>`;
|
46
46
|
};
|
47
47
|
export function GetSVGCopyIcon(props) {
|
48
|
-
return (`<svg fill="var(--colorNeutralForeground1)" width="${props.size}px" height="${props.size}px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
49
|
-
<path d="M8 2a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h6a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8ZM7 4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4ZM4 6a2 2 0 0 1 1-1.73V14.5A2.5 2.5 0 0 0 7.5 17h6.23A2 2 0 0 1 12 18H7.5A3.5 3.5 0 0 1 4 14.5V6Z"></path>
|
48
|
+
return (`<svg fill="var(--colorNeutralForeground1)" width="${props.size}px" height="${props.size}px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
49
|
+
<path d="M8 2a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h6a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8ZM7 4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4ZM4 6a2 2 0 0 1 1-1.73V14.5A2.5 2.5 0 0 0 7.5 17h6.23A2 2 0 0 1 12 18H7.5A3.5 3.5 0 0 1 4 14.5V6Z"></path>
|
50
50
|
</svg>`);
|
51
51
|
}
|
52
52
|
export function IconToSVG(icon) {
|
package/dist/controls/svg.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/controls/svg.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,MAAM,CAAC,MAAM,WAAW,GAA6D,CAAC,KAAK,EAAE,EAAE;IAC3F,OAAO,CACH,cAAK,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,OAAO,EAAC,KAAK,EAAC,EAAE,EAAC,SAAS,EAAC,KAAK,EAAC,4BAA4B,EAAC,UAAU,EAAC,8BAA8B,EAC7J,OAAO,EAAC,qBAAqB,EAAC,QAAQ,EAAC,UAAU,YACjD,sBACI,eAAM,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,EAAC,
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/controls/svg.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC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AAC,aAAa,YAC3J,eAAM,CAAC,EAAC,kvBAAkvB,GAAG,GAC3vB,CAAC;AACX,CAAC,CAAA;AAGD,mBAAmB;AACnB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAuB,EAAE,EAAE;IACtD,OAAO,CACH,cAAc,MAAM,CAAC,uBAAuB,aAAa,KAAK,CAAC,IAAI,cAAc,KAAK,CAAC,IAAI;;;;;;;;;;;;;;;eAepF,CACV,CAAC;AACN,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAuB,EAAE,EAAE;IACvD,OAAO,cAAc,MAAM,CAAC,uBAAuB,aAAa,KAAK,CAAC,IAAI,cAAc,KAAK,CAAC,IAAI;;OAE/F,CAAC;AACR,CAAC,CAAA;AAED,MAAM,UAAU,cAAc,CAAC,KAAuB;IAClD,OAAO,CACH,qDAAqD,KAAK,CAAC,IAAI,eAAe,KAAK,CAAC,IAAI;;eAEjF,CACV,CAAA;AACL,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAiB;IACvC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC"}
|
@@ -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"}
|