ziko 0.0.24 → 0.0.26

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.
Files changed (80) hide show
  1. package/README.md +1 -1
  2. package/dist/ziko.cjs +50 -8
  3. package/dist/ziko.js +53 -11
  4. package/dist/ziko.min.js +2 -2
  5. package/dist/ziko.mjs +53 -11
  6. package/package.json +1 -1
  7. package/src/data/parser/index.js +1 -1
  8. package/src/reactivity/events/click.js +43 -1
  9. package/src/ui/elements/ZikoUIElement.js +6 -6
  10. package/src/ui/elements/text/__ZikoUIText__.js +3 -3
  11. package/src/graphics/canvas/elements ( To Be Moved )/Basic/arc.js +0 -43
  12. package/src/graphics/canvas/elements ( To Be Moved )/Basic/image.js +0 -0
  13. package/src/graphics/canvas/elements ( To Be Moved )/Basic/line.js +0 -26
  14. package/src/graphics/canvas/elements ( To Be Moved )/Basic/path.js +0 -0
  15. package/src/graphics/canvas/elements ( To Be Moved )/Basic/points.js +0 -48
  16. package/src/graphics/canvas/elements ( To Be Moved )/Basic/polygon.js +0 -7
  17. package/src/graphics/canvas/elements ( To Be Moved )/Basic/polyline.js +0 -0
  18. package/src/graphics/canvas/elements ( To Be Moved )/Basic/rect.js +0 -46
  19. package/src/graphics/canvas/elements ( To Be Moved )/Basic/text.js +0 -0
  20. package/src/graphics/canvas/elements ( To Be Moved )/Chart/histogram.js +0 -0
  21. package/src/graphics/canvas/elements ( To Be Moved )/Chart/plot.js +0 -0
  22. package/src/graphics/canvas/elements ( To Be Moved )/Chart/scatter.js +0 -2
  23. package/src/graphics/canvas/elements ( To Be Moved )/Chart/stem.js +0 -0
  24. package/src/graphics/canvas/elements ( To Be Moved )/Element.js +0 -115
  25. package/src/graphics/canvas/elements ( To Be Moved )/index.js +0 -13
  26. package/src/graphics/svg/Elements ( To Be Moved )/Basic/circle.js +0 -29
  27. package/src/graphics/svg/Elements ( To Be Moved )/Basic/ellipse.js +0 -24
  28. package/src/graphics/svg/Elements ( To Be Moved )/Basic/foreign-object.js +0 -36
  29. package/src/graphics/svg/Elements ( To Be Moved )/Basic/groupe.js +0 -32
  30. package/src/graphics/svg/Elements ( To Be Moved )/Basic/image.js +0 -36
  31. package/src/graphics/svg/Elements ( To Be Moved )/Basic/index.js +0 -11
  32. package/src/graphics/svg/Elements ( To Be Moved )/Basic/line.js +0 -32
  33. package/src/graphics/svg/Elements ( To Be Moved )/Basic/link.js +0 -33
  34. package/src/graphics/svg/Elements ( To Be Moved )/Basic/path.js +0 -62
  35. package/src/graphics/svg/Elements ( To Be Moved )/Basic/polygon.js +0 -32
  36. package/src/graphics/svg/Elements ( To Be Moved )/Basic/polyline.js +0 -7
  37. package/src/graphics/svg/Elements ( To Be Moved )/Basic/rect.js +0 -46
  38. package/src/graphics/svg/Elements ( To Be Moved )/Basic/text.js +0 -29
  39. package/src/graphics/svg/Elements ( To Be Moved )/Derived/grid.js +0 -9
  40. package/src/graphics/svg/Elements ( To Be Moved )/Derived/index.js +0 -1
  41. package/src/graphics/svg/Elements ( To Be Moved )/index.js +0 -2
  42. package/src/graphics/svg/Elements ( To Be Moved )/ziko-svg-element.js +0 -48
  43. package/src/ui/elements/derived ( To Be Moved)/accordion/accordion.js +0 -42
  44. package/src/ui/elements/derived ( To Be Moved)/accordion/collapsible.js +0 -82
  45. package/src/ui/elements/derived ( To Be Moved)/accordion/index.js +0 -2
  46. package/src/ui/elements/derived ( To Be Moved)/alert/alert.js +0 -80
  47. package/src/ui/elements/derived ( To Be Moved)/alert/index.js +0 -1
  48. package/src/ui/elements/derived ( To Be Moved)/alert/palette.js +0 -52
  49. package/src/ui/elements/derived ( To Be Moved)/carousel/index.js +0 -51
  50. package/src/ui/elements/derived ( To Be Moved)/code-note/SubElements.js.txt +0 -105
  51. package/src/ui/elements/derived ( To Be Moved)/code-note/code-cell.js +0 -195
  52. package/src/ui/elements/derived ( To Be Moved)/code-note/code-note.js +0 -72
  53. package/src/ui/elements/derived ( To Be Moved)/code-note/index.js +0 -2
  54. package/src/ui/elements/derived ( To Be Moved)/code-note/sub-elements.js +0 -67
  55. package/src/ui/elements/derived ( To Be Moved)/index.js +0 -12
  56. package/src/ui/elements/derived ( To Be Moved)/menu/index.js +0 -1
  57. package/src/ui/elements/derived ( To Be Moved)/menu/menu3d.js +0 -260
  58. package/src/ui/elements/derived ( To Be Moved)/modal/index.js +0 -92
  59. package/src/ui/elements/derived ( To Be Moved)/pagination/breadcrumbs.js +0 -54
  60. package/src/ui/elements/derived ( To Be Moved)/pagination/index.js +0 -1
  61. package/src/ui/elements/derived ( To Be Moved)/slider/__ZikoUISlider__.js +0 -112
  62. package/src/ui/elements/derived ( To Be Moved)/slider/hSlider.js +0 -34
  63. package/src/ui/elements/derived ( To Be Moved)/slider/index.js +0 -12
  64. package/src/ui/elements/derived ( To Be Moved)/slider/vSlider.js +0 -27
  65. package/src/ui/elements/derived ( To Be Moved)/splitter/__ZikoUISplitter__.js +0 -62
  66. package/src/ui/elements/derived ( To Be Moved)/splitter/hsplitter.js +0 -40
  67. package/src/ui/elements/derived ( To Be Moved)/splitter/index.js +0 -12
  68. package/src/ui/elements/derived ( To Be Moved)/splitter/vsplitter.js +0 -40
  69. package/src/ui/elements/derived ( To Be Moved)/tabs/index.js +0 -180
  70. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/dark.js +0 -0
  71. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/index.js +0 -0
  72. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/_themes/light.js +0 -0
  73. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/app/index.js +0 -0
  74. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/component/index.js +0 -0
  75. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/globals/index.js +0 -0
  76. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/index.js +0 -0
  77. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/params/index.js +0 -0
  78. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/router/index.js +0 -0
  79. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/seo/index.js +0 -0
  80. /package/src/{_global (To Be Replaced ) → _global (To Be Removed )}/style/index.js +0 -0
