@spectric/ui 0.0.4 → 0.0.6
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/dist/assets/Banner-CZ3qKIQC.js +172 -0
- package/dist/assets/Banner.stories-BMf4MBpI.js +19 -0
- package/dist/assets/BitDisplay.stories-wztXxpxe.js +18 -0
- package/dist/assets/Bits-C_TSTjST.js +1 -0
- package/dist/assets/Button.stories-gHxjWwVf.js +142 -0
- package/dist/assets/Color-F6OSRLHC-AjFOL-zN.js +1 -0
- package/dist/assets/DocsRenderer-CFRXHY34-CvW79YxE.js +761 -0
- package/dist/assets/Header.stories-Bc09U6g1.js +25 -0
- package/dist/assets/Page.stories-DNJKhAFs.js +114 -0
- package/dist/assets/QueryBar.stories-Da5C-SV4.js +17 -0
- package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +1 -0
- package/dist/assets/chunk-L4EGOTBX-AI5g0G5Z.js +2 -0
- package/dist/assets/data-CwENMT7L.js +3 -0
- package/dist/assets/dialog-CFHXbUTQ.js +611 -0
- package/dist/assets/directive-helpers-IbK5tOA8.js +5 -0
- package/dist/assets/entry-preview-Di-j0SPB.js +4 -0
- package/dist/assets/entry-preview-docs-CUBRpM7y.js +1 -0
- package/dist/assets/iframe-BQFuVTVZ.js +2 -0
- package/dist/assets/index-BCiKWbv6.js +1 -0
- package/dist/assets/index-BHYIh-Xd.js +8 -0
- package/dist/assets/index-DBGhiA-l.js +1 -0
- package/dist/assets/index-DrFu-skq.js +6 -0
- package/dist/assets/index-oFsFREWh.js +9 -0
- package/dist/assets/input.stories-Cgdv-5bN.js +58 -0
- package/dist/assets/lit-element-UdLzEcH-.js +19 -0
- package/dist/assets/preview-BWzBA1C2.js +396 -0
- package/dist/assets/preview-CGiTbRot.js +2 -0
- package/dist/assets/preview-D77C14du.js +34 -0
- package/dist/assets/preview-DEMzn_yN.js +1 -0
- package/dist/assets/preview-DFmD0pui.js +1 -0
- package/dist/assets/preview-DGUiP6tS.js +7 -0
- package/dist/assets/preview-DQVTHjv1.js +182 -0
- package/dist/assets/preview-aVwhiz9X.js +1 -0
- package/dist/assets/tiny-invariant-CopsF_GD.js +1 -0
- package/dist/classes/BitArray.d.ts +11 -0
- package/dist/classes/DisposibleElement.d.ts +21 -0
- package/dist/components/Banner.d.ts +51 -0
- package/dist/components/Bitdisplay.d.ts +91 -0
- package/dist/components/Button.d.ts +65 -0
- package/dist/components/Header.d.ts +70 -0
- package/dist/components/Page.d.ts +93 -0
- package/dist/components/Panel.d.ts +14 -0
- package/dist/components/ThemeProvider.d.ts +99 -0
- package/dist/components/button.css.d.ts +2 -0
- package/dist/components/configurations/classifications.d.ts +29 -0
- package/dist/components/dialog/dialog.css.d.ts +1 -0
- package/dist/components/dialog/dialog.d.ts +60 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/header.css.d.ts +2 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/input.css.d.ts +2 -0
- package/dist/components/input.d.ts +156 -0
- package/dist/components/page.css.d.ts +2 -0
- package/dist/components/panel.css.d.ts +2 -0
- package/dist/components/query_bar/QueryBar.d.ts +113 -0
- package/dist/components/query_bar/index.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/ast/ast.d.ts +13 -0
- package/dist/components/query_bar/querylanguage/kuery/ast/index.d.ts +1 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/and.d.ts +9 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/exists.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/index.d.ts +1 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/is.d.ts +34 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/nested.d.ts +11 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/not.d.ts +9 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/or.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/range.d.ts +10 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_fields.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_full_field_name_node.d.ts +2 -0
- package/dist/components/query_bar/querylanguage/kuery/index.d.ts +7 -0
- package/dist/components/query_bar/querylanguage/kuery/kuery_syntax_error.d.ts +13 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/function.d.ts +5 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/index.d.ts +3 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/literal.d.ts +3 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/named_arg.d.ts +4 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/types.d.ts +49 -0
- package/dist/components/query_bar/querylanguage/kuery/node_types/wildcard.d.ts +8 -0
- package/dist/components/query_bar/querylanguage/kuery/types.d.ts +18 -0
- package/dist/components/query_bar/querylanguage/outputTypes/toCQL.d.ts +14 -0
- package/dist/components/query_bar/querylanguage/outputTypes/toMongo.d.ts +20 -0
- package/dist/components/query_bar/querylanguage/utils.d.ts +1 -0
- package/dist/components/query_bar/types.d.ts +56 -0
- package/dist/components/splitview/index.d.ts +1 -0
- package/dist/components/splitview/splitview.css.d.ts +1 -0
- package/dist/components/splitview/splitview.d.ts +73 -0
- package/dist/components/types.d.ts +21 -0
- package/dist/custom-elements.json +1919 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +639 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4139 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.html +190 -0
- package/dist/index.json +1 -0
- package/dist/index.umd.js +945 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js +333 -0
- package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js.LEGAL.txt +40 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
- package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/dist/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
- package/dist/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +1028 -0
- package/dist/sb-manager/globals-runtime.js +40861 -0
- package/dist/sb-manager/globals.js +48 -0
- package/dist/sb-manager/runtime.js +13338 -0
- package/dist/sb-preview/globals.js +33 -0
- package/dist/sb-preview/runtime.js +7174 -0
- package/dist/style.css +1 -0
- package/dist/utils/debounce.d.ts +2 -0
- package/dist/utils/spread.d.ts +32 -0
- package/package.json +6 -1
- package/src/components/query_bar/QueryBar.ts +15 -2
- package/.gitlab-ci.yml +0 -28
- package/.nvmrc +0 -1
- package/.storybook/analyze.sh +0 -4
- package/.storybook/main.ts +0 -55
- package/.storybook/preview.ts +0 -42
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -41
- package/html-include.png +0 -0
- package/test/__init__.py +0 -9
- package/test/elastic.py +0 -9
- package/test/interface.py +0 -16
- package/tsconfig.json +0 -29
- package/vite.config.js +0 -34
- package/vue-example.png +0 -0
- package/vue-include.png +0 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
spectric-input{--input-color: var(--spectric-input-color, #f4f4f4);--border-radius: var(--spectric-border-radius, .4em);--input-bottom: var(--spectric-input-bottom, var(--spectric-button-primary, #a8a8a8));--input-bottom-focused: var(--primary, #1ea7fd);--text-on-color: var(--spectric-text-on-color, #ffffff);--text-on-color-disabled: var(--spectric-text-on-color-disabled, #8d8d8d);--text-placeholder: rgba(22, 22, 22, .4);--text-primary: var(--spectric-text-primary, #161616);--text-secondary: var(--spectric-text-secondary, #525252)}spectric-input .inputWrapper{color:var(--text-secondary)}spectric-input .inputWrapper input{box-sizing:border-box;margin:0;vertical-align:baseline;font-size:.875rem;font-weight:400;line-height:1.28572;letter-spacing:.16px;outline:transparent solid 2px;outline-offset:-2px;border:none;padding:0 1rem;background-color:var(--input-color);color:var(--text-primary, #161616);font-family:inherit;inline-size:100%;block-size:2.5rem}spectric-input .inputWrapper .inputContainer:active:after,spectric-input .inputContainer:focus-within:after{border-bottom-color:var(--input-bottom-focused);width:calc(100% - 5px);transition:width .4s ease-in-out}spectric-input .inputWrapper input:read-only{background-color:transparent;border-bottom-color:var(--border-disabled)}spectric-input .inputContainer{position:relative;border-radius:var(--border-radius);overflow:hidden}spectric-input .inputContainer:after{content:"";width:0px;transition:background-color .4s cubic-bezier(.2,0,.38,.9),border-bottom-color .4s cubic-bezier(.2,0,.38,.9);border-bottom-color:var(--input-bottom);border-bottom-style:solid;border-bottom-width:1px;position:absolute;left:2.5px;bottom:0}spectric-input #helper-text{height:18px}spectric-input spectric-button{position:absolute;right:4px;bottom:3px}spectric-query{font-family:monospace}spectric-query .autocomplete{color:var(--spectric-text-primary, #161616);border-radius:0em 0em var(--spectric-border-radius, .4em) var(--spectric-border-radius, .4em);background-color:var(--spectric-background, #ffffff);border:1px solid var(--spectric-background-hover, rgba(141, 141, 141, .12));max-height:300px;border-top:0px;margin:-18px 0 0;position:fixed;top:anchor(bottom);justify-self:anchor-center;text-align:center}spectric-query .autocomplete .optiontype{float:left;max-width:10px}spectric-query .autocomplete .label{position:absolute;right:0}spectric-query .autocomplete .option.active,spectric-query .autocomplete .option:hover{background-color:var(--spectric-background-hover, rgba(141, 141, 141, .12));border-bottom:1px solid var(--primary, #1ea7fd)}spectric-query .autocomplete .option{border-bottom:1px solid transparent;padding:8px}.query-bar-date-quick-select{display:flex;justify-content:space-evenly}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Part } from 'lit';
|
|
2
|
+
import { AsyncDirective } from 'lit/async-directive.js';
|
|
3
|
+
/**
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { html, render } from 'lit';
|
|
6
|
+
* import { spreadProps } from '@open-wc/lit-helpers';
|
|
7
|
+
*
|
|
8
|
+
* render(
|
|
9
|
+
* html`
|
|
10
|
+
* <div
|
|
11
|
+
* ${spreadProps({
|
|
12
|
+
* prop1: 'prop1',
|
|
13
|
+
* prop2: ['Prop', '2'],
|
|
14
|
+
* prop3: {
|
|
15
|
+
* prop: 3,
|
|
16
|
+
* }
|
|
17
|
+
* })}
|
|
18
|
+
* ></div>
|
|
19
|
+
* `,
|
|
20
|
+
* document.body,
|
|
21
|
+
* );
|
|
22
|
+
*/
|
|
23
|
+
export declare class SpreadPropsDirective extends AsyncDirective {
|
|
24
|
+
host: EventTarget | object | Element;
|
|
25
|
+
element: Element;
|
|
26
|
+
prevData: any;
|
|
27
|
+
render(_spreadData: any): symbol;
|
|
28
|
+
update(part: Part, [spreadData]: Parameters<this['render']>): void;
|
|
29
|
+
apply(data: any): void;
|
|
30
|
+
groom(data: any): void;
|
|
31
|
+
}
|
|
32
|
+
export declare const spreadProps: (_spreadData: any) => import('lit-html/directive.js').DirectiveResult<typeof SpreadPropsDirective>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectric/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/*",
|
|
10
|
+
"src/*",
|
|
11
|
+
"README.MD"
|
|
12
|
+
],
|
|
8
13
|
"scripts": {
|
|
9
14
|
"build": "tsc && vite build",
|
|
10
15
|
"start": "storybook dev -p 6006",
|
|
@@ -52,6 +52,11 @@ export interface IQueryProps {
|
|
|
52
52
|
* Callback that will provide values for specific fields
|
|
53
53
|
*/
|
|
54
54
|
getValuesForField: (field: string, text: string) => Promise<string[]>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Input placeholder
|
|
58
|
+
*/
|
|
59
|
+
placeholder: string;
|
|
55
60
|
}
|
|
56
61
|
type LabelValue = {
|
|
57
62
|
label?: string;
|
|
@@ -85,6 +90,8 @@ const DateOperators: Record<string, LabelValue> = Object.fromEntries(Object.entr
|
|
|
85
90
|
@customElement('spectric-query')
|
|
86
91
|
export class SpectricQuery extends LitElement implements IQueryProps {
|
|
87
92
|
private uuid: string;
|
|
93
|
+
@property({ type: String, reflect: true })
|
|
94
|
+
placeholder: string = "";
|
|
88
95
|
constructor() {
|
|
89
96
|
super()
|
|
90
97
|
this.uuid = crypto.randomUUID()
|
|
@@ -226,6 +233,7 @@ export class SpectricQuery extends LitElement implements IQueryProps {
|
|
|
226
233
|
}}>${v}</a>`)}
|
|
227
234
|
</div>
|
|
228
235
|
<spectric-input variant="datetime-local" @change=${(e: any) => {
|
|
236
|
+
|
|
229
237
|
if (!e.target) {
|
|
230
238
|
return
|
|
231
239
|
}
|
|
@@ -265,8 +273,13 @@ export class SpectricQuery extends LitElement implements IQueryProps {
|
|
|
265
273
|
}
|
|
266
274
|
this.completions = completions
|
|
267
275
|
if (this.completions.length && this._autocomplete) {
|
|
268
|
-
let { width } = this._input.getBoundingClientRect();
|
|
276
|
+
let { width, left, bottom } = this._input.getBoundingClientRect();
|
|
269
277
|
this._autocomplete.showPopover();
|
|
278
|
+
//Older firefox doesn't support anchor positions using css properties so manually position here
|
|
279
|
+
if (!("anchorName" in document.documentElement.style)) {
|
|
280
|
+
this._autocomplete.style.left = `${left + 3.75}px`
|
|
281
|
+
this._autocomplete.style.top = `${bottom}px`
|
|
282
|
+
}
|
|
270
283
|
this._autocomplete.style.width = `${width - 15}px`;
|
|
271
284
|
}
|
|
272
285
|
}
|
|
@@ -340,7 +353,7 @@ export class SpectricQuery extends LitElement implements IQueryProps {
|
|
|
340
353
|
}
|
|
341
354
|
protected render() {
|
|
342
355
|
return html`
|
|
343
|
-
<spectric-input style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows}></spectric-input>
|
|
356
|
+
<spectric-input .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${(e: Event) => e.stopPropagation()}></spectric-input>
|
|
344
357
|
<div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
|
|
345
358
|
${this.completions.map((option: Completion, index) =>
|
|
346
359
|
html`<div @click=${() => {
|
package/.gitlab-ci.yml
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
stages:
|
|
2
|
-
- publish
|
|
3
|
-
- pages
|
|
4
|
-
|
|
5
|
-
publish:
|
|
6
|
-
image: node:20.15.1
|
|
7
|
-
stage: publish
|
|
8
|
-
only:
|
|
9
|
-
- tags
|
|
10
|
-
script:
|
|
11
|
-
- npm install
|
|
12
|
-
- echo '//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}'>.npmrc
|
|
13
|
-
- echo '//${CI_SERVER_HOST}/api/v4/groups/${CI_PROJECT_NAMESPACE_ID}/-/packages/npm/:_authToken=<token>'>>.npmrc
|
|
14
|
-
- echo '//${CI_SERVER_HOST}/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}'>>.npmrc
|
|
15
|
-
- npm run build
|
|
16
|
-
- npm publish
|
|
17
|
-
|
|
18
|
-
pages:
|
|
19
|
-
image: node:20.15.1
|
|
20
|
-
stage: pages
|
|
21
|
-
only:
|
|
22
|
-
- tags
|
|
23
|
-
script:
|
|
24
|
-
- npm install
|
|
25
|
-
- npm run storybook:build
|
|
26
|
-
artifacts:
|
|
27
|
-
paths:
|
|
28
|
-
- public
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20.15.1
|
package/.storybook/analyze.sh
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
npx web-component-analyzer src --outFiles .storybook/build/custom-elements-next.json
|
|
3
|
-
cmp -s .storybook/build/custom-elements.json .storybook/build/custom-elements-next.json || mv .storybook/build/custom-elements-next.json .storybook/build/custom-elements.json
|
|
4
|
-
npx web-component-analyzer src -f vscode --outFiles dist/vscode-custom-elements.json
|
package/.storybook/main.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from "@storybook/web-components-vite";
|
|
2
|
-
import run from "vite-plugin-run";
|
|
3
|
-
import execa from 'execa';
|
|
4
|
-
import { version } from '../package.json';
|
|
5
|
-
const config: StorybookConfig = {
|
|
6
|
-
managerHead: (headHtmlContent) => {
|
|
7
|
-
console.log(headHtmlContent)
|
|
8
|
-
const style = `
|
|
9
|
-
<style>
|
|
10
|
-
.sidebar-header {
|
|
11
|
-
margin-bottom: 36px;
|
|
12
|
-
position: relative;
|
|
13
|
-
}
|
|
14
|
-
.sidebar-header div:first-of-type {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
.sidebar-header::before {
|
|
18
|
-
content: 'Spectric UI ${version}';
|
|
19
|
-
font-size: 20px;
|
|
20
|
-
color: #5C6870;
|
|
21
|
-
font-weight: normal;
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
|
-
`;
|
|
25
|
-
return `${headHtmlContent}\n${style}`;
|
|
26
|
-
},
|
|
27
|
-
stories: [{
|
|
28
|
-
// 👇 Sets the directory containing your stories
|
|
29
|
-
directory: '../src/stories/',
|
|
30
|
-
// 👇 Storybook will load all files that match this glob
|
|
31
|
-
files: '*.stories.*',
|
|
32
|
-
// 👇 Used when generating automatic titles for your stories.
|
|
33
|
-
titlePrefix: 'Spectric UI Components',
|
|
34
|
-
}],
|
|
35
|
-
addons: ["@storybook/addon-essentials", "@chromatic-com/storybook"],
|
|
36
|
-
framework: {
|
|
37
|
-
name: "@storybook/web-components-vite",
|
|
38
|
-
options: {
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
async viteFinal(config, options) {
|
|
42
|
-
//analyze webcomponent and if the json output is different move it into place this will cause storybook to reload the fresh info
|
|
43
|
-
config.plugins?.push(
|
|
44
|
-
run(
|
|
45
|
-
{
|
|
46
|
-
silent: false,
|
|
47
|
-
name: 'Create webcomponent json',
|
|
48
|
-
run: ['.storybook/analyze.sh'],
|
|
49
|
-
pattern: ['**/*.ts'],
|
|
50
|
-
},
|
|
51
|
-
))
|
|
52
|
-
return config;
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
export default config;
|
package/.storybook/preview.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Preview } from "@storybook/web-components";
|
|
2
|
-
import { addons } from '@storybook/manager-api';
|
|
3
|
-
import { setCustomElementsManifest } from '@storybook/web-components';
|
|
4
|
-
import customElements from './build/custom-elements.json';
|
|
5
|
-
customElements.tags.forEach(tag => {
|
|
6
|
-
if (tag.properties) {
|
|
7
|
-
let stylesindex = tag.properties.findIndex(e => e.name == "styles")
|
|
8
|
-
if (stylesindex != -1) {
|
|
9
|
-
tag.properties.splice(stylesindex, 1)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
})
|
|
13
|
-
setCustomElementsManifest(customElements);
|
|
14
|
-
|
|
15
|
-
import { create } from '@storybook/theming/create';
|
|
16
|
-
import { version } from '../package.json';
|
|
17
|
-
|
|
18
|
-
const theme = create({
|
|
19
|
-
base: "light",
|
|
20
|
-
// Typography
|
|
21
|
-
fontBase: "'Helvetica Neue', Arial, sans-serif",
|
|
22
|
-
fontCode: "Menlo, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace",
|
|
23
|
-
brandTitle: `Spectric UI ${version}`,
|
|
24
|
-
brandImage: "https://static.wixstatic.com/media/bb8de2_d075320863814eeb9c954fcc57ce2822%7Emv2.png/v1/fill/w_192%2Ch_192%2Clg_1%2Cusm_0.66_1.00_0.01/bb8de2_d075320863814eeb9c954fcc57ce2822%7Emv2.png",
|
|
25
|
-
brandUrl: 'https://gitlab.spectric.com/web/spectric-ui',
|
|
26
|
-
});
|
|
27
|
-
addons.setConfig({
|
|
28
|
-
theme
|
|
29
|
-
});
|
|
30
|
-
const preview: Preview = {
|
|
31
|
-
parameters: {
|
|
32
|
-
docs: { canvas: { layout: "padded" }, theme: theme },
|
|
33
|
-
controls: {
|
|
34
|
-
matchers: {
|
|
35
|
-
color: /(background|color)$/i,
|
|
36
|
-
date: /Date$/i,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default preview;
|
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.formatOnSave": true,
|
|
3
|
-
"javascript.format.enable": true,
|
|
4
|
-
"typescript.format.enable": true,
|
|
5
|
-
"javascript.format.insertSpaceAfterCommaDelimiter": true,
|
|
6
|
-
"javascript.format.insertSpaceAfterConstructor": false,
|
|
7
|
-
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
|
|
8
|
-
"javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
|
|
9
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": true,
|
|
10
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
|
|
11
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
|
|
12
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
|
|
13
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
|
|
14
|
-
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
|
|
15
|
-
"javascript.format.insertSpaceAfterSemicolonInForStatements": true,
|
|
16
|
-
"javascript.format.insertSpaceBeforeAndAfterBinaryOperators": true,
|
|
17
|
-
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
|
|
18
|
-
"javascript.format.placeOpenBraceOnNewLineForControlBlocks": false,
|
|
19
|
-
"javascript.format.placeOpenBraceOnNewLineForFunctions": false,
|
|
20
|
-
"javascript.format.semicolons": "ignore",
|
|
21
|
-
"typescript.format.indentSwitchCase": true,
|
|
22
|
-
"typescript.format.insertSpaceAfterCommaDelimiter": true,
|
|
23
|
-
"typescript.format.insertSpaceAfterConstructor": false,
|
|
24
|
-
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
|
|
25
|
-
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
|
|
26
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": true,
|
|
27
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
|
|
28
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
|
|
29
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
|
|
30
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
|
|
31
|
-
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
|
|
32
|
-
"typescript.format.insertSpaceAfterSemicolonInForStatements": true,
|
|
33
|
-
"typescript.format.insertSpaceAfterTypeAssertion": false,
|
|
34
|
-
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": true,
|
|
35
|
-
"typescript.format.insertSpaceBeforeFunctionParenthesis": false,
|
|
36
|
-
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": false,
|
|
37
|
-
"typescript.format.placeOpenBraceOnNewLineForFunctions": false,
|
|
38
|
-
"typescript.format.semicolons": "ignore",
|
|
39
|
-
"typescript.tsserver.enableTracing": false,
|
|
40
|
-
"typescript.tsserver.log": "off"
|
|
41
|
-
}
|
package/html-include.png
DELETED
|
Binary file
|
package/test/__init__.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
from test.elastic import ElasticPersistance
|
|
2
|
-
from typing import Generic,TypeVar,Any
|
|
3
|
-
T = TypeVar("T",callable)
|
|
4
|
-
|
|
5
|
-
config = {"type":"elastic","host":"elastic"}
|
|
6
|
-
def get_persistance(locator:str,cls:T):
|
|
7
|
-
if config['type'] == "elastic":
|
|
8
|
-
return ElasticPersistance[T]({**config,"index":locator},cls)
|
|
9
|
-
raise ValueError("unknown persistance type")
|
package/test/elastic.py
DELETED
package/test/interface.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from typing import Generic,TypeVar,Any
|
|
2
|
-
|
|
3
|
-
from test import T
|
|
4
|
-
|
|
5
|
-
class IPersistance(Generic[T]):
|
|
6
|
-
def __init__(self,config:Any,cls:T):
|
|
7
|
-
"""
|
|
8
|
-
init function
|
|
9
|
-
"""
|
|
10
|
-
pass
|
|
11
|
-
def get_one_by_id(self,id:str) -> T|None:
|
|
12
|
-
"""
|
|
13
|
-
gets data from database
|
|
14
|
-
"""
|
|
15
|
-
pass
|
|
16
|
-
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2021",
|
|
4
|
-
"experimentalDecorators": true,
|
|
5
|
-
"useDefineForClassFields": false,
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "Bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"sourceMap": true,
|
|
17
|
-
"declaration": false,
|
|
18
|
-
|
|
19
|
-
/* Linting */
|
|
20
|
-
"strict": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["src"],
|
|
26
|
-
"exclude": ["src/stories","**/*test*"],
|
|
27
|
-
"declaration": true,
|
|
28
|
-
"pretty":false
|
|
29
|
-
}
|
package/vite.config.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import { defineConfig } from 'vite';
|
|
3
|
-
import dts from 'vite-plugin-dts';
|
|
4
|
-
import run from "vite-plugin-run";
|
|
5
|
-
// add dts() to the plugins array
|
|
6
|
-
//plugins: [react(), dts()],
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
plugins:[dts({ tsconfigPath: './tsconfig.json' }), run(
|
|
9
|
-
{
|
|
10
|
-
silent:false,
|
|
11
|
-
name: 'Create vscode webcomponent json',
|
|
12
|
-
run: ['npx', 'web-component-analyzer', 'src', '-f', 'vscode', '--outFiles','dist/custom-elements.json'],
|
|
13
|
-
},
|
|
14
|
-
)],
|
|
15
|
-
build: {
|
|
16
|
-
lib: {
|
|
17
|
-
entry: path.resolve(__dirname, 'src'),
|
|
18
|
-
name: 'Spectric-UI',
|
|
19
|
-
fileName: (format) => `index.${format}.js`
|
|
20
|
-
},
|
|
21
|
-
rollupOptions: {
|
|
22
|
-
// make sure to externalize deps that shouldn't be bundled
|
|
23
|
-
// into your library
|
|
24
|
-
//external: ['vue'],
|
|
25
|
-
output: {
|
|
26
|
-
// Provide global variables to use in the UMD build
|
|
27
|
-
// for externalized deps
|
|
28
|
-
// globals: {
|
|
29
|
-
// vue: 'Vue'
|
|
30
|
-
// }
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
})
|
package/vue-example.png
DELETED
|
Binary file
|
package/vue-include.png
DELETED
|
Binary file
|