@chasi/ui
Advanced tools
Comparing version 0.1.51 to 0.2.1
@@ -1,4 +0,4 @@ | ||
export { default as pannable } from './pannable'; | ||
export { default as zoomable } from './zoomable'; | ||
export { default as portal } from './portal'; | ||
export { default as observer } from './observer'; | ||
export { default as pannable } from './pannable.js'; | ||
export { default as zoomable } from './zoomable.js'; | ||
export { default as portal } from './portal.js'; | ||
export { default as observer } from './observer.js'; |
@@ -1,4 +0,4 @@ | ||
export { default as pannable } from './pannable'; | ||
export { default as zoomable } from './zoomable'; | ||
export { default as portal } from './portal'; | ||
export { default as observer } from './observer'; | ||
export { default as pannable } from './pannable.js'; | ||
export { default as zoomable } from './zoomable.js'; | ||
export { default as portal } from './portal.js'; | ||
export { default as observer } from './observer.js'; |
@@ -10,5 +10,5 @@ type ObserverParams = { | ||
} | ||
export default function (node: HTMLElement | SVGElement, { onIntersect, once }: ObserverParams): { | ||
export default function (node: HTMLElement, { onIntersect, once }: ObserverParams): { | ||
destroy: () => void; | ||
}; | ||
export {}; |
@@ -0,1 +1,2 @@ | ||
import type { Action } from 'svelte/action'; | ||
type Coord = { | ||
@@ -13,5 +14,3 @@ x: number; | ||
}; | ||
export default function (node: HTMLElement | SVGElement, params?: PannableParams): { | ||
destroy(): void; | ||
}; | ||
export {}; | ||
declare const pannable: Action<HTMLElement, PannableParams>; | ||
export default pannable; |
@@ -1,15 +0,4 @@ | ||
import { throttle } from '../CGraph'; | ||
export default function (node, params) { | ||
const pannable = (node, params) => { | ||
let x; | ||
let y; | ||
const trotMove = throttle((event) => { | ||
if (!params || !params.onMove) | ||
return; | ||
const e = event instanceof MouseEvent ? event : event.touches[0]; | ||
const dx = e.clientX - x; | ||
const dy = e.clientY - y; | ||
x = e.clientX; | ||
y = e.clientY; | ||
params.onMove(event, { x, y, dx, dy }); | ||
}, 10); | ||
function handleMousedown(event) { | ||
@@ -23,7 +12,17 @@ event.stopPropagation(); | ||
} | ||
window.addEventListener('mousemove', trotMove); | ||
window.addEventListener('mousemove', handleMousemove); | ||
window.addEventListener('mouseup', handleMouseup); | ||
window.addEventListener('touchmove', trotMove); | ||
window.addEventListener('touchmove', handleMousemove); | ||
window.addEventListener('touchend', handleMouseup); | ||
} | ||
function handleMousemove(event) { | ||
const e = event instanceof MouseEvent ? event : event.touches[0]; | ||
const dx = e.clientX - x; | ||
const dy = e.clientY - y; | ||
x = e.clientX; | ||
y = e.clientY; | ||
if (params && params.onMove) { | ||
params.onMove(event, { x, y, dx, dy }); | ||
} | ||
} | ||
function handleMouseup(event) { | ||
@@ -36,19 +35,16 @@ const e = event instanceof MouseEvent ? event : event.changedTouches[0]; | ||
} | ||
window.removeEventListener('mousemove', trotMove); | ||
window.removeEventListener('mousemove', handleMousemove); | ||
window.removeEventListener('mouseup', handleMouseup); | ||
window.removeEventListener('touchmove', trotMove); | ||
window.removeEventListener('touchmove', handleMousemove); | ||
window.removeEventListener('touchend', handleMouseup); | ||
} | ||
// @ts-ignore | ||
node.addEventListener('mousedown', handleMousedown); | ||
// @ts-ignore | ||
node.addEventListener('touchstart', handleMousedown); | ||
return { | ||
destroy() { | ||
// @ts-ignore | ||
node.removeEventListener('mousedown', handleMousedown); | ||
// @ts-ignore | ||
node.removeEventListener('touchstart', handleMousedown); | ||
} | ||
}; | ||
} | ||
}; | ||
export default pannable; |
@@ -1,6 +0,6 @@ | ||
export default function (node: HTMLElement | SVGElement, option: { | ||
target: string | Element; | ||
export default function (node: HTMLElement, option: { | ||
target: string; | ||
prepend?: boolean; | ||
}): { | ||
destroy(): void; | ||
destroy: () => void; | ||
}; |
export default function (node, option) { | ||
const targetNode = option.target instanceof Element ? option.target : document.querySelector(option.target); | ||
const targetNode = document.querySelector(option.target); | ||
if (!targetNode) | ||
@@ -4,0 +4,0 @@ throw 'Target Element must exist on the DOM'; |
type ZoomableParams = { | ||
onZoom: (delta: number, center: { | ||
onZoom?: (delta: number, center: { | ||
x: number; | ||
@@ -7,5 +7,5 @@ y: number; | ||
}; | ||
export default function (node: HTMLElement | SVGElement, params?: ZoomableParams): { | ||
destroy(): void; | ||
export default function (node: HTMLElement, params: ZoomableParams): { | ||
destroy?: () => void; | ||
}; | ||
export {}; |
@@ -1,20 +0,9 @@ | ||
import { throttle } from '../CGraph'; | ||
export default function (node, params) { | ||
let dist; | ||
const trotZoom = throttle((e) => { | ||
if (!params || !params.onZoom) | ||
return; | ||
if (e instanceof WheelEvent) { | ||
e.preventDefault(); | ||
function scroll(e) { | ||
e.preventDefault(); | ||
if (params.onZoom) { | ||
params.onZoom(e.deltaY, { x: e.clientX, y: e.clientY }, false); | ||
} | ||
else { | ||
const currentDist = Math.hypot(e.touches[0].pageX - e.touches[1].pageX, e.touches[0].pageY - e.touches[1].pageY); | ||
const delta = dist - currentDist; | ||
dist = currentDist; | ||
const centerX = (e.touches[0].pageX + e.touches[1].pageX) / 2; | ||
const centerY = (e.touches[0].pageY + e.touches[1].pageY) / 2; | ||
params.onZoom(delta, { x: centerX, y: centerY }, true); | ||
} | ||
}, 10); | ||
} | ||
function touchStart(e) { | ||
@@ -24,19 +13,25 @@ e.preventDefault(); | ||
dist = Math.hypot(e.touches[0].pageX - e.touches[1].pageX, e.touches[0].pageY - e.touches[1].pageY); | ||
window.addEventListener('touchmove', trotZoom); | ||
window.addEventListener('touchmove', handleTouchmove); | ||
window.addEventListener('touchend', handleTouchend); | ||
} | ||
} | ||
function handleTouchmove(e) { | ||
const currentDist = Math.hypot(e.touches[0].pageX - e.touches[1].pageX, e.touches[0].pageY - e.touches[1].pageY); | ||
const delta = dist - currentDist; | ||
dist = currentDist; | ||
if (params.onZoom) { | ||
const centerX = (e.touches[0].pageX + e.touches[1].pageX) / 2; | ||
const centerY = (e.touches[0].pageY + e.touches[1].pageY) / 2; | ||
params.onZoom(delta, { x: centerX, y: centerY }, true); | ||
} | ||
} | ||
function handleTouchend() { | ||
window.removeEventListener('touchmove', trotZoom); | ||
window.removeEventListener('touchmove', handleTouchmove); | ||
window.removeEventListener('touchend', handleTouchend); | ||
} | ||
// @ts-ignore | ||
node.addEventListener('wheel', trotZoom); | ||
// @ts-ignore | ||
node.addEventListener('wheel', scroll); | ||
node.addEventListener('touchstart', touchStart); | ||
return { | ||
destroy() { | ||
// @ts-ignore | ||
node.removeEventListener('wheel', trotZoom); | ||
// @ts-ignore | ||
node.removeEventListener('wheel', scroll); | ||
node.removeEventListener('touchstart', touchStart); | ||
@@ -43,0 +38,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -19,4 +19,4 @@ props: { | ||
export type CAvatarSlots = typeof __propDef.slots; | ||
export default class CAvatar extends SvelteComponentTyped<CAvatarProps, CAvatarEvents, CAvatarSlots> { | ||
export default class CAvatar extends SvelteComponent<CAvatarProps, CAvatarEvents, CAvatarSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -11,3 +11,6 @@ props: { | ||
slots: { | ||
action: {}; | ||
action: { | ||
close: () => void; | ||
open: () => void; | ||
}; | ||
default: { | ||
@@ -22,3 +25,3 @@ close: () => void; | ||
export type CDialogSlots = typeof __propDef.slots; | ||
export default class CDialog extends SvelteComponentTyped<CDialogProps, CDialogEvents, CDialogSlots> { | ||
export default class CDialog extends SvelteComponent<CDialogProps, CDialogEvents, CDialogSlots> { | ||
get open(): () => void; | ||
@@ -25,0 +28,0 @@ get close(): () => void; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare class __sveltets_Render<T> { | ||
@@ -7,2 +7,4 @@ props(): { | ||
handlerSelector?: string | undefined; | ||
ignoreHandler?: string | undefined; | ||
uid?: (T extends Record<string, any> ? keyof T : undefined) | undefined; | ||
class?: string | undefined; | ||
@@ -16,3 +18,6 @@ }; | ||
slots(): { | ||
default: {}; | ||
default: { | ||
item: T; | ||
index: any; | ||
}; | ||
}; | ||
@@ -23,4 +28,4 @@ } | ||
export type CDraggableListSlots<T> = ReturnType<__sveltets_Render<T>['slots']>; | ||
export default class CDraggableList<T> extends SvelteComponentTyped<CDraggableListProps<T>, CDraggableListEvents<T>, CDraggableListSlots<T>> { | ||
export default class CDraggableList<T> extends SvelteComponent<CDraggableListProps<T>, CDraggableListEvents<T>, CDraggableListSlots<T>> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -22,4 +22,4 @@ props: { | ||
export type CExpandSlots = typeof __propDef.slots; | ||
export default class CExpand extends SvelteComponentTyped<CExpandProps, CExpandEvents, CExpandSlots> { | ||
export default class CExpand extends SvelteComponent<CExpandProps, CExpandEvents, CExpandSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -16,4 +16,4 @@ props: Record<string, never>; | ||
export type CFormSlots = typeof __propDef.slots; | ||
export default class CForm extends SvelteComponentTyped<CFormProps, CFormEvents, CFormSlots> { | ||
export default class CForm extends SvelteComponent<CFormProps, CFormEvents, CFormSlots> { | ||
} | ||
export {}; |
@@ -1,3 +0,4 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import type { Rule, RuleParams } from './rules'; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Action } from 'svelte/action'; | ||
import type { Rule } from './rules.js'; | ||
declare const __propDef: { | ||
@@ -7,7 +8,2 @@ props: { | ||
loading?: boolean | undefined; | ||
rules?: Rule[] | undefined; | ||
active?: boolean | undefined; | ||
disabled?: boolean | undefined; | ||
values: RuleParams; | ||
isToggle?: boolean | undefined; | ||
}; | ||
@@ -19,3 +15,5 @@ events: { | ||
prepend: {}; | ||
default: {}; | ||
default: { | ||
rules: Action<HTMLInputElement | HTMLTextAreaElement, Rule[], Record<never, any>>; | ||
}; | ||
append: {}; | ||
@@ -27,4 +25,4 @@ }; | ||
export type CLabelSlots = typeof __propDef.slots; | ||
export default class CLabel extends SvelteComponentTyped<CLabelProps, CLabelEvents, CLabelSlots> { | ||
export default class CLabel extends SvelteComponent<CLabelProps, CLabelEvents, CLabelSlots> { | ||
} | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import type { Rule } from './rules'; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Rule } from './rules.js'; | ||
declare class __sveltets_Render<T> { | ||
@@ -11,11 +11,8 @@ props(): { | ||
rules?: Rule[] | undefined; | ||
loading?: boolean | undefined; | ||
filter?: boolean | undefined; | ||
disabled?: boolean | undefined; | ||
loading?: boolean | undefined; | ||
noDataText?: string | undefined; | ||
}; | ||
events(): { | ||
keydown: KeyboardEvent; | ||
change: CustomEvent<any>; | ||
} & { | ||
events(): {} & { | ||
[evt: string]: CustomEvent<any>; | ||
@@ -25,4 +22,4 @@ }; | ||
default: { | ||
slot: string; | ||
toggle: (e: MouseEvent | KeyboardEvent) => void; | ||
open: () => void; | ||
displayText: any; | ||
}; | ||
@@ -38,4 +35,4 @@ item: { | ||
export type CSelectSlots<T> = ReturnType<__sveltets_Render<T>['slots']>; | ||
export default class CSelect<T> extends SvelteComponentTyped<CSelectProps<T>, CSelectEvents<T>, CSelectSlots<T>> { | ||
export default class CSelect<T> extends SvelteComponent<CSelectProps<T>, CSelectEvents<T>, CSelectSlots<T>> { | ||
} | ||
export {}; |
@@ -1,11 +0,1 @@ | ||
export type RuleParams = { | ||
value: string | null | undefined; | ||
checked: boolean; | ||
}; | ||
type AsyncRule = (ruleParams: RuleParams) => Promise<true | string>; | ||
type SyncRule = (ruleParams: RuleParams) => true | string; | ||
type FormAsyncValidator = () => Promise<string | true>; | ||
type FormSyncValidator = () => string | true; | ||
export type FormValidator = FormAsyncValidator | FormSyncValidator; | ||
export type Rule = AsyncRule | SyncRule; | ||
export {}; | ||
export type Rule = (v: any) => true | string; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Domain } from './CGraph.svelte'; | ||
@@ -19,4 +19,4 @@ declare const __propDef: { | ||
export type CAxisXSlots = typeof __propDef.slots; | ||
export default class CAxisX extends SvelteComponentTyped<CAxisXProps, CAxisXEvents, CAxisXSlots> { | ||
export default class CAxisX extends SvelteComponent<CAxisXProps, CAxisXEvents, CAxisXSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Domain } from './CGraph.svelte'; | ||
@@ -19,4 +19,4 @@ declare const __propDef: { | ||
export type CAxisYSlots = typeof __propDef.slots; | ||
export default class CAxisY extends SvelteComponentTyped<CAxisYProps, CAxisYEvents, CAxisYSlots> { | ||
export default class CAxisY extends SvelteComponent<CAxisYProps, CAxisYEvents, CAxisYSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Domain } from './CGraph.svelte'; | ||
@@ -22,4 +22,4 @@ declare const __propDef: { | ||
export type CCircleSlots = typeof __propDef.slots; | ||
export default class CCircle extends SvelteComponentTyped<CCircleProps, CCircleEvents, CCircleSlots> { | ||
export default class CCircle extends SvelteComponent<CCircleProps, CCircleEvents, CCircleSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
export type Base = Writable<Domain>; | ||
@@ -23,6 +23,3 @@ export type Domain = [number, number]; | ||
slots: { | ||
default: { | ||
width: number; | ||
height: number; | ||
}; | ||
default: {}; | ||
}; | ||
@@ -33,4 +30,4 @@ }; | ||
export type CGraphSlots = typeof __propDef.slots; | ||
export default class CGraph extends SvelteComponentTyped<CGraphProps, CGraphEvents, CGraphSlots> { | ||
export default class CGraph extends SvelteComponent<CGraphProps, CGraphEvents, CGraphSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Domain } from './CGraph.svelte'; | ||
@@ -21,4 +21,4 @@ declare const __propDef: { | ||
export type CPathSlots = typeof __propDef.slots; | ||
export default class CPath extends SvelteComponentTyped<CPathProps, CPathEvents, CPathSlots> { | ||
export default class CPath extends SvelteComponent<CPathProps, CPathEvents, CPathSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
import type { Domain } from './CGraph.svelte'; | ||
@@ -25,4 +25,4 @@ declare const __propDef: { | ||
export type CRectSlots = typeof __propDef.slots; | ||
export default class CRect extends SvelteComponentTyped<CRectProps, CRectEvents, CRectSlots> { | ||
export default class CRect extends SvelteComponent<CRectProps, CRectEvents, CRectSlots> { | ||
} | ||
export {}; |
@@ -5,5 +5,4 @@ export { default as CGraph } from './CGraph.svelte'; | ||
export { default as CRect } from './CRect.svelte'; | ||
export { default as CObject } from './CObject.svelte'; | ||
export { default as CAxisX } from './CAxis-x.svelte'; | ||
export { default as CAxisY } from './CAxis-y.svelte'; | ||
export * from './utils'; | ||
export * from './utils.js'; |
@@ -5,5 +5,4 @@ export { default as CGraph } from './CGraph.svelte'; | ||
export { default as CRect } from './CRect.svelte'; | ||
export { default as CObject } from './CObject.svelte'; | ||
export { default as CAxisX } from './CAxis-x.svelte'; | ||
export { default as CAxisY } from './CAxis-y.svelte'; | ||
export * from './utils'; | ||
export * from './utils.js'; |
@@ -11,4 +11,1 @@ export declare function distance(p1: [number, number], p2: [number, number]): number; | ||
export declare function ticks(min: number, max: number, count: number): number[]; | ||
type ThrottledFunction<T extends (...args: any) => any> = (...args: Parameters<T>) => ReturnType<T>; | ||
export declare function throttle<T extends (...args: any) => any>(func: T, limit: number): ThrottledFunction<T>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import d3Ticks from './ticks'; | ||
import d3Ticks from './ticks.js'; | ||
export function distance(p1, p2) { | ||
@@ -69,16 +69,1 @@ return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2)); | ||
} | ||
export function throttle(func, limit) { | ||
let inThrottle; | ||
let lastResult; | ||
return function () { | ||
const args = arguments; | ||
const context = this; | ||
if (!inThrottle) { | ||
inThrottle = true; | ||
setTimeout(() => (inThrottle = false), limit); | ||
// @ts-ignore | ||
lastResult = func.apply(context, args); | ||
} | ||
return lastResult; | ||
}; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -16,4 +16,4 @@ props: { | ||
export type CIconSlots = typeof __propDef.slots; | ||
export default class CIcon extends SvelteComponentTyped<CIconProps, CIconEvents, CIconSlots> { | ||
export default class CIcon extends SvelteComponent<CIconProps, CIconEvents, CIconSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -21,4 +21,4 @@ props: { | ||
export type CImageUploaderSlots = typeof __propDef.slots; | ||
export default class CImageUploader extends SvelteComponentTyped<CImageUploaderProps, CImageUploaderEvents, CImageUploaderSlots> { | ||
export default class CImageUploader extends SvelteComponent<CImageUploaderProps, CImageUploaderEvents, CImageUploaderSlots> { | ||
} | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -13,5 +13,6 @@ props: { | ||
slots: { | ||
action: {}; | ||
action: { | ||
toggle: (e: MouseEvent | KeyboardEvent) => void; | ||
}; | ||
default: { | ||
toggle: (e: MouseEvent | KeyboardEvent) => void; | ||
visible: boolean; | ||
@@ -24,4 +25,4 @@ }; | ||
export type CMenuSlots = typeof __propDef.slots; | ||
export default class CMenu extends SvelteComponentTyped<CMenuProps, CMenuEvents, CMenuSlots> { | ||
export default class CMenu extends SvelteComponent<CMenuProps, CMenuEvents, CMenuSlots> { | ||
} | ||
export {}; |
type CNotifierParams = { | ||
title: string; | ||
text?: string; | ||
html?: string; | ||
timeout?: number; | ||
target?: string; | ||
}; | ||
declare function error(opt: CNotifierParams): void; | ||
declare function info(opt: CNotifierParams): void; | ||
declare function success(opt: CNotifierParams): void; | ||
declare function error({ title, text, timeout, target }: CNotifierParams): void; | ||
declare function info({ title, text, timeout, target }: CNotifierParams): void; | ||
declare function success({ title, text, timeout, target }: CNotifierParams): void; | ||
export declare const CNotifier: { | ||
@@ -12,0 +11,0 @@ error: typeof error; |
@@ -10,4 +10,3 @@ import CNotify from './CNotify.svelte'; | ||
} | ||
const DEFAULT_TIMEOUT = 4000; | ||
function send({ title, text, html, timeout = DEFAULT_TIMEOUT, type, target = '.notifications-holder' }) { | ||
function send({ title = '', text = '', timeout = 0, type = '', target = '.notifications-holder' }) { | ||
const container = document.querySelector(target); | ||
@@ -22,3 +21,2 @@ if (!container) | ||
type, | ||
html, | ||
visible: true | ||
@@ -41,10 +39,11 @@ }, | ||
} | ||
function error(opt) { | ||
send({ ...opt, type: 'error' }); | ||
const DEFAULT_TIMEOUT = 4000; | ||
function error({ title = '', text = '', timeout = DEFAULT_TIMEOUT, target }) { | ||
send({ title, text, timeout, type: 'error', target }); | ||
} | ||
function info(opt) { | ||
send({ ...opt, type: 'brand' }); | ||
function info({ title = '', text = '', timeout = DEFAULT_TIMEOUT, target }) { | ||
send({ title, text, timeout, type: 'brand', target }); | ||
} | ||
function success(opt) { | ||
send({ ...opt, type: 'success' }); | ||
function success({ title = '', text = '', timeout = DEFAULT_TIMEOUT, target }) { | ||
send({ title, text, timeout, type: 'success', target }); | ||
} | ||
@@ -51,0 +50,0 @@ export const CNotifier = { |
@@ -1,2 +0,2 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
@@ -7,3 +7,2 @@ props: { | ||
text?: string | undefined; | ||
html?: string | undefined; | ||
close?: (() => void) | undefined; | ||
@@ -26,5 +25,5 @@ type?: string | undefined; | ||
export type CNotifySlots = typeof __propDef.slots; | ||
export default class CNotify extends SvelteComponentTyped<CNotifyProps, CNotifyEvents, CNotifySlots> { | ||
export default class CNotify extends SvelteComponent<CNotifyProps, CNotifyEvents, CNotifySlots> { | ||
get close(): () => void; | ||
} | ||
export {}; |
@@ -1,10 +0,9 @@ | ||
import { SvelteComponentTyped } from "svelte"; | ||
import { SvelteComponent } from "svelte"; | ||
declare const __propDef: { | ||
props: { | ||
openState?: boolean | undefined; | ||
right?: boolean | undefined; | ||
stayOpenOnDesktop?: boolean | undefined; | ||
active?: boolean | undefined; | ||
}; | ||
events: { | ||
keydown: KeyboardEvent; | ||
} & { | ||
[evt: string]: CustomEvent<any>; | ||
@@ -14,8 +13,4 @@ }; | ||
header: {}; | ||
default: { | ||
close: () => void; | ||
open: () => void; | ||
}; | ||
default: {}; | ||
footer: {}; | ||
action: {}; | ||
}; | ||
@@ -26,4 +21,4 @@ }; | ||
export type CSidebarSlots = typeof __propDef.slots; | ||
export default class CSidebar extends SvelteComponentTyped<CSidebarProps, CSidebarEvents, CSidebarSlots> { | ||
export default class CSidebar extends SvelteComponent<CSidebarProps, CSidebarEvents, CSidebarSlots> { | ||
} | ||
export {}; |
@@ -1,3 +0,1 @@ | ||
export type { ThemeGeneratorConfig } from './scripts/theme'; | ||
export type { Rule } from './CForms/rules'; | ||
export { default as CIcon } from './CIcon/CIcon.svelte'; | ||
@@ -8,9 +6,6 @@ export { default as CMenu } from './CMenu/CMenu.svelte'; | ||
export { default as CNotify } from './CNotify/CNotify.svelte'; | ||
export { CNotifier } from './CNotify/CNotifier'; | ||
export { CNotifier } from './CNotify/CNotifier.js'; | ||
export { default as CForm } from './CForms/CForm.svelte'; | ||
export { default as CInput } from './CForms/CInput.svelte'; | ||
export { default as CTextarea } from './CForms/CTextarea.svelte'; | ||
export { default as CLabel } from './CForms/CLabel.svelte'; | ||
export { default as CSelect } from './CForms/CSelect.svelte'; | ||
export { default as CToggle } from './CForms/CToggle.svelte'; | ||
export { default as CSidebar } from './CSidebar/CSidebar.svelte'; | ||
@@ -20,1 +15,2 @@ export { default as CImageUploader } from './CImageUploader/CImageUploader.svelte'; | ||
export { default as CAvatar } from './CAvatar/CAvatar.svelte'; | ||
export type { Rule } from './CForms/rules.js'; |
@@ -6,9 +6,6 @@ export { default as CIcon } from './CIcon/CIcon.svelte'; | ||
export { default as CNotify } from './CNotify/CNotify.svelte'; | ||
export { CNotifier } from './CNotify/CNotifier'; | ||
export { CNotifier } from './CNotify/CNotifier.js'; | ||
export { default as CForm } from './CForms/CForm.svelte'; | ||
export { default as CInput } from './CForms/CInput.svelte'; | ||
export { default as CTextarea } from './CForms/CTextarea.svelte'; | ||
export { default as CLabel } from './CForms/CLabel.svelte'; | ||
export { default as CSelect } from './CForms/CSelect.svelte'; | ||
export { default as CToggle } from './CForms/CToggle.svelte'; | ||
export { default as CSidebar } from './CSidebar/CSidebar.svelte'; | ||
@@ -15,0 +12,0 @@ export { default as CImageUploader } from './CImageUploader/CImageUploader.svelte'; |
110
package.json
{ | ||
"name": "@chasi/ui", | ||
"version": "0.1.51", | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"svelte": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"svelte": "./dist/index.js" | ||
}, | ||
"./styles/": "./dist/styles/", | ||
"./actions": "./dist/Actions/index.js", | ||
"./CGraph": "./dist/CGraph/index.js" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"actions": [ | ||
"./dist/Actions/index.d.ts" | ||
], | ||
"CGraph": [ | ||
"./dist/CGraph/index.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"theme": "node package/scripts/theme.js", | ||
"package": "svelte-package", | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-check --tsconfig ./tsconfig.json", | ||
"release": "npm run check && npm version patch && npm run package && npm publish --access public" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/package": "^2.0.2", | ||
"@sveltejs/vite-plugin-svelte": "^2.2.0", | ||
"@tsconfig/svelte": "^4.0.1", | ||
"@types/node": "^20.1.0", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-svelte": "^2.10.0", | ||
"sass": "^1.62.1", | ||
"svelte": "^3.59.0", | ||
"svelte-check": "^3.3.1", | ||
"tslib": "^2.5.0", | ||
"typescript": "^5.0.4", | ||
"vite": "^4.3.5" | ||
}, | ||
"peerDependencies": { | ||
"svelte": "^3.55.1" | ||
}, | ||
"dependencies": { | ||
"@mdi/js": "^7.2.96", | ||
"esm-env": "^1.0.0" | ||
} | ||
"name": "@chasi/ui", | ||
"version": "0.2.1", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build && npm run package", | ||
"preview": "vite preview", | ||
"package": "svelte-kit sync && svelte-package && publint", | ||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", | ||
"test": "vitest", | ||
"release": "npm run check && npm version patch && npm run package && npm publish --access public" | ||
}, | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"svelte": "./dist/index.js" | ||
}, | ||
"./styles/*": "./dist/styles/*", | ||
"./actions": "./dist/Actions/index.js", | ||
"./CGraph": "./dist/CGraph/index.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
"!dist/**/*.test.*", | ||
"!dist/**/*.spec.*" | ||
], | ||
"peerDependencies": { | ||
"svelte": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-auto": "^2.1.0", | ||
"@sveltejs/kit": "^1.22.3", | ||
"@sveltejs/package": "^2.2.0", | ||
"@types/chroma-js": "^2.4.0", | ||
"prettier": "^3.0.0", | ||
"prettier-plugin-svelte": "^3.0.0", | ||
"publint": "^0.1.16", | ||
"svelte": "^4.1.0", | ||
"svelte-check": "^3.4.6", | ||
"tslib": "^2.6.0", | ||
"typescript": "^5.1.6", | ||
"vite": "^4.4.4", | ||
"vitest": "^0.33.0" | ||
}, | ||
"svelte": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"type": "module", | ||
"dependencies": { | ||
"@mdi/js": "^7.2.96", | ||
"esm-env": "^1.0.0", | ||
"sass": "^1.64.0" | ||
} | ||
} |
@@ -1,1 +0,58 @@ | ||
# Chasi-ui | ||
# create-svelte | ||
Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging). | ||
## Creating a project | ||
If you're seeing this, you've probably already done this step. Congrats! | ||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
## Developing | ||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
```bash | ||
npm run dev | ||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app. | ||
## Building | ||
To build your library: | ||
```bash | ||
npm run package | ||
``` | ||
To create a production version of your showcase app: | ||
```bash | ||
npm run build | ||
``` | ||
You can preview the production build with `npm run preview`. | ||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||
## Publishing | ||
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)). | ||
To publish your library to [npm](https://www.npmjs.com): | ||
```bash | ||
npm publish | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
59
108832
4
13
74
1164
+ Addedsass@^1.64.0
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@parcel/watcher@2.5.0(transitive)
+ Added@parcel/watcher-android-arm64@2.5.0(transitive)
+ Added@parcel/watcher-darwin-arm64@2.5.0(transitive)
+ Added@parcel/watcher-darwin-x64@2.5.0(transitive)
+ Added@parcel/watcher-freebsd-x64@2.5.0(transitive)
+ Added@parcel/watcher-linux-arm-glibc@2.5.0(transitive)
+ Added@parcel/watcher-linux-arm-musl@2.5.0(transitive)
+ Added@parcel/watcher-linux-arm64-glibc@2.5.0(transitive)
+ Added@parcel/watcher-linux-arm64-musl@2.5.0(transitive)
+ Added@parcel/watcher-linux-x64-glibc@2.5.0(transitive)
+ Added@parcel/watcher-linux-x64-musl@2.5.0(transitive)
+ Added@parcel/watcher-win32-arm64@2.5.0(transitive)
+ Added@parcel/watcher-win32-ia32@2.5.0(transitive)
+ Added@parcel/watcher-win32-x64@2.5.0(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedaria-query@5.3.2(transitive)
+ Addedaxobject-query@4.1.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedchokidar@4.0.1(transitive)
+ Addedcode-red@1.0.4(transitive)
+ Addedcss-tree@2.3.1(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addedestree-walker@3.0.3(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedimmutable@5.0.2(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-reference@3.0.3(transitive)
+ Addedlocate-character@3.0.0(transitive)
+ Addedmagic-string@0.30.12(transitive)
+ Addedmdn-data@2.0.30(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addednode-addon-api@7.1.1(transitive)
+ Addedperiscopic@3.1.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedreaddirp@4.0.2(transitive)
+ Addedsass@1.81.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedsvelte@4.2.19(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedsvelte@3.59.2(transitive)