tyrell-components 1.0.0-RC19 → 1.0.0-RC20
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/README.md +1 -0
- package/dist/tyrell.js +1 -1
- package/lib/components/sortable.d.ts +175 -0
- package/lib/components/sortable.js +1838 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/styles/sortable.d.ts +16 -0
- package/lib/styles/sortable.js +85 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -1
package/lib/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { TyCalendar } from './components/calendar.js';
|
|
|
25
25
|
export { TyDatePicker } from './components/date-picker.js';
|
|
26
26
|
export { TyResizeObserver } from './components/resize-observer.js';
|
|
27
27
|
export { TyScrollContainer } from './components/scroll-container.js';
|
|
28
|
+
export { TySortable } from './components/sortable.js';
|
|
28
29
|
export { CustomScrollbar, isCustomScrollbarEnabled } from './utils/custom-scrollbar.js';
|
|
29
30
|
export type { CustomScrollbarOptions } from './utils/custom-scrollbar.js';
|
|
30
31
|
export type { Flavor, Size, InputType, IconSize, IconTempo, TyButtonElement, TyIconElement, TyTagElement, TyTagEventDetail, TyOptionElement, TyInputElement } from './types/common.js';
|
|
@@ -38,6 +39,7 @@ export type { TooltipFlavor, TooltipAttributes } from './components/tooltip.js';
|
|
|
38
39
|
export type { PopupAttributes } from './components/popup.js';
|
|
39
40
|
export type { ModalAttributes, ModalCloseDetail } from './components/modal.js';
|
|
40
41
|
export type { TabsAttributes, TabChangeDetail } from './components/tabs.js';
|
|
42
|
+
export type { TySortablePos, TySortableValue, TySortableChangeDetail, TySortableCancelReason, TySortableOutcome, TySortableDropContext, TySortableStrings } from './components/sortable.js';
|
|
41
43
|
export type { TabAttributes, TabLoadDetail } from './components/tab.js';
|
|
42
44
|
export type { WizardAttributes, WizardStepChangeDetail } from './components/wizard.js';
|
|
43
45
|
export type { StepAttributes, StepStatus } from './components/step.js';
|
package/lib/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { TyCalendar } from './components/calendar.js';
|
|
|
25
25
|
export { TyDatePicker } from './components/date-picker.js';
|
|
26
26
|
export { TyResizeObserver } from './components/resize-observer.js';
|
|
27
27
|
export { TyScrollContainer } from './components/scroll-container.js';
|
|
28
|
+
export { TySortable } from './components/sortable.js';
|
|
28
29
|
export { CustomScrollbar, isCustomScrollbarEnabled } from './utils/custom-scrollbar.js';
|
|
29
30
|
export { getSize, onResize, getAllSizes } from './utils/resize-observer.js';
|
|
30
31
|
export { setLoaderSvg, getLoaderSvg, resetLoaderSvg } from './utils/loader-registry.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sortable Styles — ty-sortable host (shadow) and the light-DOM rules its
|
|
3
|
+
* items need before a gesture starts (touch-action is read at pointerdown).
|
|
4
|
+
*/
|
|
5
|
+
export declare const sortableStyles = "\n:host {\n display: block;\n position: relative;\n box-sizing: border-box;\n --ty-sortable-indicator-color: var(--ty-color-primary, #3b82f6);\n --ty-sortable-blocked-color: var(--ty-color-danger, #ef4444);\n --ty-sortable-indicator-size: 2px;\n --ty-sortable-source-opacity: 0.4;\n --ty-sortable-source-outline: none;\n --ty-sortable-ghost-scale: 1.02;\n --ty-sortable-ghost-rotate: 0deg;\n --ty-sortable-ghost-shadow: var(--ty-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));\n --ty-sortable-duration: 200ms;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n@media (any-pointer: coarse) {\n :host {\n --ty-sortable-indicator-size: 3px;\n }\n}\n\n/* An empty list being dragged over has no gap to draw a line in. */\n:host(:state(over):state(empty)) {\n outline: 2px dashed var(--ty-sortable-indicator-color);\n outline-offset: -2px;\n}\n\n:host(:state(blocked)) {\n outline: 2px dashed var(--ty-sortable-blocked-color);\n outline-offset: -2px;\n cursor: not-allowed;\n}\n\n.live {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n";
|
|
6
|
+
/**
|
|
7
|
+
* Adopted into every root (document or shadow root) that contains a
|
|
8
|
+
* ty-sortable. touch-action must be on the element before the finger lands:
|
|
9
|
+
* the browser decides whether a gesture pans at pointerdown.
|
|
10
|
+
*/
|
|
11
|
+
export declare const sortableLightStyles = "\nty-sortable [data-handle] {\n touch-action: none;\n cursor: grab;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n user-select: none;\n}\nty-sortable img,\nty-sortable a {\n -webkit-user-drag: none;\n}\n@media (any-pointer: coarse) {\n ty-sortable:not(:state(handles)) > * {\n touch-action: manipulation;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n user-select: none;\n }\n}\nty-sortable input,\nty-sortable textarea,\nty-sortable [contenteditable] {\n -webkit-user-select: text;\n user-select: text;\n}\n/* The dragged copy. Its list's --ty-sortable-* properties are carried over\n to the layer it lives in. Page CSS can restyle it, e.g. with a surface:\n [data-ty-sortable-ghost] { background: var(--ty-surface-floating); } */\n[data-ty-sortable-ghost] {\n box-shadow: var(--ty-sortable-ghost-shadow, 0 10px 20px rgba(0, 0, 0, 0.15));\n opacity: 0.95;\n}\n";
|
|
12
|
+
/**
|
|
13
|
+
* Adopted into the document on the first drag. While a mouse drags: the
|
|
14
|
+
* grabbing hand everywhere, not-allowed over a list that refuses the item.
|
|
15
|
+
*/
|
|
16
|
+
export declare const sortableCursorStyles = "\nbody:has(> [data-ty-sortable-layer][data-cursor=\"grabbing\"]),\nbody:has(> [data-ty-sortable-layer][data-cursor=\"grabbing\"]) * {\n cursor: grabbing !important;\n}\nbody:has(> [data-ty-sortable-layer][data-cursor=\"blocked\"]),\nbody:has(> [data-ty-sortable-layer][data-cursor=\"blocked\"]) * {\n cursor: not-allowed !important;\n}\n";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export const sortableStyles = `
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
position: relative;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
--ty-sortable-indicator-color: var(--ty-color-primary, #3b82f6);
|
|
7
|
+
--ty-sortable-blocked-color: var(--ty-color-danger, #ef4444);
|
|
8
|
+
--ty-sortable-indicator-size: 2px;
|
|
9
|
+
--ty-sortable-source-opacity: 0.4;
|
|
10
|
+
--ty-sortable-source-outline: none;
|
|
11
|
+
--ty-sortable-ghost-scale: 1.02;
|
|
12
|
+
--ty-sortable-ghost-rotate: 0deg;
|
|
13
|
+
--ty-sortable-ghost-shadow: var(--ty-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1));
|
|
14
|
+
--ty-sortable-duration: 200ms;
|
|
15
|
+
}
|
|
16
|
+
:host([hidden]) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
@media (any-pointer: coarse) {
|
|
20
|
+
:host {
|
|
21
|
+
--ty-sortable-indicator-size: 3px;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
:host(:state(over):state(empty)) {
|
|
25
|
+
outline: 2px dashed var(--ty-sortable-indicator-color);
|
|
26
|
+
outline-offset: -2px;
|
|
27
|
+
}
|
|
28
|
+
:host(:state(blocked)) {
|
|
29
|
+
outline: 2px dashed var(--ty-sortable-blocked-color);
|
|
30
|
+
outline-offset: -2px;
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
}
|
|
33
|
+
.live {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: 1px;
|
|
36
|
+
height: 1px;
|
|
37
|
+
margin: -1px;
|
|
38
|
+
padding: 0;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
clip: rect(0 0 0 0);
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
border: 0;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
export const sortableLightStyles = `
|
|
46
|
+
ty-sortable [data-handle] {
|
|
47
|
+
touch-action: none;
|
|
48
|
+
cursor: grab;
|
|
49
|
+
-webkit-touch-callout: none;
|
|
50
|
+
-webkit-user-select: none;
|
|
51
|
+
user-select: none;
|
|
52
|
+
}
|
|
53
|
+
ty-sortable img,
|
|
54
|
+
ty-sortable a {
|
|
55
|
+
-webkit-user-drag: none;
|
|
56
|
+
}
|
|
57
|
+
@media (any-pointer: coarse) {
|
|
58
|
+
ty-sortable:not(:state(handles)) > * {
|
|
59
|
+
touch-action: manipulation;
|
|
60
|
+
-webkit-touch-callout: none;
|
|
61
|
+
-webkit-user-select: none;
|
|
62
|
+
user-select: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
ty-sortable input,
|
|
66
|
+
ty-sortable textarea,
|
|
67
|
+
ty-sortable [contenteditable] {
|
|
68
|
+
-webkit-user-select: text;
|
|
69
|
+
user-select: text;
|
|
70
|
+
}
|
|
71
|
+
[data-ty-sortable-ghost] {
|
|
72
|
+
box-shadow: var(--ty-sortable-ghost-shadow, 0 10px 20px rgba(0, 0, 0, 0.15));
|
|
73
|
+
opacity: 0.95;
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
export const sortableCursorStyles = `
|
|
77
|
+
body:has(> [data-ty-sortable-layer][data-cursor="grabbing"]),
|
|
78
|
+
body:has(> [data-ty-sortable-layer][data-cursor="grabbing"]) * {
|
|
79
|
+
cursor: grabbing !important;
|
|
80
|
+
}
|
|
81
|
+
body:has(> [data-ty-sortable-layer][data-cursor="blocked"]),
|
|
82
|
+
body:has(> [data-ty-sortable-layer][data-cursor="blocked"]) * {
|
|
83
|
+
cursor: not-allowed !important;
|
|
84
|
+
}
|
|
85
|
+
`;
|
package/lib/version.d.ts
CHANGED
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.0.0-
|
|
1
|
+
export const VERSION = '1.0.0-RC20';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tyrell-components",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-RC20",
|
|
4
4
|
"description": "Tyrell Components - Framework-agnostic web components with semantic design system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -72,6 +72,10 @@
|
|
|
72
72
|
"types": "./lib/components/tab.d.ts",
|
|
73
73
|
"import": "./lib/components/tab.js"
|
|
74
74
|
},
|
|
75
|
+
"./sortable": {
|
|
76
|
+
"types": "./lib/components/sortable.d.ts",
|
|
77
|
+
"import": "./lib/components/sortable.js"
|
|
78
|
+
},
|
|
75
79
|
"./calendar": {
|
|
76
80
|
"types": "./lib/components/calendar.d.ts",
|
|
77
81
|
"import": "./lib/components/calendar.js"
|