@@ -1,260 +0,0 @@
1
- import ZikoUIElement from "../../primitives/ZikoUIElement.js";
2
- import { ZikoUIFlex } from "../flex"
3
- class ZikoUIMenu3d extends ZikoUIFlex{
4
- constructor(controller, content){
5
- super("div", "menu3d")
6
- this.controller = controller;
7
- this.content = content;
8
- this.cover = null;
9
- Object.assign(this.cache,{
10
- config:{
11
- useTransfo : false,
12
- isOpen : false,
13
- position : "left",
14
- threshold : 40,
15
- angle : 70,
16
- overlap : 6,
17
- width : 300,
18
- height : 300,
19
- transitionDuration: '0.5s',
20
- transitionEasing: 'ease',
21
- menuTransformOrigin : null,
22
- menuTransformClosed : null,
23
- menuTransformOpened : null,
24
- contentTransformOrigin : null,
25
- contentTransformClosed : null,
26
- contentTransformOpened : null,
27
- }
28
- })
29
- this.append(
30
- this.controller,
31
- this.content
32
- )
33
- this.update();
34
- }
35
- get isOpen(){
36
- return this.cache.config.isOpen;
37
- }
38
- update(){
39
- this.controller.style({
40
- display:"none",
41
- padding:"20px",
42
- overflow:"auto",
43
- background:"darkblue",
44
- color: "#eee",
45
- webkitboxSizing: "border-box",
46
- mozBoxSizing: "border-box",
47
- boxSizing:"border-box",
48
- });
49
- this.content.style({
50
- padding:"20px 40px",
51
- width: "100%",
52
- height: "100%",
53
- // overflowY:"auto",
54
- background:"gold",
55
- color: "#eee",
56
- webkitboxSizing: "border-box",
57
- mozBoxSizing: "border-box",
58
- boxSizing:"border-box",
59
- webkitOverflowScrolling:"touch",
60
- webkitTransformStyle: "preserve-3d"
61
- });
62
- this.setupPositions();
63
- this.setupWrapper();
64
- this.setupCover()
65
- this.setupMenu();
66
- this.setupContent()
67
- }
68
- setupPositions() {
69
- this.cache.config.menuTransformOpened = '';
70
- this.cache.config.contentTransformClosed = '';
71
- let menuAngle = this.cache.config.angle;
72
- let contentAngle = this.cache.config.angle / -2;
73
- switch( this.cache.config.position ) {
74
- case "top":
75
- this.cache.config.menuTransformOrigin = '50% 0%';
76
- this.cache.config.menuTransformClosed = `rotateX(${menuAngle}deg) translateY(-100%) translateY(${this.cache.config.overlap}px)`
77
- this.cache.config.contentTransformOrigin = '50% 0';
78
- this.cache.config.contentTransformOpened = `translateY(${this.height/2}px) rotateX(${contentAngle}deg)`
79
- break;
80
- case "right":
81
- this.cache.config.menuTransformOrigin = '100% 50%';
82
- this.cache.config.menuTransformClosed = 'rotateY( ' + menuAngle + 'deg ) translateX( 100% ) translateX( -2px ) scale( 1.01 )';
83
- this.cache.config.contentTransformOrigin = '100% 50%';
84
- this.cache.config.contentTransformOpened = 'translateX( -'+ this.width/2 +'px ) rotateY( ' + contentAngle + 'deg )';
85
- break;
86
- case "bottom":
87
- this.cache.config.menuTransformOrigin = '50% 100%';
88
- this.cache.config.menuTransformClosed = 'rotateX( ' + -menuAngle + 'deg ) translateY( 100% ) translateY( -'+ this.cache.config.overlap +'px )';
89
- this.cache.config.contentTransformOrigin = '50% 100%';
90
- this.cache.config.contentTransformOpened = 'translateY( -'+ this.height/2 +'px ) rotateX( ' + -contentAngle + 'deg )';
91
- break;
92
- default:
93
- this.cache.config.menuTransformOrigin = '100% 50%';
94
- this.cache.config.menuTransformClosed = 'translateX( -100% ) translateX( '+ this.cache.config.overlap +'px ) scale( 1.01 ) rotateY( ' + -menuAngle + 'deg )';
95
- this.cache.config.contentTransformOrigin = '0 50%';
96
- this.cache.config.contentTransformOpened = 'translateX( '+ this.width/2 +'px ) rotateY( ' + -contentAngle + 'deg )';
97
- break;
98
- }
99
- }
100
- setupWrapper() {
101
- this.style({
102
- perspective : "800px",
103
- perspectiveOrigin : this.cache.config.contentTransformOrigin
104
- })
105
- }
106
- setupCover(){
107
- if( this.cover ) this.cover.element.parentNode.removeChild( this.cover.element );
108
- this.cover=new ZikoUIElement("div","div").style({
109
- position:"absolute",
110
- display:"block",
111
- width:"100%",
112
- height:"100%",
113
- left:0,
114
- top:0,
115
- zIndex:1000,
116
- visibility:"hidden",
117
- opacity:0,
118
- transition: `all ${this.cache.config.transitionDuration} ${this.cache.config.transitionEasing}`
119
- })
120
- this.content.element.appendChild( this.cover.element );
121
- }
122
- setupMenu() {
123
- // var style = dom.menu.style;
124
- switch( this.cache.config.position ) {
125
- case "top":
126
- this.controller.style({
127
- width : "100%",
128
- height : `${this.height/2}px`
129
- });break;
130
- case "right":
131
- this.controller.style({
132
- right : 0,
133
- width : `${this.width/2}px`,
134
- height : "100%"
135
- });break;
136
- case "bottom":
137
- this.controller.style({
138
- bottom : "0",
139
- width : "100%",
140
- height : `${this.height/2}px`
141
- });break;
142
- case "left":
143
- this.controller.style({
144
- width : `${this.width/2}px`,
145
- height : "100%"
146
- });break;
147
- }
148
- this.controller.style({
149
- position : "fixed",
150
- display : "block",
151
- zIndex : 1,
152
- transform : this.cache.config.menuTransformClosed,
153
- transformOrigin : this.cache.config.menuTransformOrigin,
154
- transition : 'all ' + this.cache.config.transitionDuration +' '+ this.cache.config.transitionEasing
155
- })
156
- }
157
- setupContent() {
158
- this.content.style({
159
- transform : this.cache.config.contentTransformClosed,
160
- transformOrigin : this.cache.config.contentTransformOrigin,
161
- transition : `all ${this.cache.config.transitionDuration} ${this.cache.config.transitionEasing}`
162
- })
163
- }
164
- open(){
165
- if(!this.cache.config.isOpen){
166
- this.cache.config.isOpen = true;
167
- this.cover.style({
168
- height : this.content.element.scrollHeight + "px",
169
- visibility : "visible",
170
- opacity : 1,
171
- })
172
- if(this.cache.config.useTransfo)this.content.style({
173
- transform : this.cache.config.contentTransformOpened,
174
- userSelect : "default"
175
- })
176
- this.controller.style({
177
- transform : this.cache.config.menuTransformOpened,
178
- useSelect : "none"
179
- });
180
- this.emit("opened");
181
- }
182
- }
183
- close() {
184
- if( this.cache.config.isOpen ) {
185
- this.cache.config.isOpen = false;
186
- this.cover.style({
187
- // height : this.content.element.scrollHeight + "px",
188
- visibility : "hidden",
189
- opacity : 0,
190
- })
191
- this.content.style({
192
- transform : this.cache.config.contentTransformClosed,
193
- useSelect : "default"
194
- })
195
- this.controller.style({
196
- transform : this.cache.config.menuTransformClosed,
197
- userSelect : "none"
198
- })
199
- }
200
- this.emit("closed");
201
- }
202
- onOpen(callback){
203
- this.on("opened", callback.bind(this));
204
- return this;
205
- }
206
- onClose(callback){
207
- this.on("closed", callback.bind(this));
208
- return this;
209
- }
210
- #usePosition(position){
211
- if(this.cache.config.position!==position){
212
- this.cache.config.position=position;
213
- const isOpen = this.isOpen;
214
- this.close();
215
- this.update();
216
- if(isOpen)this.open();
217
- }
218
- }
219
- useRight(){
220
- this.#usePosition("left");
221
- return this;
222
- }
223
- useRight(){
224
- this.#usePosition("right");
225
- return this;
226
- }
227
- useTop(){
228
- this.#usePosition("top");
229
- return this;
230
- }
231
- useBottom(){
232
- this.#usePosition("bottom");
233
- return this;
234
- }
235
- }
236
- const menu3d = (controller, content) => new ZikoUIMenu3d(controller, content);
237
- globalThis.menu3d = menu3d;
238
- export{
239
- menu3d,
240
- ZikoUIMenu3d
241
- }
242
-
243
-
244
- /*
245
-
246
- a = menu3d(Flex(text("Menu")), Flex(text("Content")))
247
- .size("80vw", "50vh")
248
- .style({ userSelect: "none" });
249
- a.onOpen((e) => console.log(e));
250
- a.open();
251
- a.controller.onSwipe(0.05, 1, (e) => {
252
- if (e.event.detail.direction.x === "left") a.close();
253
- });
254
- a.content.onSwipe(0.1, 1, (e) => {
255
- if (e.event.detail.direction.x === "left") a.close();
256
- if (e.event.detail.direction.x === "right") a.open();
257
- });
258
-
259
-
260
- */
@@ -1,92 +0,0 @@
1
- import ZikoUIContainerElement from "../../primitives/ZikoUIContainerElement.js";
2
- class ZikoUIModal extends ZikoUIContainerElement{
3
- constructor(...UIElements){
4
- super("dialog", "modal")
5
- this.append(...UIElements);
6
- Object.assign(this.cache,{
7
- config:{
8
- mode:"modal",
9
- useTransition:true
10
- }
11
- });
12
- this.style({
13
- display:"flex",
14
- justifyContent:"center",
15
- alignItems:"center",
16
- position: "absolute",
17
- top: "50%",
18
- left: "50%",
19
- transform: "translate(-50%, -50%)",
20
- padding: "20px",
21
- border: "none",
22
- backgroundCcolor: "#f5f5f5",
23
- boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)",
24
- borderRadius: "8px"
25
- });
26
- this.close()
27
- }
28
- open(){
29
- if(!this.element.open){
30
- switch(this.cache.config.mode){
31
- case "modal": this.element.showModal(); break;
32
- case "dialog": this.element.show(); break;
33
- default : this.element.show(); break;
34
- }
35
- // this.style({
36
- // display : "flex",
37
- // })
38
- this.st.fadeIn(1000)
39
- this.emit("modal:opened");
40
- }
41
- return this;
42
- }
43
- close(){
44
- // this.style({
45
- // display : "none"
46
- // })
47
- this.st.fadeOut(1000)
48
- if(this.element.open){
49
- this.element.close();
50
- }
51
- this.emit("modal:closed");
52
- return this;
53
- }
54
- closeAfter(t = 1000){
55
- globalThis?.setTimeout(()=>this.close(), t);
56
- return this;
57
- }
58
- onOpen(callback){
59
- this.on("modal:opened",callback.bind(this));
60
- return this;
61
- }
62
- onClose(callback){
63
- this.on("modal:closed",callback.bind(this));
64
- return this;
65
- }
66
- useModal(){
67
- this.cache.config.mode = "modal";
68
- return this;
69
- }
70
- useDialog(){
71
- this.cache.config.mode = "dialog";
72
- return this;
73
- }
74
- useTransition(enabled = true){
75
- this.cache.config.useTransition = enabled;
76
- return this;
77
- }
78
- }
79
-
80
- const Modal=(...UIElements)=>new ZikoUIModal(...UIElements);
81
- export{
82
- Modal,
83
- ZikoUIModal
84
- }
85
-
86
- /*
87
- a=Modal(text("Hello")).style({
88
- width:"100%",
89
- height:"100%"
90
- })
91
- Flex(a).size("400px","400px").style({border:"1px red solid"})
92
- */
@@ -1,54 +0,0 @@
1
- import ZikoUIElement from "../../primitives/ZikoUIElement.js";
2
- import { html } from "../../primitives/misc/index.js";
3
- import { text } from "../../primitives/text/index.js";
4
- class ZikoUIBreadcrumbs extends ZikoUIElement{
5
- constructor(...items){
6
- super("ul", "Breadcrumbs")
7
- Object.assign(this.cache,{
8
- separatorTextContent:"/"
9
- })
10
- this.style({
11
- listStyle: "none",
12
- display: "flex",
13
- flexWrap: "wrap"
14
- })
15
- this.list=html('li').style({
16
- display: "flex",
17
- flexWrap: "wrap"
18
- });
19
- this.append(...items);
20
- }
21
- #addItem(item){
22
- if(["string","number","boolean"].includes(typeof item))item = text(item);
23
- const li = html("li", item).style({
24
- display: "flex",
25
- alignItems: "center"
26
- });
27
- if(this.element.children.length>0){
28
- const separator = text(this.cache.separatorTextContent).style({
29
- padding: "0 4px"
30
- });
31
- this.element?.append(separator.element);
32
- }
33
- this.element?.append(li.element);
34
- }
35
- append(...items){
36
- items.forEach(n=>this.#addItem(n));
37
- return this;
38
- }
39
- configSeparator(separatorTextContent = this.cache.separator, style = {}){
40
- this.cache.separatorTextContent = separatorTextContent;
41
- const separators = [...this.element.children].filter(n=>n.tagName==="SPAN");
42
- separators.forEach(node=>{
43
- node.textContent = separatorTextContent;
44
- Object.assign(node.style, style);
45
- }
46
- );
47
- return this;
48
- }
49
- }
50
- const Breadcrumbs=(...items)=>new ZikoUIBreadcrumbs(...items);
51
- export{
52
- Breadcrumbs,
53
- ZikoUIBreadcrumbs
54
- }
@@ -1 +0,0 @@
1
- export * from "./breadcrumbs"
@@ -1,112 +0,0 @@
1
- import ZikoUIContainerElement from "../../primitives/ZikoUIContainerElement";
2
- import { Section } from "../../primitives/semantic";
3
- import { text } from "../../primitives/text";
4
- import { ZikoUIFlex,Flex } from "../Flex";
5
- import { ZikoUISection } from "../../primitives/semantic";
6
- class __ZikoUISlider__ extends ZikoUISection{
7
- constructor(){
8
- super("section","");
9
- Object.assign(this.cache,{
10
- currentIndex : 0,
11
- slideBuilder : null,
12
- })
13
- this.container = Flex().size("100%","100%").vertical(0,0).style({
14
- // width:"100%",
15
- overflow:"hidden"
16
- });
17
- // this.style({
18
- // // width:"100%",
19
- // overflow:"hidden"
20
- // });
21
- this.container.setAttr({
22
- ariaRoledescription : "carousel",
23
- ariaLive: "polite",
24
- ariaLabel : "Content Slider"
25
- })
26
- this.track = Section().size("100%","100%").style({
27
- transition : "transform 0.3s ease-in-out",
28
- });
29
- this.bullets = Flex().style({
30
- // position : "absolute",
31
- // top : 0,
32
- gap : "10px",
33
- padding:"10px",
34
- })
35
- this.container.append(
36
- this.track,
37
- this.bullets
38
- )
39
- this.append(this.container)
40
- }
41
- #updateAriaHidden(){
42
- for(let i=0;i<this.track.items.length;i++){
43
- this.track[i].setAttr({
44
- ariaHidden : (i!==this.cache.currentIndex)
45
- })
46
- }
47
- }
48
- goto(n = 0){
49
- this.cache.currentIndex = n;
50
- this.__updatePos();
51
- this.#updateAriaHidden()
52
- }
53
- next(n = 1){
54
- this.cache.currentIndex += n;
55
- this.__updatePos();
56
- this.#updateAriaHidden()
57
- return this;
58
- }
59
- previous(n = 1){
60
- this.cache.currentIndex -= n;
61
- this.__updatePos();
62
- this.#updateAriaHidden()
63
- return this;
64
- }
65
- #update(){
66
- const length = this.track.items.length;
67
- for(let i=0;i<length;i++){
68
- this.track.items[i].setAttr({
69
- ariaLabel : `Slide ${i+1} of ${length}`,
70
- dataSlideIndex : i
71
- })
72
- this.bullets.items[i].setAttr({
73
- dataIndex : i,
74
- ariaLabel : `Go to slide ${i}`
75
- })
76
- this.bullets[i].events.click?.destroy();
77
- this.bullets[i].onClick(()=>this.goto(i))
78
- }
79
- }
80
- #addSlide(UIElement){
81
- this.track.append(this.cache.slideBuilder(UIElement).setAttr({
82
- ariaRoledescription : "slide",
83
- role : "group",
84
- ariaLabel : "" // link to update
85
- }));
86
- const bullet = text().size("15px","15px").style({
87
- borderRadius:"50%",
88
- cursor : "pointer",
89
- border : "3px solid blue",
90
- background : "white"
91
- }).setAttr({
92
- role : "button",
93
- tabIndex : 0
94
- })
95
- .onPtrEnter(e=>e.target.st.background("gold").scale(1.2,1.2))
96
- .onPtrLeave(e=>e.target.st.background("white").scale(1,1))
97
- this.bullets.append(
98
- bullet
99
- )
100
- return this;
101
- }
102
- addSlides(...slides){
103
- slides.forEach(n=>this.#addSlide(n));
104
- this.#update();
105
- this.#updateAriaHidden();
106
- return this;
107
- }
108
- }
109
-
110
- export{
111
- __ZikoUISlider__
112
- }
@@ -1,34 +0,0 @@
1
- import { __ZikoUISlider__ } from "./__ZikoUISlider__";
2
- import { Flex } from "../Flex";
3
- class ZikoUIHorizontalSlider extends __ZikoUISlider__{
4
- constructor(...slides){
5
- super("section","hSlider")
6
- this.container.vertical(0,0)
7
- Object.assign(this.cache,{
8
- slideBuilder : (UIElement) => Flex(UIElement).style({
9
- minWidth : "100%",
10
- width:"100%",
11
- height:"100%",
12
- }).vertical(0,0)
13
- })
14
- this.track.size("100%","90%").style({
15
- display : "flex"
16
- })
17
- this.addSlides(...slides);
18
- this.bullets.horizontal(0,0).style({
19
- width : "100%",
20
- height : "10%",
21
- })
22
- }
23
- __updatePos(){
24
- const width = this.container.width;
25
- this.track.st.translateX(-this.cache.currentIndex * width);
26
- }
27
-
28
- }
29
-
30
- const hSlider=(...slides)=>new ZikoUIHorizontalSlider(...slides);
31
- export{
32
- hSlider,
33
- ZikoUIHorizontalSlider
34
- }
@@ -1,12 +0,0 @@
1
- export * from "./hSlider.js"
2
- export * from "./vSlider.js"
3
- import { hSlider } from "./hSlider.js"
4
- import { vSlider } from "./vSlider.js"
5
- const Slider = ({orintation = "horizontal",slides = []}) =>{
6
- if(["v","vertical"].includes(orintation.toLowerCase())) return vSlider(...slides);
7
- else if(["h","horizontal"].includes(orintation.toLowerCase())) return hSlider(...slides);
8
- else Error(`{ orientation : ${orintation}} Not supported`)
9
- }
10
- export{
11
- Slider
12
- }
@@ -1,27 +0,0 @@
1
- import { __ZikoUISlider__ } from "./__ZikoUISlider__";
2
- import { Flex } from "../Flex";
3
- class ZikoUIVerticalSlider extends __ZikoUISlider__{
4
- constructor(...slides){
5
- super("section","vSlider");
6
- Object.assign(this.cache,{
7
- slideBuilder : (UIElement) => Flex(UIElement).size("100%","100%").vertical(0, 0)
8
- })
9
- this.addSlides(...slides);
10
- this.container.horizontal(0,0)
11
- this.track.size("90%","100%")
12
- this.bullets.vertical(0,0).style({
13
- height : "100%",
14
- width : "10%"
15
- })
16
- }
17
- __updatePos(){
18
- const height = this.container.height;
19
- this.track.st.translateY(-this.cache.currentIndex * height);
20
- }
21
- }
22
-
23
- const vSlider=(...slides)=>new ZikoUIVerticalSlider(...slides);
24
- export{
25
- vSlider,
26
- ZikoUIVerticalSlider
27
- }
@@ -1,62 +0,0 @@
1
- import ZikoUIElement from "../../primitives/ZikoUIElement";
2
- class __ZikoUISplitter__ extends ZikoUIElement{
3
- constructor(flexDirection, resizerCursor, resizerProp){
4
- super("div", "Splitter")
5
- Object.assign(this.cache,{
6
- isResizing : false,
7
- flexDirection,
8
- resizerCursor,
9
- resizerProp
10
- })
11
- this.style({
12
- display:"flex",
13
- flexDirection : this.cache.flexDirection,
14
- border: "2px solid #333",
15
- overflow: "hidden"
16
- })
17
- this.resizer = new ZikoUIElement("div", "resizer").style({
18
- [this.cache.resizerProp]:"5px",
19
- backgroundColor: "gold",
20
- cursor: this.cache.resizerCursor,
21
- touchAction: "none",
22
- });
23
- this.onPtrDown(e=>{
24
- this.cache.isResizing = true;
25
- this.style({
26
- cursor : this.cache.resizerCursor // ns-resize
27
- });
28
- this.resizer.element.setPointerCapture(e.event.pointerId);
29
- })
30
- this.onPtrUp(e=>{
31
- this.cache.isResizing = false;
32
- this.style({
33
- cursor: "default"
34
- })
35
- this.resizer.element.releasePointerCapture(e.event.pointerId);
36
- })
37
- this.onPtrCancel(()=>{
38
- this.cache.isResizing = false;
39
- this.style({
40
- cursor: "default"
41
- })
42
- })
43
- this.onPtrOut(()=>{
44
- if (this.cache.isResizing) {
45
- this.cache.isResizing = false;
46
- this.style({
47
- cursor: "default"
48
- })
49
- }
50
- })
51
- }
52
- get isSplitter(){
53
- return true;
54
- }
55
- styleResizer(style={}){
56
- this.resizer.style(style);
57
- return this;
58
- }
59
- }
60
- export{
61
- __ZikoUISplitter__
62
- }