jb-select 6.4.1 → 6.5.0
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 +27 -11
- package/dist/i18n.d.ts +17 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.br +0 -0
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/jb-select.d.ts.map +1 -1
- package/dist/render.d.ts +2 -0
- package/dist/render.d.ts.map +1 -0
- package/lib/global.d.ts +1 -1
- package/lib/i18n.ts +24 -0
- package/lib/jb-option/jb-option.ts +1 -1
- package/lib/{jb-select.scss → jb-select.css} +19 -22
- package/lib/jb-select.ts +14 -4
- package/lib/{jb-select.html → render.ts} +6 -2
- package/lib/variables.css +1 -0
- package/package.json +3 -3
- package/react/README.md +3 -1
- package/react/dist/JBOption.d.ts +2 -2
- package/react/dist/JBOptionList.d.ts +1 -1
- package/react/dist/JBSelect.d.ts +7 -9
- package/react/dist/index.cjs.js +1 -1
- package/react/dist/index.cjs.js.map +1 -1
- package/react/dist/index.js +1 -1
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.umd.js +1 -1
- package/react/dist/index.umd.js.map +1 -1
- package/react/lib/JBOption.tsx +3 -2
- package/react/lib/JBOptionList.tsx +2 -1
- package/react/lib/JBSelect.tsx +8 -8
- /package/lib/jb-option/{jb-option.scss → jb-option.css} +0 -0
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
@use "~jb-core/styles/medias.scss" as *;
|
|
2
|
-
@use './variables.css';
|
|
1
|
+
/* @use "~jb-core/styles/medias.scss" as *; */
|
|
3
2
|
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
@custom-media --tablet-until (max-width: 768px);
|
|
7
4
|
|
|
8
5
|
.jb-select-web-component {
|
|
9
6
|
width: var(--jb-select-width, 100%);
|
|
@@ -12,7 +9,7 @@
|
|
|
12
9
|
box-sizing: border-box;
|
|
13
10
|
|
|
14
11
|
&.--focused {
|
|
15
|
-
@
|
|
12
|
+
@media(--tablet-until) {
|
|
16
13
|
position: fixed;
|
|
17
14
|
bottom: 0;
|
|
18
15
|
top: initial;
|
|
@@ -27,26 +24,26 @@
|
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
.select-box {
|
|
30
|
-
@
|
|
27
|
+
@media(--tablet-until) {
|
|
31
28
|
height: var(--jb-select-mobile-search-input-height, var(--jb-select-height, 40px));
|
|
32
29
|
background-color: var(--jb-select-mobile-input-bgcolor, var(--select-box-bg-color));
|
|
33
|
-
border-width: var(--jb-select-mobile-search-border-width, var(--
|
|
30
|
+
border-width: var(--jb-select-mobile-search-border-width, var(--border-width));
|
|
34
31
|
border-color: var(--jb-select-mobile-search-border-color, var(--border-color));
|
|
35
|
-
border-bottom-width: var(--jb-select-mobile-search-border-bottom-width, var(--
|
|
32
|
+
border-bottom-width: var(--jb-select-mobile-search-border-bottom-width, var(--border-bottom-width));
|
|
36
33
|
border-bottom-color: var(--jb-select-mobile-search-border-bottom-color, var(--jb-select-border-bottom-color, var(--border-color)));
|
|
37
34
|
border-radius: var(--jb-select-mobile-search-border-radius, var(--border-radius));
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
.front-box {
|
|
41
38
|
.arrow-icon {
|
|
42
|
-
@
|
|
39
|
+
@media(--tablet-until) {
|
|
43
40
|
display: none;
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
.selected-value-wrapper {
|
|
49
|
-
@
|
|
46
|
+
@media(--tablet-until) {
|
|
50
47
|
opacity: 0;
|
|
51
48
|
transition: none;
|
|
52
49
|
}
|
|
@@ -58,13 +55,13 @@
|
|
|
58
55
|
.middle-divider {
|
|
59
56
|
display: block;
|
|
60
57
|
|
|
61
|
-
@
|
|
58
|
+
@media(--tablet-until) {
|
|
62
59
|
margin: var(--jb-select-middle-div-mobile-margin, 16px 0 0 0);
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
.select-list-wrapper {
|
|
67
|
-
@
|
|
64
|
+
@media(--tablet-until) {
|
|
68
65
|
position: initial;
|
|
69
66
|
margin: var(--jb-select-mobile-item-list-margin, 16px 0);
|
|
70
67
|
border-radius: var(--jb-select-mobile-item-list-border-radius, var(--border-radius));
|
|
@@ -72,12 +69,12 @@
|
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
.label-wrapper {
|
|
75
|
-
@
|
|
72
|
+
@media(--tablet-until) {
|
|
76
73
|
display: flex;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
76
|
label {
|
|
80
|
-
@
|
|
77
|
+
@media(--tablet-until) {
|
|
81
78
|
color: var(--modal-label-color);
|
|
82
79
|
font-size: 1.5em;
|
|
83
80
|
display: flex;
|
|
@@ -88,7 +85,7 @@
|
|
|
88
85
|
.close-button {
|
|
89
86
|
display: none;
|
|
90
87
|
|
|
91
|
-
@
|
|
88
|
+
@media(--tablet-until) {
|
|
92
89
|
display: flex;
|
|
93
90
|
width: 48px;
|
|
94
91
|
height: 48px;
|
|
@@ -111,11 +108,11 @@
|
|
|
111
108
|
|
|
112
109
|
&.--has-value {
|
|
113
110
|
|
|
114
|
-
|
|
111
|
+
/*if user select a option and value is setted and not null*/
|
|
115
112
|
.select-box {
|
|
116
113
|
border-color: var(--jb-select-border-color-selected, var(--border-color));
|
|
117
114
|
background-color: var(--jb-select-bgcolor-selected, var(--select-box-bg-color));
|
|
118
|
-
@
|
|
115
|
+
@media(--tablet-until) {
|
|
119
116
|
&:focus-within {
|
|
120
117
|
background-color: var(--jb-select-mobile-input-bgcolor, var(--select-box-bg-color));
|
|
121
118
|
}
|
|
@@ -146,8 +143,8 @@
|
|
|
146
143
|
width: 100%;
|
|
147
144
|
box-sizing: border-box;
|
|
148
145
|
height: var(--jb-select-height, 2.5rem);
|
|
149
|
-
border: solid var(--
|
|
150
|
-
border-bottom: solid var(--
|
|
146
|
+
border: solid var(--border-width) var(--border-color);
|
|
147
|
+
border-bottom: solid var(--border-bottom-width) var(--border-color);
|
|
151
148
|
border-radius: var(--border-radius);
|
|
152
149
|
background-color: var(--select-box-bg-color);
|
|
153
150
|
margin: var(--jb-select-select-box-margin, 4px 0px 0px 0px);
|
|
@@ -162,7 +159,7 @@
|
|
|
162
159
|
border-bottom-color: var(--jb-select-border-color, var(--border-color));
|
|
163
160
|
border-radius: var(--border-radius) var(--border-radius) 0 0;
|
|
164
161
|
|
|
165
|
-
@
|
|
162
|
+
@media(--tablet-until) {
|
|
166
163
|
border-radius: var(--jb-select-mobile-search-border-radius, var(--border-radius));
|
|
167
164
|
}
|
|
168
165
|
}
|
|
@@ -321,7 +318,7 @@
|
|
|
321
318
|
}
|
|
322
319
|
|
|
323
320
|
|
|
324
|
-
@
|
|
321
|
+
@media(--tablet-until) {
|
|
325
322
|
max-height: calc(var(--mobile-modal-height) - 15rem);
|
|
326
323
|
}
|
|
327
324
|
|
package/lib/jb-select.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import CSS from "./jb-select.css";
|
|
2
|
+
import VariablesCSS from "./variables.css";
|
|
3
3
|
import {
|
|
4
4
|
JBSelectCallbacks,
|
|
5
5
|
JBSelectElements,
|
|
@@ -11,6 +11,9 @@ import { JBFormInputStandards } from 'jb-form';
|
|
|
11
11
|
// eslint-disable-next-line no-duplicate-imports
|
|
12
12
|
import { JBOptionWebComponent } from "./jb-option/jb-option";
|
|
13
13
|
import { registerDefaultVariables } from 'jb-core/theme';
|
|
14
|
+
import { renderHTML } from "./render";
|
|
15
|
+
import { dictionary } from "./i18n";
|
|
16
|
+
import { i18n } from "jb-core/i18n";
|
|
14
17
|
|
|
15
18
|
//TODO: add IncludeInputInList or freeSolo so user can select item that he wrote without even it exist in select list
|
|
16
19
|
//TODO: handleHomeEndKeys to move focus inside the popup with the Home and End keys.
|
|
@@ -63,6 +66,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
63
66
|
}
|
|
64
67
|
set placeholder(value: string) {
|
|
65
68
|
this.#placeholder = value;
|
|
69
|
+
this.#internals.ariaPlaceholder = value;
|
|
66
70
|
if (this.value !== null && this.value !== undefined) {
|
|
67
71
|
this.elements.input.placeholder = "";
|
|
68
72
|
} else {
|
|
@@ -111,13 +115,16 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
111
115
|
this.elements.input.disabled = value;
|
|
112
116
|
if (value) {
|
|
113
117
|
(this.#internals as any).states?.add("disabled");
|
|
118
|
+
this.#internals.ariaDisabled = "true";
|
|
114
119
|
} else {
|
|
115
120
|
(this.#internals as any).states?.delete("disabled");
|
|
121
|
+
this.#internals.ariaDisabled = "false";
|
|
116
122
|
}
|
|
117
123
|
}
|
|
118
124
|
#required = false;
|
|
119
125
|
set required(value: boolean) {
|
|
120
126
|
this.#required = value;
|
|
127
|
+
this.#internals.ariaRequired = value?"true":"false";
|
|
121
128
|
this.#validation.checkValiditySync({ showError: false });
|
|
122
129
|
}
|
|
123
130
|
get required() {
|
|
@@ -166,7 +173,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
166
173
|
delegatesFocus: true,
|
|
167
174
|
});
|
|
168
175
|
registerDefaultVariables();
|
|
169
|
-
const html = `<style>${CSS}</style>` + "\n" +
|
|
176
|
+
const html = `<style>${CSS} ${VariablesCSS}</style>` + "\n" + renderHTML();
|
|
170
177
|
const element = document.createElement("template");
|
|
171
178
|
element.innerHTML = html;
|
|
172
179
|
shadowRoot.appendChild(element.content.cloneNode(true));
|
|
@@ -231,6 +238,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
231
238
|
switch (name) {
|
|
232
239
|
case "label":
|
|
233
240
|
this.elements.label.text.innerHTML = value;
|
|
241
|
+
this.#internals.ariaLabel = value;
|
|
234
242
|
if (value == null || value == undefined || value == "") {
|
|
235
243
|
this.elements.label.wrapper.classList.add("--hide");
|
|
236
244
|
} else {
|
|
@@ -238,6 +246,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
238
246
|
}
|
|
239
247
|
break;
|
|
240
248
|
case "message":
|
|
249
|
+
this.#internals.ariaDescription = value;
|
|
241
250
|
this.elements.messageBox.innerHTML = value;
|
|
242
251
|
break;
|
|
243
252
|
case "value":
|
|
@@ -252,6 +261,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
252
261
|
break;
|
|
253
262
|
case "placeholder":
|
|
254
263
|
this.placeholder = value;
|
|
264
|
+
this.#internals.ariaPlaceholder = value;
|
|
255
265
|
break;
|
|
256
266
|
case "search-placeholder":
|
|
257
267
|
this.searchPlaceholder = value;
|
|
@@ -589,7 +599,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
|
|
|
589
599
|
}
|
|
590
600
|
if (this.required) {
|
|
591
601
|
const label = this.getAttribute("label") || "";
|
|
592
|
-
const message =
|
|
602
|
+
const message = dictionary.get(i18n,"requireMessage")(label || null);
|
|
593
603
|
validationList.push({
|
|
594
604
|
validator: ({ value }) => {
|
|
595
605
|
return value !== null && value !== undefined;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export function renderHTML(): string {
|
|
2
|
+
return /* html */ `
|
|
3
|
+
<div class="jb-select-web-component">
|
|
2
4
|
<div class="label-wrapper">
|
|
3
5
|
<label class="--hide"><span class="label-value"></span></label>
|
|
4
6
|
<!-- close button will be visible on mobile modal -->
|
|
@@ -47,4 +49,6 @@
|
|
|
47
49
|
</div>
|
|
48
50
|
</div>
|
|
49
51
|
<div class="message-box"></div>
|
|
50
|
-
</div>
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
54
|
+
}
|
package/lib/variables.css
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
--border-radius:var(--jb-select-border-radius, var(--jb-radius));
|
|
3
3
|
--middle-div-height: var(--jb-select-middle-div-height, 0px);
|
|
4
|
+
--border-width: var(--jb-select-border-width, 1px);
|
|
4
5
|
--border-bottom-width: var(--jb-select-border-bottom-width, var(--jb-select-border-width, 3px));
|
|
5
6
|
--base-z-index: 1;
|
|
6
7
|
--mobile-modal-z-index: 900;
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"web component",
|
|
17
17
|
"react component"
|
|
18
18
|
],
|
|
19
|
-
"version": "6.
|
|
19
|
+
"version": "6.5.0",
|
|
20
20
|
"bugs": "https://github.com/javadbat/jb-select/issues",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"files": [
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"jb-validation": ">=0.4.0",
|
|
38
|
-
"jb-core":">=0.
|
|
38
|
+
"jb-core":">=0.18.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"jb-form":">=0.
|
|
41
|
+
"jb-form":">=0.7.1"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/react/README.md
CHANGED
package/react/dist/JBOption.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { JBOptionWebComponent } from 'jb-select';
|
|
3
3
|
type TValue = any;
|
|
4
|
-
declare
|
|
4
|
+
declare module "react" {
|
|
5
5
|
namespace JSX {
|
|
6
6
|
interface IntrinsicElements {
|
|
7
7
|
'jb-option': JBOptionType;
|
|
@@ -15,5 +15,5 @@ export declare const JBOption: React.ForwardRefExoticComponent<Omit<JBOptionProp
|
|
|
15
15
|
type Props<TValue> = {
|
|
16
16
|
value: TValue;
|
|
17
17
|
};
|
|
18
|
-
export type JBOptionProps<TValue> = PropsWithChildren<JSX.JBOptionType & Props<TValue>>;
|
|
18
|
+
export type JBOptionProps<TValue> = PropsWithChildren<React.JSX.JBOptionType & Props<TValue>>;
|
|
19
19
|
export {};
|
package/react/dist/JBSelect.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type JBSelectAttributes } from './attributes-hook.js';
|
|
|
6
6
|
export type JBSelectEventType<T> = T & {
|
|
7
7
|
target: JBSelectWebComponent;
|
|
8
8
|
};
|
|
9
|
-
declare
|
|
9
|
+
declare module "react" {
|
|
10
10
|
namespace JSX {
|
|
11
11
|
interface IntrinsicElements {
|
|
12
12
|
'jb-select': JBSelectType;
|
|
@@ -21,15 +21,13 @@ declare global {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
export declare
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type Props = EventProps & JBSelectAttributes<TValue> & {
|
|
24
|
+
export declare function JBSelect<TValue>(props: Props<TValue>): React.JSX.Element;
|
|
25
|
+
export declare namespace JBSelect {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
28
|
+
export type Props<TValue> = EventProps & JBSelectAttributes<TValue> & {
|
|
29
|
+
ref?: React.RefObject<JBSelectWebComponent>;
|
|
31
30
|
style?: CSSProperties;
|
|
32
31
|
className?: string;
|
|
33
32
|
children?: React.ReactNode;
|
|
34
33
|
};
|
|
35
|
-
export {};
|
package/react/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,c=(e,u,c,a)=>{if(u&&"object"==typeof u||"function"==typeof u)for(var o,s=l(u),i=0,f=s.length;i<f;i++)o=s[i],n.call(e,o)||o===c||t(e,o,{get:(e=>u[e]).bind(null,o),enumerable:!(a=r(u,o))||a.enumerable});return e},a=(r,l,n)=>(n=null!=r?e(u(r)):{},c(!l&&r&&r.__esModule?n:t(n,"default",{value:r,enumerable:!0}),r));const o=a(require("react"));require("jb-select");const s=a(require("jb-core/react")),i=o.default.forwardRef((e,t)=>{let r=(0,o.useRef)(null);return(0,o.useImperativeHandle)(t,()=>r?r.current:void 0,[r]),(0,o.useEffect)(()=>{r.current&&Array.isArray(e.optionList)&&(r.current.optionList=e.optionList)},[e.optionList,r]),(0,o.useEffect)(()=>{r.current&&"function"==typeof e.getTitle&&r.current.setCallback("getTitle",e.getTitle)},[e.getTitle,r]),(0,o.useEffect)(()=>{r.current&&"function"==typeof e.getValue&&r.current.setCallback("getValue",e.getValue)},[e.getValue,r]),(0,o.useEffect)(()=>{r.current&&"function"==typeof e.getContentDOM&&r.current.setCallback("getContentDOM",e.getContentDOM)},[e.getContentDOM,r]),o.default.createElement("jb-option-list",{ref:r})});function f(e){let t=(0,o.useRef)(null);return(0,o.useImperativeHandle)(e.ref,()=>t?t.current:void 0,[t]),(0,s.useEvent)(t,"load",e.onLoad,!0),(0,s.useEvent)(t,"init",e.onInit,!0),(0,s.useEvent)(t,"keyup",e.onKeyUp),(0,s.useEvent)(t,"change",e.onChange),(0,s.useEvent)(t,"input",e.onInput),(0,o.useEffect)(()=>{null!==e.message&&void 0!==e.message?t.current?.setAttribute("message",e.message):t.current?.removeAttribute("message")},[e.message]),(0,o.useEffect)(()=>{t&&t.current&&(t.current.validation.list=e.validationList||[])},[e.validationList]),(0,o.useEffect)(()=>{null!==e.label&&void 0!==e.label?t.current?.setAttribute("label",e.label):t.current?.removeAttribute("label")},[e.label]),(0,o.useEffect)(()=>{null!==e.required&&void 0!==e.required?t.current?.setAttribute("required",""):t.current?.removeAttribute("required")},[e.required]),(0,o.useEffect)(()=>{null!==e.placeholder&&void 0!==e.placeholder&&t.current?.setAttribute("placeholder",e.placeholder)},[e.placeholder]),(0,o.useEffect)(()=>{null!==e.searchPlaceholder&&void 0!==e.searchPlaceholder&&t.current?.setAttribute("search-placeholder",e.searchPlaceholder)},[e.searchPlaceholder]),(0,o.useEffect)(()=>{e.error?t?.current?.setAttribute("error",e.error):t?.current?.removeAttribute("error")},[e.error]),(0,o.useEffect)(()=>{e.name?t?.current?.setAttribute("name",e.name||""):t?.current?.removeAttribute("name")},[e.name]),(0,o.useEffect)(()=>{t.current&&(t.current.value=e.value)},[e.value]),(0,o.useEffect)(()=>{"function"==typeof e.getSelectedValueDOM&&t.current&&t.current&&(t.current.callbacks.getSelectedValueDOM=e.getSelectedValueDOM)},[e.getSelectedValueDOM]),o.default.createElement("jb-select",{style:e.style?e.style:void 0,class:e.className?e.className:"",ref:t},e.children)}i.displayName="JBOptionList",f.displayName="JBSelect";const d=o.default.forwardRef((e,t)=>{let r=(0,o.useRef)(null),{value:l,children:u,className:n,...c}=e;return(0,o.useImperativeHandle)(t,()=>r?r.current:void 0,[r]),(0,o.useEffect)(()=>{r.current&&void 0!==l&&(r.current.value=l)},[l,r]),o.default.createElement("jb-option",{class:n,ref:r,...c},u)});d.displayName="JBOption",exports.JBOption=d,exports.JBOptionList=i,exports.JBSelect=f;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBSelect.tsx","../lib/JBOption.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBSelect.tsx","../lib/JBOption.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAY,+BAAuB,cAAA,WAAqB,CAAA,OAAM,QAAO;CAkBrE,MAAO,UAAM,k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AACD,sBAAU,MAAG;AACX,MAAI,MAAM,gBAAA,QAAsB,MAAQ,uBACtC,SAAQ,SAAS,aAAa,eAAA,MAAoB,YAAQ;CAE7D,GAAE,CACH,MAAU;sBAEN,MAAA;AACF,MAAA,MAAA,sBAAA,QAAA,MAAA,sCAAO,SAAA,aAAA,sBAAA,MAAA,kBAAA;KAGL,MAAM,iBAEV,EAAA;sBACM,MAAM;MACR,MAAA,MACF,UAAA,SAAA,aAAA,SAAA,MAAA,MAAA;MACE,UAAS,SAAS,gBAAgB,QAAO;CAE5C,GAAE,CACH,MAAU;sBAEN,MAAA;AACF,MAAA,MAAA,KACE,UAAa,SAAA,aAAA,QAAA,MAAA,QAAA,GAAA;MAEX,UAAO,SAAM,gBAAmB,OAAI;KAGtC,MAAM,IACZ,EAAA;;;;;;;;;;;AC1EA,SAAS,SAAA,OAA+C;CAqBxD,MAAM,UAAU,kBAAiB,KAAmB;AAClD,gCAAgB,MAA6B,KAAK,MAAA,UAAA,QAAA,kBAAA,CAClD,OAOA,EAAA;AACA,WAAA,SAAA,MAAqB;AACrB,sBACE,SAAA,MAAA;AAIJ,wBAAA,cAAA,cAAA,aAAA;EAAC,OAAA,MAAA,QAAA,MAAA;EAQO,OAAC,MAAW,YAAa,MAAA,YAAA;;;;;;;;AClDjC,MAAY,2BAAuB,cAAA,WAAmB,CAAqC,OAAM,QAAO;CAgBxG,MAAO,UAAM,kBAAW,KAAM;CAC5B,MAAM,EAAA,OAAO,UAAwC,UAAK,GAAA,MAAA,GAAA;AAC1D,gCAAa,KAAS,MAAA,UAAc,QAAK,kBAAQ,CACjD,OAMA,EAAA;sBACM,MAAA;MACF,QAAQ,WAAQ,iBAClB,SAAA,QAAA,QAAA;CAGF,GAAA,CAKA,OAOM"}
|
package/react/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{useEffect as t,useImperativeHandle as r,useRef as l}from"react";import"jb-select";import{useEvent as n}from"jb-core/react";let a=e.forwardRef((n,a)=>{let u=l(null);return r(a,()=>u?u.current:void 0,[u]),t(()=>{u.current&&Array.isArray(n.optionList)&&(u.current.optionList=n.optionList)},[n.optionList,u]),t(()=>{u.current&&"function"==typeof n.getTitle&&u.current.setCallback("getTitle",n.getTitle)},[n.getTitle,u]),t(()=>{u.current&&"function"==typeof n.getValue&&u.current.setCallback("getValue",n.getValue)},[n.getValue,u]),t(()=>{u.current&&"function"==typeof n.getContentDOM&&u.current.setCallback("getContentDOM",n.getContentDOM)},[n.getContentDOM,u]),e.createElement("jb-option-list",{ref:u})});
|
|
1
|
+
import e,{useEffect as t,useImperativeHandle as r,useRef as l}from"react";import"jb-select";import{useEvent as n}from"jb-core/react";let a=e.forwardRef((n,a)=>{let u=l(null);return r(a,()=>u?u.current:void 0,[u]),t(()=>{u.current&&Array.isArray(n.optionList)&&(u.current.optionList=n.optionList)},[n.optionList,u]),t(()=>{u.current&&"function"==typeof n.getTitle&&u.current.setCallback("getTitle",n.getTitle)},[n.getTitle,u]),t(()=>{u.current&&"function"==typeof n.getValue&&u.current.setCallback("getValue",n.getValue)},[n.getValue,u]),t(()=>{u.current&&"function"==typeof n.getContentDOM&&u.current.setCallback("getContentDOM",n.getContentDOM)},[n.getContentDOM,u]),e.createElement("jb-option-list",{ref:u})});function u(a){var u;let o=l(null);return r(a.ref,()=>o?o.current:void 0,[o]),n(o,"load",a.onLoad,!0),n(o,"init",a.onInit,!0),n(o,"keyup",a.onKeyUp),n(o,"change",a.onChange),n(o,"input",a.onInput),t(()=>{null!==u.message&&void 0!==u.message?o.current?.setAttribute("message",u.message):o.current?.removeAttribute("message")},[(u=a).message]),t(()=>{o&&o.current&&(o.current.validation.list=u.validationList||[])},[u.validationList]),t(()=>{null!==u.label&&void 0!==u.label?o.current?.setAttribute("label",u.label):o.current?.removeAttribute("label")},[u.label]),t(()=>{null!==u.required&&void 0!==u.required?o.current?.setAttribute("required",""):o.current?.removeAttribute("required")},[u.required]),t(()=>{null!==u.placeholder&&void 0!==u.placeholder&&o.current?.setAttribute("placeholder",u.placeholder)},[u.placeholder]),t(()=>{null!==u.searchPlaceholder&&void 0!==u.searchPlaceholder&&o.current?.setAttribute("search-placeholder",u.searchPlaceholder)},[u.searchPlaceholder]),t(()=>{u.error?o?.current?.setAttribute("error",u.error):o?.current?.removeAttribute("error")},[u.error]),t(()=>{u.name?o?.current?.setAttribute("name",u.name||""):o?.current?.removeAttribute("name")},[u.name]),t(()=>{o.current&&(o.current.value=u.value)},[u.value]),t(()=>{"function"==typeof u.getSelectedValueDOM&&o.current&&o.current&&(o.current.callbacks.getSelectedValueDOM=u.getSelectedValueDOM)},[u.getSelectedValueDOM]),e.createElement("jb-select",{style:a.style?a.style:void 0,class:a.className?a.className:"",ref:o},a.children)}a.displayName="JBOptionList",u.displayName="JBSelect";let o=e.forwardRef((n,a)=>{let u=l(null),{value:o,children:c,className:i,...s}=n;return r(a,()=>u?u.current:void 0,[u]),t(()=>{u.current&&void 0!==o&&(u.current.value=o)},[o,u]),e.createElement("jb-option",{class:i,ref:u,...s},c)});o.displayName="JBOption";export{o as JBOption,a as JBOptionList,u as JBSelect};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/react/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBSelect.tsx","../lib/JBOption.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBSelect.tsx","../lib/JBOption.tsx"],"sourcesContent":[],"mappings":";;;;;AAEA,MAAY,+BAAuB,MAAA,WAAqB,CAAA,OAAM,QAAO;CAkBrE,MAAO,UAAM,OAAY,KAAG;AAC1B,qBAAgB,KAAkD,MAAK,UAAA,QAAA,kBAAA,CACvE,OAKA,EAAA;WACM,MAAA;MACF,QAAQ,WAAQ,MA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;WAEN,MAAA;AACF,MAAA,MAAA,sBAAA,QAAA,MAAA,sCAAO,SAAA,aAAA,sBAAA,MAAA,kBAAA;KAGL,MAAM,iBAEV,EAAA;WACM,MAAM;MACR,MAAA,MACF,UAAA,SAAA,aAAA,SAAA,MAAA,MAAA;MACE,UAAS,SAAS,gBAAgB,QAAO;CAE5C,GAAE,CACH,MAAU;WAEN,MAAA;AACF,MAAA,MAAA,KACE,UAAa,SAAA,aAAA,QAAA,MAAA,QAAA,GAAA;MAEX,UAAO,SAAM,gBAAmB,OAAI;KAGtC,MAAM,IACZ,EAAA;;;;;;;;;;;AC1EA,SAAS,SAAA,OAA+C;CAqBxD,MAAM,UAAU,OAAiB,KAAmB;AAClD,qBAAgB,MAA6B,KAAK,MAAA,UAAA,QAAA,kBAAA,CAClD,OAOA,EAAA;AACA,WAAA,SAAA,MAAqB;AACrB,sBACE,SAAA,MAAA;AAIJ,wBAAA,MAAA,cAAA,aAAA;EAAC,OAAA,MAAA,QAAA,MAAA;EAQO,OAAC,MAAW,YAAa,MAAA,YAAA;;;;;;;;AClDjC,MAAY,2BAAuB,MAAA,WAAmB,CAAqC,OAAM,QAAO;CAgBxG,MAAO,UAAM,OAAW,KAAM;CAC5B,MAAM,EAAA,OAAO,UAAwC,UAAK,GAAA,MAAA,GAAA;AAC1D,qBAAa,KAAS,MAAA,UAAc,QAAK,kBAAQ,CACjD,OAMA,EAAA;WACM,MAAA;MACF,QAAQ,WAAQ,iBAClB,SAAA,QAAA,QAAA;CAGF,GAAA,CAKA,OAOM"}
|
package/react/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t;e=this,t=function(e,t,r,l){
|
|
1
|
+
var e,t;e=this,t=function(e,t,r,l){var u=Object.create,n=Object.defineProperty,c=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,i=(e,t,r,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var u,o=a(t),i=0,f=o.length;i<f;i++)u=o[i],s.call(e,u)||u===r||n(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(l=c(t,u))||l.enumerable});return e},f=(e,t,r)=>(r=null!=e?u(o(e)):{},i(!t&&e&&e.__esModule?r:n(r,"default",{value:e,enumerable:!0}),e));t=f(t),l=f(l);let d=t.default.forwardRef((e,r)=>{let l=(0,t.useRef)(null);return(0,t.useImperativeHandle)(r,()=>l?l.current:void 0,[l]),(0,t.useEffect)(()=>{l.current&&Array.isArray(e.optionList)&&(l.current.optionList=e.optionList)},[e.optionList,l]),(0,t.useEffect)(()=>{l.current&&"function"==typeof e.getTitle&&l.current.setCallback("getTitle",e.getTitle)},[e.getTitle,l]),(0,t.useEffect)(()=>{l.current&&"function"==typeof e.getValue&&l.current.setCallback("getValue",e.getValue)},[e.getValue,l]),(0,t.useEffect)(()=>{l.current&&"function"==typeof e.getContentDOM&&l.current.setCallback("getContentDOM",e.getContentDOM)},[e.getContentDOM,l]),t.default.createElement("jb-option-list",{ref:l})});function p(e){let r=(0,t.useRef)(null);return(0,t.useImperativeHandle)(e.ref,()=>r?r.current:void 0,[r]),(0,l.useEvent)(r,"load",e.onLoad,!0),(0,l.useEvent)(r,"init",e.onInit,!0),(0,l.useEvent)(r,"keyup",e.onKeyUp),(0,l.useEvent)(r,"change",e.onChange),(0,l.useEvent)(r,"input",e.onInput),(0,t.useEffect)(()=>{null!==e.message&&void 0!==e.message?r.current?.setAttribute("message",e.message):r.current?.removeAttribute("message")},[e.message]),(0,t.useEffect)(()=>{r&&r.current&&(r.current.validation.list=e.validationList||[])},[e.validationList]),(0,t.useEffect)(()=>{null!==e.label&&void 0!==e.label?r.current?.setAttribute("label",e.label):r.current?.removeAttribute("label")},[e.label]),(0,t.useEffect)(()=>{null!==e.required&&void 0!==e.required?r.current?.setAttribute("required",""):r.current?.removeAttribute("required")},[e.required]),(0,t.useEffect)(()=>{null!==e.placeholder&&void 0!==e.placeholder&&r.current?.setAttribute("placeholder",e.placeholder)},[e.placeholder]),(0,t.useEffect)(()=>{null!==e.searchPlaceholder&&void 0!==e.searchPlaceholder&&r.current?.setAttribute("search-placeholder",e.searchPlaceholder)},[e.searchPlaceholder]),(0,t.useEffect)(()=>{e.error?r?.current?.setAttribute("error",e.error):r?.current?.removeAttribute("error")},[e.error]),(0,t.useEffect)(()=>{e.name?r?.current?.setAttribute("name",e.name||""):r?.current?.removeAttribute("name")},[e.name]),(0,t.useEffect)(()=>{r.current&&(r.current.value=e.value)},[e.value]),(0,t.useEffect)(()=>{"function"==typeof e.getSelectedValueDOM&&r.current&&r.current&&(r.current.callbacks.getSelectedValueDOM=e.getSelectedValueDOM)},[e.getSelectedValueDOM]),t.default.createElement("jb-select",{style:e.style?e.style:void 0,class:e.className?e.className:"",ref:r},e.children)}d.displayName="JBOptionList",p.displayName="JBSelect";let b=t.default.forwardRef((e,r)=>{let l=(0,t.useRef)(null),{value:u,children:n,className:c,...a}=e;return(0,t.useImperativeHandle)(r,()=>l?l.current:void 0,[l]),(0,t.useEffect)(()=>{l.current&&void 0!==u&&(l.current.value=u)},[u,l]),t.default.createElement("jb-option",{class:c,ref:l,...a},n)});b.displayName="JBOption",e.JBOption=b,e.JBOptionList=d,e.JBSelect=p},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("jb-select"),require("jb-core/react")):"function"==typeof define&&define.amd?define(["exports","react","jb-select","jb-core/react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JBSelectReact={},e.React,e.JBSelect,e.JBCoreReact);
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/attributes-hook.ts","../lib/JBSelect.tsx","../lib/JBOption.tsx"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"index.umd.js","names":[],"sources":["../lib/JBOptionList.tsx","../lib/events-hook.ts","../lib/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QAAA;CAGF,GAAA,CAKA,OAOM"}
|
package/react/lib/JBOption.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
/* eslint-disable react/display-name */
|
|
2
3
|
import React, { useEffect, useRef, useImperativeHandle, PropsWithChildren, ComponentProps } from 'react';
|
|
3
4
|
import { JBOptionWebComponent } from 'jb-select';
|
|
4
5
|
//TODO: make it generic when remove forward ref
|
|
5
6
|
type TValue = any;
|
|
6
7
|
|
|
7
|
-
declare
|
|
8
|
+
declare module "react" {
|
|
8
9
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
9
10
|
namespace JSX {
|
|
10
11
|
interface IntrinsicElements {
|
|
@@ -41,5 +42,5 @@ type Props<TValue> = {
|
|
|
41
42
|
value:TValue
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
export type JBOptionProps<TValue> = PropsWithChildren<JSX.JBOptionType & Props<TValue>>
|
|
45
|
+
export type JBOptionProps<TValue> = PropsWithChildren<React.JSX.JBOptionType & Props<TValue>>
|
|
45
46
|
JBOption.displayName = 'JBOption';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
/* eslint-disable react/display-name */
|
|
2
3
|
import React, { useEffect, useRef, useImperativeHandle } from 'react';
|
|
3
4
|
// eslint-disable-next-line no-duplicate-imports
|
|
@@ -5,7 +6,7 @@ import { JBOptionListWebComponent } from 'jb-select';
|
|
|
5
6
|
type TOption = any;
|
|
6
7
|
type TValue = any;
|
|
7
8
|
|
|
8
|
-
declare
|
|
9
|
+
declare module "react" {
|
|
9
10
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
10
11
|
namespace JSX {
|
|
11
12
|
interface IntrinsicElements {
|
package/react/lib/JBSelect.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
'use client'
|
|
1
2
|
/* eslint-disable react/display-name */
|
|
2
|
-
import React, {
|
|
3
|
+
import React, { useRef, useImperativeHandle,CSSProperties } from 'react';
|
|
3
4
|
import 'jb-select';
|
|
4
5
|
// eslint-disable-next-line no-duplicate-imports
|
|
5
6
|
import { JBSelectWebComponent } from 'jb-select';
|
|
@@ -8,7 +9,7 @@ import { useJBSelectAttribute, type JBSelectAttributes } from './attributes-hook
|
|
|
8
9
|
export type JBSelectEventType<T> = T & {
|
|
9
10
|
target: JBSelectWebComponent
|
|
10
11
|
}
|
|
11
|
-
declare
|
|
12
|
+
declare module "react" {
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
13
14
|
namespace JSX {
|
|
14
15
|
interface IntrinsicElements {
|
|
@@ -25,12 +26,10 @@ declare global {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
type TValue = any;
|
|
30
|
-
export const JBSelect = React.forwardRef((props:Props, ref) => {
|
|
29
|
+
export function JBSelect<TValue>(props:Props<TValue>) {
|
|
31
30
|
const element = useRef<JBSelectWebComponent>(null);
|
|
32
31
|
useImperativeHandle(
|
|
33
|
-
ref,
|
|
32
|
+
props.ref,
|
|
34
33
|
() => (element ? element.current : undefined),
|
|
35
34
|
[element],
|
|
36
35
|
);
|
|
@@ -43,9 +42,10 @@ export const JBSelect = React.forwardRef((props:Props, ref) => {
|
|
|
43
42
|
{props.children}
|
|
44
43
|
</jb-select>
|
|
45
44
|
);
|
|
46
|
-
}
|
|
45
|
+
};
|
|
47
46
|
|
|
48
|
-
export type Props = EventProps & JBSelectAttributes<TValue> & {
|
|
47
|
+
export type Props<TValue> = EventProps & JBSelectAttributes<TValue> & {
|
|
48
|
+
ref?: React.RefObject<JBSelectWebComponent>,
|
|
49
49
|
style?:CSSProperties,
|
|
50
50
|
className?: string,
|
|
51
51
|
children?:React.ReactNode,
|
|
File without changes
|