jb-select 7.0.1 → 7.0.4

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/lib/jb-select.ts CHANGED
@@ -8,7 +8,7 @@ import type {
8
8
  ValidationValue,
9
9
  } from "./types";
10
10
  import { type ShowValidationErrorParameters, ValidationHelper, type ValidationItem, type ValidationResult, type WithValidation } from "jb-validation";
11
- import { isMobile } from "jb-core";
11
+ import { createInputEvent, createKeyboardEvent, isMobile } from "jb-core";
12
12
  import type { JBFormInputStandards } from 'jb-form';
13
13
  // eslint-disable-next-line no-duplicate-imports
14
14
  import { JBOptionWebComponent } from "./jb-option/jb-option";
@@ -17,6 +17,7 @@ import { renderHTML } from "./render";
17
17
  import { dictionary } from "./i18n";
18
18
  import { i18n } from "jb-core/i18n";
19
19
  import type { JBButtonWebComponent } from "jb-button";
20
+ import { JBPopoverWebComponent } from "jb-popover";
20
21
 
21
22
  //TODO: add clean button to empty the select box after value selection
22
23
  //TODO: add IncludeInputInList or freeSolo so user can select item that he wrote without even it exist in select list
@@ -31,7 +32,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
31
32
  return true;
32
33
  }
33
34
  // we keep selected option here by option but we return TValue when user demand
34
- #value: TValue;
35
+ #value: TValue| null;
35
36
  #textValue = "";
36
37
  // if user set value and current option list is not contain the option.
37
38
  // we hold it in _notFoundedValue and select value when option value get updated
@@ -42,13 +43,13 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
42
43
  callbacks: JBSelectCallbacks<TValue> = {}
43
44
  elements!: JBSelectElements;
44
45
  get value(): TValue {
45
- if (this.#value) {
46
+ if (this.#value !== null && this.#value !== undefined) {
46
47
  return this.#value;
47
48
  } else {
48
49
  return null;
49
50
  }
50
51
  }
51
- set value(value: TValue) {
52
+ set value(value: TValue | null | undefined) {
52
53
  this.#setValueFromOutside(value);
53
54
  }
54
55
  get textValue() {
@@ -120,10 +121,10 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
120
121
  this.#disabled = value;
121
122
  this.elements.input.disabled = value;
122
123
  if (value) {
123
- (this.#internals as any).states?.add("disabled");
124
+ this.#internals.states?.add("disabled");
124
125
  this.#internals.ariaDisabled = "true";
125
126
  } else {
126
- (this.#internals as any).states?.delete("disabled");
127
+ this.#internals.states?.delete("disabled");
127
128
  this.#internals.ariaDisabled = "false";
128
129
  }
129
130
  }
@@ -142,11 +143,18 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
142
143
  */
143
144
  get isAutoValidationDisabled(): boolean {
144
145
  //currently we only support disable-validation in attribute and only in initiate time but later we can add support for change of this
145
- return this.getAttribute('disable-auto-validation') === '' || this.getAttribute('disable-auto-validation') === 'true' ? true : false;
146
+ return !!(this.getAttribute('disable-auto-validation') === '' || this.getAttribute('disable-auto-validation') === 'true');
146
147
  }
147
148
  get name() {
148
149
  return this.getAttribute('name') || '';
149
150
  }
151
+ set name(value: string) {
152
+ if(value){
153
+ this.setAttribute('name', value);
154
+ }else{
155
+ this.removeAttribute('name');
156
+ }
157
+ }
150
158
  initialValue: TValue | null = null;
151
159
  get isDirty(): boolean {
152
160
  return this.value !== this.initialValue;
@@ -162,9 +170,17 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
162
170
  this.#initProp();
163
171
  }
164
172
  connectedCallback() {
165
- // standard web component event that called when all of dom is binded
173
+ // standard web component event that called when all of dom is bound
166
174
  this.#callOnLoadEvent();
167
175
  this.#callOnInitEvent();
176
+ if (this.elements.optionListWrapper instanceof JBPopoverWebComponent) {
177
+ this.#setupPopover();
178
+ } else {
179
+ customElements.whenDefined("jb-popover").then(() =>this.#setupPopover())
180
+ }
181
+ }
182
+ #setupPopover(){
183
+ this.elements.optionListWrapper.bindTarget(this.elements.selectBox);
168
184
  }
169
185
  #callOnInitEvent() {
170
186
  const event = new CustomEvent("init", { bubbles: true, composed: true });
@@ -201,6 +217,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
201
217
  emptyListPlaceholder: shadowRoot.querySelector(".empty-list-placeholder")!,
202
218
  mobileSearchInputWrapper: shadowRoot.querySelector(".mobile-search-input-wrapper"),
203
219
  frontBox: shadowRoot.querySelector(".front-box"),
220
+ selectBox: shadowRoot.querySelector(".select-box")
204
221
  };
205
222
  this.#registerEventListener();
206
223
  this.#updateListEmptyPlaceholder();
@@ -210,7 +227,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
210
227
  * place code that change on select resize between mobile & desktop
211
228
  */
212
229
  #setupDeviceRelates() {
213
- const onResize = ()=> {
230
+ const onResize = () => {
214
231
  if (isMobile()) {
215
232
  this.elements.mobileSearchInputWrapper.appendChild(this.elements.input)
216
233
  } else {
@@ -247,6 +264,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
247
264
  return [
248
265
  "label",
249
266
  "message",
267
+ "hide-clear",
250
268
  "value",
251
269
  "required",
252
270
  "placeholder",
@@ -293,6 +311,13 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
293
311
  case "error":
294
312
  this.reportValidity();
295
313
  break;
314
+ case 'hide-clear':
315
+ if(value === '' || value === 'true'){
316
+ this.elements.clearButton.style.display = 'none'
317
+ }else{
318
+ this.elements.clearButton.style.display = 'block'
319
+ }
320
+ break;
296
321
  }
297
322
  }
298
323
  /**
@@ -306,7 +331,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
306
331
  this.elements.emptyListPlaceholder.classList.add("--show");
307
332
  }
308
333
  }
309
- #onOptionSlotChange(e: Event) {
334
+ #onOptionSlotChange(_e: Event) {
310
335
  this.#setValueOnOptionListChanged();
311
336
  this.#updateListEmptyPlaceholder();
312
337
  }
@@ -326,7 +351,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
326
351
  }
327
352
  }
328
353
  //when user set value by attribute or value prop directly we call this function
329
- #setValueFromOutside(value: TValue): boolean {
354
+ #setValueFromOutside(value: TValue | null | undefined): boolean {
330
355
  if (value === null || value === undefined) {
331
356
  this.#setValue(null, null);
332
357
  return true;
@@ -387,31 +412,15 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
387
412
  this.focus();
388
413
  }
389
414
  }
390
- #onClearButtonClick(e:MouseEvent) {
415
+ #onClearButtonClick(e: MouseEvent) {
391
416
  e.stopPropagation();
392
417
  e.preventDefault();
393
- this.#setValue(null,null);
418
+ this.#setValue(null, null);
394
419
  this.#checkValidity(true);
395
420
  this.#dispatchOnChangeEvent();
396
421
  }
397
422
  #onInputKeyPress(e: KeyboardEvent) {
398
- const eventOptions: KeyboardEventInit = {
399
- altKey: e.altKey,
400
- bubbles: e.bubbles,
401
- cancelable: e.cancelable,
402
- code: e.code,
403
- composed: e.composed,
404
- ctrlKey: e.ctrlKey,
405
- detail: e.detail,
406
- isComposing: e.isComposing,
407
- key: e.key,
408
- location: e.location,
409
- metaKey: e.metaKey,
410
- view: e.view,
411
- repeat: e.repeat,
412
- shiftKey: e.shiftKey
413
- };
414
- const event = new KeyboardEvent("keypress", eventOptions);
423
+ const event = createKeyboardEvent("keypress", e, {})
415
424
  this.dispatchEvent(event);
416
425
  }
417
426
  #onInputBeforeInput(_e: InputEvent) {
@@ -427,18 +436,7 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
427
436
  this.#updateListEmptyPlaceholder();
428
437
  }
429
438
  #dispatchInputEvent(e: InputEvent) {
430
- const event = new InputEvent("input", {
431
- bubbles: e.bubbles,
432
- cancelable: e.cancelable,
433
- composed: e.composed,
434
- data: e.data,
435
- dataTransfer: e.dataTransfer,
436
- detail: e.detail,
437
- inputType: e.inputType,
438
- isComposing: e.isComposing,
439
- targetRanges: e.getTargetRanges(),
440
- view: e.view,
441
- });
439
+ const event = createInputEvent("input", e, {});
442
440
  this.dispatchEvent(event);
443
441
  }
444
442
  #onInputKeyup(e: KeyboardEvent) {
@@ -459,24 +457,8 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
459
457
  }
460
458
  }
461
459
  #triggerOnInputKeyup(e: KeyboardEvent) {
462
- const event = new KeyboardEvent("keyup", {
463
- altKey: e.altKey,
464
- bubbles: e.bubbles,
465
- cancelable: e.cancelable,
466
- code: e.code,
467
- ctrlKey: e.ctrlKey,
468
- detail: e.detail,
469
- key: e.key,
470
- shiftKey: e.shiftKey,
471
- charCode: e.charCode,
472
- location: e.location,
473
- composed: e.composed,
474
- isComposing: e.isComposing,
475
- metaKey: e.metaKey,
476
- repeat: e.repeat,
477
- keyCode: e.keyCode,
478
- view: e.view,
479
- });
460
+
461
+ const event = createKeyboardEvent('keyup', e, {})
480
462
  this.dispatchEvent(event);
481
463
  }
482
464
  #onInputChange(e: Event) {
@@ -484,10 +466,11 @@ export class JBSelectWebComponent<TValue = any> extends HTMLElement implements W
484
466
  //here is the rare time we update _text_value directly because we want trigger event that may read value directly from dom
485
467
  this.#textValue = inputText;
486
468
  }
487
- #onSelectFocus() {
488
- this.focus();
489
- }
490
- #onInputFocus() {
469
+ #onSelectFocus(e: FocusEvent) {
470
+ if (e.composedPath().find(x => x == this.elements.clearButton)) {
471
+ // we don't want focus when user click on clear button
472
+ return;
473
+ }
491
474
  this.focus();
492
475
  }
493
476
  #onInputBlur(e: FocusEvent) {
package/lib/types.ts CHANGED
@@ -23,7 +23,8 @@ export type JBSelectElements = {
23
23
  },
24
24
  emptyListPlaceholder: HTMLDivElement,
25
25
  mobileSearchInputWrapper:HTMLDivElement,
26
- frontBox:HTMLDivElement
26
+ frontBox:HTMLDivElement,
27
+ selectBox:HTMLDivElement
27
28
  }
28
29
  export type ValidationValue<TValue> = {
29
30
  selectedOption:JBOptionWebComponent<TValue> | null,
@@ -32,3 +33,6 @@ export type ValidationValue<TValue> = {
32
33
  }
33
34
 
34
35
  export type JBSelectEventType<TEvent> = EventTypeWithTarget<TEvent,JBSelectWebComponent>
36
+
37
+ /* Variants */
38
+ export type SizeVariants = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
package/lib/variables.css CHANGED
@@ -8,6 +8,11 @@
8
8
  --border-width: var(--jb-select-border-width, 1px);
9
9
  --border-bottom-width: var(--jb-select-border-bottom-width, var(--jb-select-border-width, 3px));
10
10
  --base-z-index: 1;
11
+ --selected-value-font-size:var(--jb-select-selected-value-font-size, 1rem);
12
+ --input-font-size:var(--jb-select-input-font-size, 1rem);
13
+ --selected-value-padding:var(--jb-select-selected-value-padding, 0.125rem 0.75rem 0 0.75rem);
14
+ --inline-slots-padding:0.375rem 0.625rem;
15
+ --clear-icon-size: 1rem;
11
16
  /* put message and label forward base on border radius*/
12
17
  --inline-space: calc(var(--rounded) / 1.75);
13
18
  --label-margin: var(--jb-select-label-margin, 0.125rem var(--inline-space));
@@ -31,4 +36,54 @@
31
36
 
32
37
  :host(:focus-within) {
33
38
  --border-color: var(--jb-select-border-color-focus, var(--jb-neutral));
39
+ }
40
+
41
+ /*Size*/
42
+ :host([size="xs"]){
43
+ --height:var(--jb-select-height-xs, 1.5rem);
44
+ --selected-value-font-size:var(--jb-select-selected-value-font-size-xs, 0.75rem);
45
+ --input-font-size:var(--jb-select-input-font-size-xs, 0.75rem);
46
+ --label-font-size:var(--jb-select-label-font-size-xs, 0.6rem);
47
+ /*0.7 - (0.0875 *2) */
48
+ --message-font-size:var(--jb-select-message-font-size-xs, 0.525rem);
49
+ /* 0.375 = radius-xs - (0.25*radius-xs) */
50
+ --selected-value-padding:var(--jb-select-selected-value-padding-xs, 0.125rem 0.375rem 0 0.375rem);
51
+ --rounded: var(--jb-select-rounded-xs, var(--jb-radius-xs));
52
+ --inline-slots-padding:0.125rem 0.25rem;
53
+ --clear-icon-size: 0.5rem;
54
+ }
55
+
56
+ :host([size="sm"]){
57
+ --height: var(--jb-select-height-sm, 2rem);
58
+ --selected-value-font-size:var(--jb-select-selected-value-font-size-sm, 0.875rem);
59
+ --input-font-size:var(--jb-select-input-font-size-sm, 0.875rem);
60
+ --label-font-size:var(--jb-select-label-font-size-sm, 0.7rem);
61
+ --message-font-size:var(--jb-select-message-font-size-sm, 0.6125rem);
62
+ --selected-value-padding:var(--jb-select-selected-value-padding-sm, 0.125rem 0.5625rem 0 0.5625rem);
63
+ --rounded: var(--jb-select-rounded-sm, var(--jb-radius-sm));
64
+ --inline-slots-padding:0.25rem 0.5rem;
65
+ --clear-icon-size: 0.75rem;
66
+ }
67
+
68
+ :host([size="lg"]){
69
+ --height: var(--jb-select-height-lg, 3rem);
70
+ --selected-value-font-size:var(--jb-select-selected-value-font-size-lg, 1.125rem);
71
+ --input-font-size:var(--jb-select-input-font-size-lg, 1.125rem);
72
+ --label-font-size:var(--jb-select-label-font-size-lg, 0.9rem);
73
+ /*0.7 + 0.0875*/
74
+ --message-font-size:var(--jb-select-message-font-size-lg, 0.7875rem);
75
+ --selected-value-padding:var(--jb-select-selected-value-padding-lg, 0.125rem 0.9375rem 0 0.9375rem);
76
+ --rounded: var(--jb-select-rounded-lg, var(--jb-radius-lg));
77
+ --inline-slots-padding:0.5rem 0.75rem;
78
+ }
79
+
80
+ :host([size="xl"]){
81
+ --height: var(--jb-select-height-xl, 4rem);
82
+ --selected-value-font-size:var(--jb-select-selected-value-font-size-xl, 1.25rem);
83
+ --input-font-size:var(--jb-select-input-font-size-xl, 1.25rem);
84
+ --label-font-size:var(--jb-select-label-font-size-xl, 1rem);
85
+ --message-font-size:var(--jb-select-message-font-size-xl, 0.875rem);
86
+ --selected-value-padding:var(--jb-select-selected-value-padding-xl, 0.125rem 1.125rem 0 1.125rem);
87
+ --rounded: var(--jb-select-rounded-xl, var(--jb-radius-xl));
88
+ --inline-slots-padding:0.75rem 1rem;
34
89
  }
package/package.json CHANGED
@@ -16,8 +16,9 @@
16
16
  "web component",
17
17
  "react component"
18
18
  ],
19
- "version": "7.0.1",
19
+ "version": "7.0.4",
20
20
  "bugs": "https://github.com/javadbat/jb-select/issues",
21
+ "homepage": "https://javadbat.github.io/design-system/?path=/story/components-form-elements-jbselect",
21
22
  "license": "MIT",
22
23
  "files": [
23
24
  "LICENSE",
@@ -35,9 +36,9 @@
35
36
  },
36
37
  "dependencies": {
37
38
  "jb-validation": ">=0.4.0",
38
- "jb-button": ">=3.7.0",
39
- "jb-popover": ">=1.5.0",
40
- "jb-core":">=0.22.0"
39
+ "jb-button": ">=3.8.0",
40
+ "jb-popover": ">=1.6.0",
41
+ "jb-core":">=0.24.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "jb-form":">=0.7.1"
@@ -1,8 +1,9 @@
1
- import React, { CSSProperties } from 'react';
1
+ import React, { type PropsWithChildren } from 'react';
2
2
  import 'jb-select';
3
- import { JBSelectWebComponent } from 'jb-select';
4
- import { EventProps } from './events-hook.js';
3
+ import type { JBSelectWebComponent, SizeVariants } from 'jb-select';
4
+ import { type EventProps } from './events-hook.js';
5
5
  import { type JBSelectAttributes } from './attributes-hook.js';
6
+ import type { JBElementStandardProps } from 'jb-core/react';
6
7
  export type JBSelectEventType<T> = T & {
7
8
  target: JBSelectWebComponent;
8
9
  };
@@ -18,6 +19,8 @@ declare module "react" {
18
19
  required?: string | boolean;
19
20
  message?: string;
20
21
  tabindex?: string;
22
+ size?: string;
23
+ "hide-clean"?: string;
21
24
  }
22
25
  }
23
26
  }
@@ -25,9 +28,7 @@ export declare function JBSelect<TValue>(props: Props<TValue>): React.JSX.Elemen
25
28
  export declare namespace JBSelect {
26
29
  var displayName: string;
27
30
  }
28
- export type Props<TValue> = EventProps & JBSelectAttributes<TValue> & {
31
+ export type Props<TValue> = PropsWithChildren<EventProps & JBSelectAttributes<TValue>> & JBElementStandardProps<JBSelectWebComponent, keyof EventProps & JBSelectAttributes<TValue>> & {
29
32
  ref?: React.RefObject<JBSelectWebComponent>;
30
- style?: CSSProperties;
31
- className?: string;
32
- children?: React.ReactNode;
33
+ size?: SizeVariants;
33
34
  };
@@ -1,16 +1,17 @@
1
- import { JBSelectWebComponent, type ValidationValue } from "jb-select";
2
- import { type ValidationItem } from "jb-validation";
3
- import { RefObject } from "react";
1
+ import type { JBSelectWebComponent, ValidationValue } from "jb-select";
2
+ import type { ValidationItem } from "jb-validation";
3
+ import { type RefObject } from "react";
4
4
  export type JBSelectAttributes<TValue> = {
5
5
  validationList?: ValidationItem<ValidationValue<TValue>>[];
6
6
  name?: string;
7
7
  label?: string;
8
8
  error?: string;
9
- value?: any;
9
+ value?: TValue;
10
10
  message?: string;
11
11
  placeholder?: string;
12
12
  searchPlaceholder?: string;
13
13
  required?: boolean;
14
+ hideClear?: boolean;
14
15
  getSelectedValueDOM?: (option: any) => HTMLElement;
15
16
  };
16
17
  export declare function useJBSelectAttribute<TValue>(element: RefObject<JBSelectWebComponent>, props: JBSelectAttributes<TValue>): void;
@@ -1,4 +1,4 @@
1
- import { RefObject } from "react";
1
+ import type { RefObject } from "react";
2
2
  import type { JBSelectWebComponent, JBSelectEventType } from 'jb-select';
3
3
  export type EventProps = {
4
4
  /**
@@ -1,2 +1,2 @@
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;
1
+ var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,l=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty,c=(e,l,c,a)=>{if(l&&"object"==typeof l||"function"==typeof l)for(var o,i=u(l),s=0,f=i.length;s<f;s++)o=i[s],n.call(e,o)||o===c||t(e,o,{get:(e=>l[e]).bind(null,o),enumerable:!(a=r(l,o))||a.enumerable});return e},a=(r,u,n)=>(n=null!=r?e(l(r)):{},c(!u&&r&&r.__esModule?n:t(n,"default",{value:r,enumerable:!0}),r));const o=a(require("react"));require("jb-select");const i=a(require("jb-core/react")),s=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){var t,r;let u=(0,o.useRef)(null);(0,o.useImperativeHandle)(e.ref,()=>u?u.current:void 0,[u]);let{onChange:l,onInit:n,onInput:c,onKeyUp:a,onLoad:s,error:f,getSelectedValueDOM:d,label:p,name:b,required:v,message:m,placeholder:g,searchPlaceholder:h,validationList:E,value:O,hideClear:y,...A}=e;return t={onChange:l,onInit:n,onInput:c,onKeyUp:a,onLoad:s},(0,i.useEvent)(u,"load",t.onLoad,!0),(0,i.useEvent)(u,"init",t.onInit,!0),(0,i.useEvent)(u,"keyup",t.onKeyUp),(0,i.useEvent)(u,"change",t.onChange),(0,i.useEvent)(u,"input",t.onInput),r={error:f,getSelectedValueDOM:d,label:p,name:b,required:v,message:m,placeholder:g,searchPlaceholder:h,validationList:E,value:O,hideClear:y},(0,o.useEffect)(()=>{null!==r.message&&void 0!==r.message?u.current?.setAttribute("message",r.message):u.current?.removeAttribute("message")},[r.message]),(0,o.useEffect)(()=>{u?.current&&(u.current.validation.list=r.validationList||[])},[u.current,r.validationList]),(0,o.useEffect)(()=>{null!==r.label&&void 0!==r.label?u.current?.setAttribute("label",r.label):u.current?.removeAttribute("label")},[r.label,u.current]),(0,o.useEffect)(()=>{null!==r.required&&void 0!==r.required?u.current?.setAttribute("required",""):u.current?.removeAttribute("required")},[r.required,u]),(0,o.useEffect)(()=>{null!==r.hideClear&&void 0!==r.hideClear?u.current?.setAttribute("hide-clear",""):u.current?.removeAttribute("hide-clear")},[r.hideClear,u]),(0,o.useEffect)(()=>{null!==r.placeholder&&void 0!==r.placeholder&&u.current?.setAttribute("placeholder",r.placeholder)},[r.placeholder,u]),(0,o.useEffect)(()=>{null!==r.searchPlaceholder&&void 0!==r.searchPlaceholder&&u.current?.setAttribute("search-placeholder",r.searchPlaceholder)},[r.searchPlaceholder]),(0,o.useEffect)(()=>{r.error?u?.current?.setAttribute("error",r.error):u?.current?.removeAttribute("error")},[r.error]),(0,o.useEffect)(()=>{r.name?u?.current?.setAttribute("name",r.name||""):u?.current?.removeAttribute("name")},[r.name]),(0,o.useEffect)(()=>{u.current&&(u.current.value=r.value)},[r.value]),(0,o.useEffect)(()=>{"function"==typeof r.getSelectedValueDOM&&u.current&&u.current&&(u.current.callbacks.getSelectedValueDOM=r.getSelectedValueDOM)},[r.getSelectedValueDOM]),o.default.createElement("jb-select",{ref:u,...A},e.children)}s.displayName="JBOptionList",f.displayName="JBSelect";const d=o.default.forwardRef((e,t)=>{let r=(0,o.useRef)(null),{value:u,children:l,className:n,...c}=e;return(0,o.useImperativeHandle)(t,()=>r?r.current:void 0,[r]),(0,o.useEffect)(()=>{r.current&&void 0!==u&&(r.current.value=u)},[u,r]),o.default.createElement("jb-option",{class:n,ref:r,...c},l)});d.displayName="JBOption",exports.JBOption=d,exports.JBOptionList=s,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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAY,+BAAuB,cAAA,WAAqB,CAAA,OAAM,QAAO;CAkBrE,MAAO,UAAM,kBAAY,KAAG;AAC1B,gCAAgB,KAAkD,MAAK,UAAA,QAAA,kBAAA,CACvE,OAKA,EAAA;sBACM,MAAA;MACF,QAAQ,WAAQ,MAAA,QAAa,MAAM,WAAU,CAC/C,SAAA,QAAA,aAAA,MAAA;CAEF,GAAA,CACE,MAAI;AAGN,sBAAU,MAAA;AACV,MAAA,QAAe,kBAAA,MAAA,YAAA,WACT,SAAQ,QAAO,YAAW,YAAc,MAAI,SAAU;KAGxD,MAAM,UACV;sBAEI,MAAA;AACF,MAAA,QAAA,kBAAA,MAAA,YAAA,WACE,SAAM,QAAa,YAAW,YAAA,MAAA,SAAA;CAKlC,GAAA,CAQF,MAAa;;;;;;;;;;AC1Cb,SAAgB,UAAU,SAA0C,OAAiB;AACnF,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,QAAQ,MAAM,QAAQ,KAAK;AAC7C,6BAAS,SAAS,SAAS,MAAM,QAAQ;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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"}
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,kBAAY,KAAG;AAC1B,gCAAgB,KAAkD,MAAK,UAAA,QAAA,kBAAA,CACvE,OAKA,EAAA;sBACM,MAAA;MACF,QAAQ,WAAQ,MAAA,QAAa,MAAM,WAAU,CAC/C,SAAA,QAAA,aAAA,MAAA;CAEF,GAAA,CACE,MAAI;AAGN,sBAAU,MAAA;AACV,MAAA,QAAe,kBAAA,MAAA,YAAA,WACT,SAAQ,QAAO,YAAW,YAAc,MAAI,SAAU;KAGxD,MAAM,UACV;sBAEI,MAAA;AACF,MAAA,QAAA,kBAAA,MAAA,YAAA,WACE,SAAM,QAAa,YAAW,YAAA,MAAA,SAAA;CAKlC,GAAA,CAQF,MAAa;;;;;;;;;;AC1Cb,SAAgB,UAAU,SAA0C,OAAiB;AACnF,6BAAS,SAAS,QAAQ,MAA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AA;CAEF,GAAA,CACE,MAAI;sBAEJ,MAAA;AACE,MAAA,MAAM,KACZ,UAAA,SAAA,aAAA,QAAA,MAAA,QAAA,GAAA;;;;;;;;;;;;;ACtFA,SAAS,SAAA,OAA+C;CAuBxD,MAAM,UAAU,kBAAiB,KAAmB;AAClD,gCAAgB,MAA6B,KAAK,MAAA,UAAA,QAAA,kBAAA,CAClD,OAKA,EAAA;CACA,MAAA,EAAA,UAAiB,QAAE,SAAS,SAAO,QAAQ,OAAQ,qBAAQ,OAAA,MAAA,UAAA,SAAA,aAAA,mBAAA,gBAAA,OAAA,UAAA,GAAA,YAAA,GAAA;AAC3D,WAAA,SAAA;EACA;EAKF;EAAC;EAMO;;;;;;;;;;;;;;;;;;;;;;;;;ACjDR,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"}
@@ -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})});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};
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 u=e.forwardRef((n,u)=>{let a=l(null);return r(u,()=>a?a.current:void 0,[a]),t(()=>{a.current&&Array.isArray(n.optionList)&&(a.current.optionList=n.optionList)},[n.optionList,a]),t(()=>{a.current&&"function"==typeof n.getTitle&&a.current.setCallback("getTitle",n.getTitle)},[n.getTitle,a]),t(()=>{a.current&&"function"==typeof n.getValue&&a.current.setCallback("getValue",n.getValue)},[n.getValue,a]),t(()=>{a.current&&"function"==typeof n.getContentDOM&&a.current.setCallback("getContentDOM",n.getContentDOM)},[n.getContentDOM,a]),e.createElement("jb-option-list",{ref:a})});function a(u){var a,i;let c=l(null);r(u.ref,()=>c?c.current:void 0,[c]);let{onChange:o,onInit:s,onInput:d,onKeyUp:p,onLoad:b,error:m,getSelectedValueDOM:g,label:v,name:h,required:f,message:A,placeholder:O,searchPlaceholder:y,validationList:C,value:L,hideClear:D,...M}=u;return n(c,"load",(a={onChange:o,onInit:s,onInput:d,onKeyUp:p,onLoad:b}).onLoad,!0),n(c,"init",a.onInit,!0),n(c,"keyup",a.onKeyUp),n(c,"change",a.onChange),n(c,"input",a.onInput),i={error:m,getSelectedValueDOM:g,label:v,name:h,required:f,message:A,placeholder:O,searchPlaceholder:y,validationList:C,value:L,hideClear:D},t(()=>{null!==i.message&&void 0!==i.message?c.current?.setAttribute("message",i.message):c.current?.removeAttribute("message")},[i.message]),t(()=>{c?.current&&(c.current.validation.list=i.validationList||[])},[c.current,i.validationList]),t(()=>{null!==i.label&&void 0!==i.label?c.current?.setAttribute("label",i.label):c.current?.removeAttribute("label")},[i.label,c.current]),t(()=>{null!==i.required&&void 0!==i.required?c.current?.setAttribute("required",""):c.current?.removeAttribute("required")},[i.required,c]),t(()=>{null!==i.hideClear&&void 0!==i.hideClear?c.current?.setAttribute("hide-clear",""):c.current?.removeAttribute("hide-clear")},[i.hideClear,c]),t(()=>{null!==i.placeholder&&void 0!==i.placeholder&&c.current?.setAttribute("placeholder",i.placeholder)},[i.placeholder,c]),t(()=>{null!==i.searchPlaceholder&&void 0!==i.searchPlaceholder&&c.current?.setAttribute("search-placeholder",i.searchPlaceholder)},[i.searchPlaceholder]),t(()=>{i.error?c?.current?.setAttribute("error",i.error):c?.current?.removeAttribute("error")},[i.error]),t(()=>{i.name?c?.current?.setAttribute("name",i.name||""):c?.current?.removeAttribute("name")},[i.name]),t(()=>{c.current&&(c.current.value=i.value)},[i.value]),t(()=>{"function"==typeof i.getSelectedValueDOM&&c.current&&c.current&&(c.current.callbacks.getSelectedValueDOM=i.getSelectedValueDOM)},[i.getSelectedValueDOM]),e.createElement("jb-select",{ref:c,...M},u.children)}u.displayName="JBOptionList",a.displayName="JBSelect";let i=e.forwardRef((n,u)=>{let a=l(null),{value:i,children:c,className:o,...s}=n;return r(u,()=>a?a.current:void 0,[a]),t(()=>{a.current&&void 0!==i&&(a.current.value=i)},[i,a]),e.createElement("jb-option",{class:o,ref:a,...s},c)});i.displayName="JBOption";export{i as JBOption,u as JBOptionList,a as JBSelect};
2
2
  //# sourceMappingURL=index.js.map
@@ -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":[],"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,MAAA,QAAa,MAAM,WAAU,CAC/C,SAAA,QAAA,aAAA,MAAA;CAEF,GAAA,CACE,MAAI;AAGN,WAAU,MAAA;AACV,MAAA,QAAe,kBAAA,MAAA,YAAA,WACT,SAAQ,QAAO,YAAW,YAAc,MAAI,SAAU;KAGxD,MAAM,UACV;WAEI,MAAA;AACF,MAAA,QAAA,kBAAA,MAAA,YAAA,WACE,SAAM,QAAa,YAAW,YAAA,MAAA,SAAA;CAKlC,GAAA,CAQF,MAAa;;;;;;;;;;A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AO,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"}
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,MAAA,QAAa,MAAM,WAAU,CAC/C,SAAA,QAAA,aAAA,MAAA;CAEF,GAAA,CACE,MAAI;AAGN,WAAU,MAAA;AACV,MAAA,QAAe,kBAAA,MAAA,YAAA,WACT,SAAQ,QAAO,YAAW,YAAc,MAAI,SAAU;KAGxD,MAAM,UACV;WAEI,MAAA;AACF,MAAA,QAAA,kBAAA,MAAA,YAAA,WACE,SAAM,QAAa,YAAW,YAAA,MAA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U,MAAI;AACd,MAAA,MAAa,MACP,UAAQ,SAAS,aAAA,SAAA,MAAA,MAAA;MAErB,UAAA,SAAA,gBAAA,QAAA;CAEF,GAAA,CACE,MAAI;WAEJ,MAAA;AACE,MAAA,MAAM,KACZ,UAAA,SAAA,aAAA,QAAA,MAAA,QAAA,GAAA;;;;;;;;;;;;;ACtFA,SAAS,SAAA,OAA+C;CAuBxD,MAAM,UAAU,OAAiB,KAAmB;AAClD,qBAAgB,MAA6B,KAAK,MAAA,UAAA,QAAA,kBAAA,CAClD,OAKA,EAAA;CACA,MAAA,EAAA,UAAiB,QAAE,SAAS,SAAO,QAAQ,OAAQ,qBAAQ,OAAA,MAAA,UAAA,SAAA,aAAA,mBAAA,gBAAA,OAAA,UAAA,GAAA,YAAA,GAAA;AAC3D,WAAA,SAAA;EACA;EAKF;EAAC;EAMO;;;;;;;;;;;;;;;;;;;;;;;;;ACjDR,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"}
@@ -1,2 +1,2 @@
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);
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,i=Object.prototype.hasOwnProperty,s=(e,t,r,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var u,o=a(t),s=0,f=o.length;s<f;s++)u=o[s],i.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)):{},s(!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){var r,u;let n=(0,t.useRef)(null);(0,t.useImperativeHandle)(e.ref,()=>n?n.current:void 0,[n]);let{onChange:c,onInit:a,onInput:o,onKeyUp:i,onLoad:s,error:f,getSelectedValueDOM:d,label:p,name:b,required:v,message:m,placeholder:g,searchPlaceholder:h,validationList:E,value:y,hideClear:O,...A}=e;return r={onChange:c,onInit:a,onInput:o,onKeyUp:i,onLoad:s},(0,l.useEvent)(n,"load",r.onLoad,!0),(0,l.useEvent)(n,"init",r.onInit,!0),(0,l.useEvent)(n,"keyup",r.onKeyUp),(0,l.useEvent)(n,"change",r.onChange),(0,l.useEvent)(n,"input",r.onInput),u={error:f,getSelectedValueDOM:d,label:p,name:b,required:v,message:m,placeholder:g,searchPlaceholder:h,validationList:E,value:y,hideClear:O},(0,t.useEffect)(()=>{null!==u.message&&void 0!==u.message?n.current?.setAttribute("message",u.message):n.current?.removeAttribute("message")},[u.message]),(0,t.useEffect)(()=>{n?.current&&(n.current.validation.list=u.validationList||[])},[n.current,u.validationList]),(0,t.useEffect)(()=>{null!==u.label&&void 0!==u.label?n.current?.setAttribute("label",u.label):n.current?.removeAttribute("label")},[u.label,n.current]),(0,t.useEffect)(()=>{null!==u.required&&void 0!==u.required?n.current?.setAttribute("required",""):n.current?.removeAttribute("required")},[u.required,n]),(0,t.useEffect)(()=>{null!==u.hideClear&&void 0!==u.hideClear?n.current?.setAttribute("hide-clear",""):n.current?.removeAttribute("hide-clear")},[u.hideClear,n]),(0,t.useEffect)(()=>{null!==u.placeholder&&void 0!==u.placeholder&&n.current?.setAttribute("placeholder",u.placeholder)},[u.placeholder,n]),(0,t.useEffect)(()=>{null!==u.searchPlaceholder&&void 0!==u.searchPlaceholder&&n.current?.setAttribute("search-placeholder",u.searchPlaceholder)},[u.searchPlaceholder]),(0,t.useEffect)(()=>{u.error?n?.current?.setAttribute("error",u.error):n?.current?.removeAttribute("error")},[u.error]),(0,t.useEffect)(()=>{u.name?n?.current?.setAttribute("name",u.name||""):n?.current?.removeAttribute("name")},[u.name]),(0,t.useEffect)(()=>{n.current&&(n.current.value=u.value)},[u.value]),(0,t.useEffect)(()=>{"function"==typeof u.getSelectedValueDOM&&n.current&&n.current&&(n.current.callbacks.getSelectedValueDOM=u.getSelectedValueDOM)},[u.getSelectedValueDOM]),t.default.createElement("jb-select",{ref:n,...A},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":[],"mappings":";;;;;;;;;;;;;;;;;;;;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AW,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"}
@@ -1,11 +1,12 @@
1
1
  'use client'
2
2
  /* eslint-disable react/display-name */
3
- import React, { useRef, useImperativeHandle,CSSProperties } from 'react';
3
+ import React, { useRef, useImperativeHandle, type PropsWithChildren } from 'react';
4
4
  import 'jb-select';
5
5
  // eslint-disable-next-line no-duplicate-imports
6
- import { JBSelectWebComponent } from 'jb-select';
7
- import { EventProps, useEvents } from './events-hook.js';
6
+ import type { JBSelectWebComponent, SizeVariants } from 'jb-select';
7
+ import { type EventProps, useEvents } from './events-hook.js';
8
8
  import { useJBSelectAttribute, type JBSelectAttributes } from './attributes-hook.js';
9
+ import type { JBElementStandardProps } from 'jb-core/react';
9
10
  export type JBSelectEventType<T> = T & {
10
11
  target: JBSelectWebComponent
11
12
  }
@@ -22,7 +23,8 @@ declare module "react" {
22
23
  required?:string | boolean,
23
24
  message?:string,
24
25
  tabindex?:string,
25
- // ref:React.RefObject<JBDateInputWebComponent>,
26
+ size?:string,
27
+ "hide-clean"?:string,
26
28
  }
27
29
  }
28
30
  }
@@ -33,21 +35,18 @@ export function JBSelect<TValue>(props:Props<TValue>) {
33
35
  () => (element ? element.current : undefined),
34
36
  [element],
35
37
  );
36
-
37
-
38
- useEvents(element,props);
39
- useJBSelectAttribute(element,props);
38
+ const {onChange,onInit,onInput,onKeyUp,onLoad,error,getSelectedValueDOM,label,name,required,message,placeholder,searchPlaceholder,validationList,value, hideClear, ...otherProps} = props;
39
+ useEvents(element,{onChange,onInit,onInput,onKeyUp,onLoad});
40
+ useJBSelectAttribute(element,{error,getSelectedValueDOM,label,name,required,message,placeholder,searchPlaceholder,validationList,value,hideClear});
40
41
  return (
41
- <jb-select style={props.style?props.style:undefined} class={props.className?props.className:""} ref={element}>
42
+ <jb-select ref={element} {...otherProps}>
42
43
  {props.children}
43
44
  </jb-select>
44
45
  );
45
46
  };
46
47
 
47
- export type Props<TValue> = EventProps & JBSelectAttributes<TValue> & {
48
+ export type Props<TValue> = PropsWithChildren<EventProps & JBSelectAttributes<TValue>> & JBElementStandardProps<JBSelectWebComponent, keyof EventProps & JBSelectAttributes<TValue>> & {
48
49
  ref?: React.RefObject<JBSelectWebComponent>,
49
- style?:CSSProperties,
50
- className?: string,
51
- children?:React.ReactNode,
50
+ size?: SizeVariants,
52
51
  }
53
52
  JBSelect.displayName = 'JBSelect';