@sydsoft/base 1.32.0 → 1.34.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.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const isDev: boolean;
3
+ export declare const isServerReq: (context: any) => boolean;
3
4
  export declare function tumuBuyukCevir(e: React.ChangeEvent<HTMLInputElement>): void;
4
5
  export declare function tumuKucukCevir(e: React.ChangeEvent<HTMLInputElement>): void;
5
6
  export declare function seoCevirFunction(e: React.ChangeEvent<HTMLInputElement>): void;
@@ -1,4 +1,5 @@
1
1
  export var isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
2
+ export var isServerReq = function (context) { var _a, _b; return !((_b = (_a = context === null || context === void 0 ? void 0 : context.req) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.startsWith('/_next')); };
2
3
  export function tumuBuyukCevir(e) {
3
4
  var _a;
4
5
  if ((e === null || e === void 0 ? void 0 : e.target) && ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.setSelectionRange)) {
@@ -38,11 +39,11 @@ export function seoCevirFunction(e) {
38
39
  }
39
40
  export function getDomain(context) {
40
41
  if (context === void 0) { context = null; }
41
- var url = "";
42
+ var url = '';
42
43
  if (context) {
43
44
  url = context.req.headers.host;
44
45
  }
45
- else if (typeof window !== "undefined") {
46
+ else if (typeof window !== 'undefined') {
46
47
  url = window.location.hostname;
47
48
  }
48
49
  if (url.length) {
@@ -52,11 +53,11 @@ export function getDomain(context) {
52
53
  // see if the second level domain is a common SLD.
53
54
  if (parts[1].match(/^(com|edu|gov|net|mil|org|nom|co|name|info|biz)$/i)) {
54
55
  var domain_1 = parts[2] + '.' + parts[1] + '.' + parts[0];
55
- return domain_1.split(":")[0];
56
+ return domain_1.split(':')[0];
56
57
  }
57
58
  }
58
59
  var domain = parts[1] + '.' + parts[0];
59
- return domain.split(":")[0];
60
+ return domain.split(':')[0];
60
61
  }
61
62
  return url;
62
63
  }
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  type maskSettingsTranslation = {
3
3
  [key: string]: {
4
4
  pattern: any;
@@ -1,11 +1,11 @@
1
1
  import { __assign } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useCallback, useEffect, useRef, useState } from "react";
4
- import { seoCevirFunction, tumuBuyukCevir, tumuKucukCevir } from "../_lib/baseFunctions";
5
- import { Dialog } from "./Dialog";
6
- import { alert_add } from "../alert";
7
- import { applyInputMask } from "../_lib/inputMask";
8
- import styles from "./styles/Input.module.css";
3
+ import { useCallback, useEffect, useRef, useState } from 'react';
4
+ import { seoCevirFunction, tumuBuyukCevir, tumuKucukCevir } from '../_lib/baseFunctions';
5
+ import { applyInputMask } from '../_lib/inputMask';
6
+ import { alert_add } from '../alert';
7
+ import { Dialog } from './Dialog';
8
+ import styles from './styles/Input.module.css';
9
9
  export var Input = function (_a) {
10
10
  var componentRef = _a.componentRef, inputRef = _a.inputRef, className = _a.className, propsComponent = _a.propsComponent, propsInput = _a.propsInput, id = _a.id, name = _a.name, value = _a.value, type = _a.type, label = _a.label, startAdornment = _a.startAdornment, endAdornment = _a.endAdornment, placeholder = _a.placeholder, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, onClick = _a.onClick, onKeyPress = _a.onKeyPress, onKeyUp = _a.onKeyUp, onKeyDown = _a.onKeyDown, disabled = _a.disabled, required = _a.required, loading = _a.loading, autoFocus = _a.autoFocus, select = _a.select, _b = _a.valueKey, valueKey = _b === void 0 ? 'value' : _b, _c = _a.labelKey, labelKey = _c === void 0 ? 'label' : _c, ilkSec = _a.ilkSec, multiline = _a.multiline, rows = _a.rows, sadeceYazi = _a.sadeceYazi, sadeceSayi = _a.sadeceSayi, tumuBuyuk = _a.tumuBuyuk, tumuKucuk = _a.tumuKucuk, seoCevir = _a.seoCevir, dosyaNoGiris = _a.dosyaNoGiris, fileNameGiris = _a.fileNameGiris, dateGecmisKontrol = _a.dateGecmisKontrol, autoSelectText = _a.autoSelectText, _d = _a.mask, mask = _d === void 0 ? '' : _d, _e = _a.maskSettings, maskSettings = _e === void 0 ? {
11
11
  clearIfNotMatch: true,
@@ -38,7 +38,7 @@ export var Input = function (_a) {
38
38
  }, [value]);
39
39
  useEffect(function () {
40
40
  // if (type === "number") sadeceSayi = true; //TODO: sadeceSayi burada değiştirelemez ki!!!
41
- if (select && ilkSec && value.toString().length === 0) {
41
+ if (select && ilkSec && (value === '' || !value)) {
42
42
  if (select.length) {
43
43
  var ilkItem = select[0][valueKey] ? select[0][valueKey] : '';
44
44
  onChange && onChange({ target: { name: name, value: ilkItem } });
@@ -6,21 +6,21 @@ type typeList = {
6
6
  [key: string | number]: any;
7
7
  }[];
8
8
  interface Props extends PropsInput {
9
- autoCompleteList?: typeList | any;
10
- onChange?: Function;
9
+ autoCompleteList?: typeList;
10
+ onChange?: (e: any) => void;
11
11
  value: string | number | undefined;
12
12
  valueKey?: string;
13
13
  labelKey?: string;
14
14
  itemComponent?: any;
15
- api?: boolean;
16
- onText?: Function;
17
- onSelect?: Function;
18
- onLoad?: Function;
15
+ isDataFromApi?: boolean;
16
+ onText?: (text: string) => void;
17
+ onSelect?: (item: any) => void;
18
+ onLoad?: (value: string | number) => void;
19
19
  newCreate?: boolean;
20
20
  refModal?: any;
21
21
  style?: React.CSSProperties;
22
22
  disabled?: boolean;
23
- parentInputValue?: any;
23
+ parentInputValue?: string | number | undefined;
24
24
  listPositionRelative?: boolean;
25
25
  }
26
26
  type handle = {
@@ -1,30 +1,23 @@
1
1
  import { __assign, __rest, __spreadArray } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Input } from "./Input";
4
- import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
4
+ import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
5
5
  import { Button } from "./Button";
6
6
  import { Icon } from "../icon";
7
7
  import { isDev } from "../_lib/baseFunctions";
8
8
  import styles from "./styles/SearchableInput.module.css";
9
9
  var Component = function (_a, forwardedRef) {
10
- var _b = _a.api, api = _b === void 0 ? false : _b, onText = _a.onText, onSelect = _a.onSelect, onLoad = _a.onLoad, _c = _a.newCreate, newCreate = _c === void 0 ? false : _c, name = _a.name, value = _a.value, _d = _a.autoCompleteList, autoCompleteList = _d === void 0 ? [] : _d, itemComponent = _a.itemComponent, onChange = _a.onChange, inputRef = _a.inputRef, _e = _a.valueKey, valueKey = _e === void 0 ? "value" : _e, _f = _a.labelKey, labelKey = _f === void 0 ? "label" : _f, placeholder = _a.placeholder, endAdornment = _a.endAdornment, refModal = _a.refModal, style = _a.style, disabled = _a.disabled, parentInputValue = _a.parentInputValue, listPositionRelative = _a.listPositionRelative, other = __rest(_a, ["api", "onText", "onSelect", "onLoad", "newCreate", "name", "value", "autoCompleteList", "itemComponent", "onChange", "inputRef", "valueKey", "labelKey", "placeholder", "endAdornment", "refModal", "style", "disabled", "parentInputValue", "listPositionRelative"]);
10
+ var _b = _a.autoCompleteList, autoCompleteList = _b === void 0 ? [] : _b, _c = _a.isDataFromApi, isDataFromApi = _c === void 0 ? false : _c, onText = _a.onText, onSelect = _a.onSelect, onLoad = _a.onLoad, onChange = _a.onChange, _d = _a.newCreate, newCreate = _d === void 0 ? false : _d, name = _a.name, value = _a.value, itemComponent = _a.itemComponent, inputRef = _a.inputRef, _e = _a.valueKey, valueKey = _e === void 0 ? "value" : _e, _f = _a.labelKey, labelKey = _f === void 0 ? "label" : _f, placeholder = _a.placeholder, endAdornment = _a.endAdornment, refModal = _a.refModal, style = _a.style, disabled = _a.disabled, parentInputValue = _a.parentInputValue, listPositionRelative = _a.listPositionRelative, other = __rest(_a, ["autoCompleteList", "isDataFromApi", "onText", "onSelect", "onLoad", "onChange", "newCreate", "name", "value", "itemComponent", "inputRef", "valueKey", "labelKey", "placeholder", "endAdornment", "refModal", "style", "disabled", "parentInputValue", "listPositionRelative"]);
11
11
  var refMain = useRef(null);
12
12
  var refInput = useRef(null);
13
- useEffect(function () {
14
- if (inputRef)
15
- inputRef.current = refInput.current;
16
- }, [refInput.current]);
17
- var refComponentInput = useRef();
18
- var refList = useRef();
13
+ var refComponentInput = useRef(null);
14
+ var refList = useRef(null);
19
15
  var _g = useState(autoCompleteList), data = _g[0], setData = _g[1];
20
16
  var _h = useState(""), text = _h[0], setText = _h[1]; //Inputta görünen
21
17
  var _j = useState(""), filter = _j[0], setFilter = _j[1]; // Filtrelemeye tabi tutulan
22
18
  var _k = useState(false), open = _k[0], setOpen = _k[1];
23
- var _l = useState(api), loading = _l[0], setLoading = _l[1];
24
- useEffect(function () {
25
- if (onLoad)
26
- onLoad(value !== null && value !== void 0 ? value : "");
27
- }, []);
19
+ var _l = useState(isDataFromApi), loading = _l[0], setLoading = _l[1];
20
+ var _m = useState({ created: false }), newItemCreate = _m[0], setNewItemCreate = _m[1];
28
21
  useImperativeHandle(forwardedRef, function () { return ({
29
22
  open: function () { return setOpen(true); },
30
23
  close: function () { return setOpen(false); },
@@ -44,26 +37,39 @@ var Component = function (_a, forwardedRef) {
44
37
  if (openList === void 0) { openList = false; }
45
38
  if (focusInput === void 0) { focusInput = false; }
46
39
  return clear(openList, focusInput);
47
- }
40
+ },
48
41
  }); });
49
42
  useEffect(function () {
50
- if (parentInputValue) {
43
+ if (onLoad)
44
+ onLoad(value !== null && value !== void 0 ? value : "");
45
+ }, []);
46
+ useEffect(function () {
47
+ if (inputRef)
48
+ inputRef.current = refInput.current;
49
+ }, [refInput.current]);
50
+ useEffect(function () {
51
+ if (parentInputValue)
51
52
  clear(false);
52
- }
53
53
  }, [parentInputValue]);
54
+ // autoCompleteList prop'u değiştiğinde data state'ini güncelle
55
+ useEffect(function () {
56
+ if (autoCompleteList && Array.isArray(autoCompleteList)) {
57
+ setData(autoCompleteList);
58
+ isDev && console.log("autoCompleteList =>", name, autoCompleteList);
59
+ }
60
+ }, [autoCompleteList]);
54
61
  useEffect(function () {
55
- if (!api && Object.keys(data).length > 0)
62
+ if (!isDataFromApi && data.length > 0)
56
63
  checkByValue(value, open);
57
- // if (Object.keys(data).length > 0) checkByValue(value, open);
58
- isDev && console.log("useDeepCompareEffect =>", name, "data");
64
+ // if (data.length > 0) checkByValue(value, open);
59
65
  }, [data]);
60
66
  useEffect(function () {
61
- if (Object.keys(data).length > 0) {
67
+ if (data.length > 0) {
62
68
  if (value && value.toString().length > 0) {
63
69
  checkByValue(value, open);
64
70
  }
65
71
  else {
66
- if (!api)
72
+ if (!isDataFromApi)
67
73
  clear(false);
68
74
  }
69
75
  }
@@ -82,13 +88,6 @@ var Component = function (_a, forwardedRef) {
82
88
  window.addEventListener("mousedown", checkHideBackDrop);
83
89
  if (refMain.current)
84
90
  refMain.current.addEventListener("keydown", checkESC);
85
- return function () {
86
- window.removeEventListener("mousedown", checkHideBackDrop);
87
- if (refMain.current)
88
- refMain.current.removeEventListener("keydown", checkESC);
89
- };
90
- }, [data, open]);
91
- useEffect(function () {
92
91
  if (refModal && refModal.current) {
93
92
  if (open) {
94
93
  refModal.current.style.overflow = "visible";
@@ -103,12 +102,17 @@ var Component = function (_a, forwardedRef) {
103
102
  refModal.current.scrollTop = refMain.current.offsetTop + 300;
104
103
  }
105
104
  }
105
+ return function () {
106
+ window.removeEventListener("mousedown", checkHideBackDrop);
107
+ if (refMain.current)
108
+ refMain.current.removeEventListener("keydown", checkESC);
109
+ };
106
110
  }, [open]);
107
111
  var cevirTumuKucuk = function (text) {
108
112
  if (text === void 0) { text = ""; }
109
113
  return text.toString().toLocaleLowerCase("tr-TR");
110
114
  };
111
- var convertForSearch = function (value) {
115
+ var convertForSearch = useCallback(function (value) {
112
116
  var data = cevirTumuKucuk(value);
113
117
  data = data.replace(/ö/g, "o");
114
118
  data = data.replace(/ç/g, "c");
@@ -119,35 +123,31 @@ var Component = function (_a, forwardedRef) {
119
123
  data = data.replace(/[^a-z\d]/g, ""); // %_- are allowed
120
124
  data = data.replace(/^\s+|\s+$/g, "");
121
125
  return data;
122
- };
126
+ }, [cevirTumuKucuk]);
123
127
  var filteredData = useMemo(function () {
124
128
  var _a;
125
129
  var list;
126
130
  if (filter.length > 0) {
127
- list = Object.values(data).filter(function (item) {
128
- return convertForSearch(item[labelKey]).includes(convertForSearch(filter)) || item[labelKey] == filter;
129
- });
131
+ list = data.filter(function (item) { return convertForSearch(item[labelKey]).includes(convertForSearch(filter)) || item[labelKey] == filter; });
130
132
  }
131
133
  else {
132
134
  list = data;
133
135
  }
134
136
  if (newCreate && text.length > 0) {
135
- var filterText = Object.values(data).find(function (item) { return item[labelKey].toString().toLowerCase() === text.toString().toLowerCase(); });
137
+ var filterText = data.find(function (item) { return item[labelKey].toString().toLowerCase() === text.toString().toLowerCase(); });
136
138
  if (!filterText) {
137
- list = __spreadArray([(_a = {}, _a[labelKey] = text, _a[valueKey] = text, _a.create = true, _a)], list, true);
139
+ var newItem = (_a = {}, _a[labelKey] = text, _a[valueKey] = text, _a.create = true, _a);
140
+ list = __spreadArray([newItem], list, true);
141
+ setNewItemCreate(newItem);
142
+ }
143
+ else {
144
+ if (newItemCreate.create)
145
+ setNewItemCreate({ create: false });
138
146
  }
139
147
  }
140
148
  return list;
141
- }, [data, filter]);
142
- var Change = function (e) {
143
- setValue(false, true);
144
- setText(e.target.value);
145
- setFilter(e.target.value);
146
- setOpen(true);
147
- if (onText)
148
- onText(e.target.value);
149
- };
150
- var setValue = function (result, openList) {
149
+ }, [data, filter, newCreate, text, valueKey, labelKey]);
150
+ var setValue = useCallback(function (result, openList) {
151
151
  setOpen(openList);
152
152
  var newValue = result && result[valueKey] ? result[valueKey] : "";
153
153
  if (result) {
@@ -156,41 +156,49 @@ var Component = function (_a, forwardedRef) {
156
156
  }
157
157
  setFilter("");
158
158
  if (onChange && newValue != value) {
159
- isDev && console.log("onChange =>", name, "yeni:" + newValue, "eski:" + value);
160
159
  onChange({
161
160
  target: {
162
161
  name: name,
163
- value: newValue
164
- }
162
+ value: newValue,
163
+ },
165
164
  });
166
165
  }
167
166
  if (onSelect)
168
167
  onSelect(result);
169
- };
170
- var checkByValue = function (value, openList, list) {
168
+ }, [onChange, onSelect, name, value, valueKey, labelKey]);
169
+ var Change = useCallback(function (e) {
170
+ setValue(false, true);
171
+ setText(e.target.value);
172
+ setFilter(e.target.value.trim());
173
+ setOpen(true);
174
+ if (onText)
175
+ onText(e.target.value);
176
+ }, [setValue, onText]);
177
+ var checkByValue = useCallback(function (value, openList, list) {
171
178
  if (openList === void 0) { openList = false; }
172
179
  if (list === void 0) { list = []; }
173
180
  var targetList = list.length > 0 ? list : data;
174
181
  var find = Object.values(targetList).find(function (item) { return cevirTumuKucuk(item[valueKey]) === cevirTumuKucuk(value); });
182
+ if (!find && newCreate && newItemCreate.create) {
183
+ find = newItemCreate;
184
+ }
175
185
  setValue(find, openList);
176
- };
177
- var checkByInput = function () {
178
- isDev && console.log("checkByInput =>", name, refInput.current.value, data);
179
- var findByLabel = Object.values(data).find(function (item) { return cevirTumuKucuk(item[labelKey]) === cevirTumuKucuk(refInput.current.value); });
186
+ }, [data, valueKey, newCreate, newItemCreate, setValue]);
187
+ var checkByInput = useCallback(function () {
188
+ var findByLabel = data.find(function (item) { return cevirTumuKucuk(item[labelKey]) === cevirTumuKucuk(refInput.current.value); });
180
189
  if (findByLabel && value == findByLabel[valueKey]) {
181
190
  setOpen(false);
182
- isDev && console.log("findByLabel - Zaten Aynı =>", name, findByLabel);
183
191
  return;
184
192
  }
185
193
  setValue(findByLabel, false);
186
194
  if (!findByLabel)
187
195
  setText("");
188
- if (api && !findByLabel && Object.keys(data).length === 0) {
196
+ if (isDataFromApi && !findByLabel && data.length === 0) {
189
197
  if (onText)
190
198
  onText("");
191
199
  }
192
- };
193
- var clear = function (openList, focusInput) {
200
+ }, [data, labelKey, value, valueKey, isDataFromApi, onText, setValue]);
201
+ var clear = useCallback(function (openList, focusInput) {
194
202
  var _a;
195
203
  if (openList === void 0) { openList = true; }
196
204
  if (focusInput === void 0) { focusInput = false; }
@@ -201,8 +209,7 @@ var Component = function (_a, forwardedRef) {
201
209
  onText("");
202
210
  if (focusInput)
203
211
  (_a = refInput === null || refInput === void 0 ? void 0 : refInput.current) === null || _a === void 0 ? void 0 : _a.focus();
204
- isDev && console.log("clear");
205
- };
212
+ }, [setValue, onText]);
206
213
  function setScrollPosition() {
207
214
  if (refList.current) {
208
215
  var position = 0;
@@ -304,10 +311,10 @@ var Component = function (_a, forwardedRef) {
304
311
  }
305
312
  setScrollPosition();
306
313
  };
307
- return (_jsxs("div", { ref: refMain, className: styles.component, onKeyDown: onKeyDown, style: style, children: [_jsx(Input, __assign({}, other, { name: name, value: text, inputRef: refInput, componentRef: refComponentInput, onFocus: function () { return setOpen(true); }, onChange: Change, endAdornment: !disabled && (_jsxs("div", { style: { marginRight: 5 }, tabIndex: -1, children: [_jsx(Button, { title: "Temizle", tabIndex: -1, hidden: !(text && text.length > 0), onClick: function () { return clear(true, true); }, onlyIcon: _jsx(Icon, { name: "close", style: { color: "#444" } }) }), endAdornment, _jsx(Button, { tabIndex: -1, hidden: !(Object.keys(data).length > 0), onClick: function () { return setOpen(!open); }, onlyIcon: _jsx(Icon, { name: open ? "keyboard_arrow_up" : "keyboard_arrow_down", style: { color: "#444" } }) })] })), placeholder: loading ? "Lütfen bekleyiniz..." : placeholder, loading: loading, disabled: disabled, propsInput: __assign(__assign({}, other === null || other === void 0 ? void 0 : other.propsInput), { autoComplete: "off" }) })), _jsx("div", { className: styles.listDiv, "data-relative": listPositionRelative, children: _jsxs("ul", { ref: refList, className: "".concat(styles.list, " ").concat(open ? styles.open : ""), children: [(Object.keys(filteredData).length === 0 || loading) && (_jsx("div", { className: "".concat(styles.message, " ").concat(loading ? styles.loading : ""), children: loading ? "Lütfen bekleyiniz..." : "Kayıt bulunamadı..." })), Object.values(filteredData).map(function (item, key) {
314
+ return (_jsxs("div", { ref: refMain, className: styles.searchableInputComponent, onKeyDown: onKeyDown, style: style, children: [_jsx(Input, __assign({}, other, { name: name, value: text, inputRef: refInput, componentRef: refComponentInput, onFocus: function () { return setOpen(true); }, onChange: Change, endAdornment: !disabled && (_jsxs("div", { style: { marginRight: 5 }, tabIndex: -1, children: [_jsx(Button, { title: "Temizle", tabIndex: -1, hidden: !(text && text.length > 0), onClick: function () { return clear(true, true); }, onlyIcon: _jsx(Icon, { name: "close", style: { color: "#444" } }) }), endAdornment, _jsx(Button, { tabIndex: -1, hidden: !(data.length > 0), onClick: function () { return setOpen(!open); }, onlyIcon: _jsx(Icon, { name: open ? "keyboard_arrow_up" : "keyboard_arrow_down", style: { color: "#444" } }) })] })), placeholder: loading ? "Lütfen bekleyiniz..." : placeholder, loading: loading, disabled: disabled, propsInput: __assign(__assign({}, other === null || other === void 0 ? void 0 : other.propsInput), { autoComplete: "off" }) })), _jsx("div", { className: "listDiv", "data-relative": listPositionRelative, children: _jsxs("ul", { ref: refList, className: "list ".concat(open ? "open" : ""), children: [(filteredData.length === 0 || loading) && _jsx("div", { className: "message ".concat(loading ? "loading" : ""), children: loading ? "Lütfen bekleyiniz..." : "Kayıt bulunamadı..." }), filteredData.map(function (item, key) {
308
315
  var itemValue = item[valueKey];
309
316
  var itemLabel = item[labelKey];
310
- return (_jsxs("li", { className: "".concat(styles.listItem, " ").concat(itemValue === value ? styles.active : ""), "data-value": itemValue, "data-label": itemLabel, onClick: function () { return setValue(item, false); }, children: [item.create && _jsx("span", { className: styles.newCreate, children: "Yeni Olu\u015Ftur: " }), itemComponent ? itemComponent(item) : itemLabel] }, key));
317
+ return (_jsxs("li", { className: "item ".concat(itemValue === value ? "active" : ""), "data-value": itemValue, "data-label": itemLabel, onClick: function () { return setValue(item, false); }, children: [item.create && _jsx("span", { className: "newCreate", children: "Yeni Olu\u015Ftur: " }), itemComponent ? itemComponent(item) : itemLabel] }, key));
311
318
  })] }) })] }));
312
319
  };
313
320
  export var SearchableInput = React.forwardRef(Component);
@@ -1,79 +1,80 @@
1
- .component {
1
+ .searchableInputComponent {
2
+ cursor: unset;
2
3
  }
3
- .component input {
4
- padding: 9px 9px 9px 14px;
4
+ .searchableInputComponent input {
5
+ padding: 12px 14px;
5
6
  }
6
7
 
7
- .listDiv {
8
- position: relative;
9
- margin-top: -4px;
10
- z-index: 1000;
8
+ .searchableInputComponent :global(.listDiv) {
9
+ position: relative;
10
+ margin-top: -4px;
11
+ z-index: 1000;
11
12
  }
12
13
 
13
- .listDiv[data-relative="true"] {
14
- z-index: 1 !important;
14
+ .searchableInputComponent :global(.listDiv[data-relative="true"]) {
15
+ z-index: 1 !important;
15
16
  }
16
- .listDiv[data-relative="true"] > ul {
17
- position: relative !important;
17
+ .searchableInputComponent :global(.listDiv[data-relative="true"]) > ul {
18
+ position: relative !important;
18
19
  }
19
20
 
20
- .list {
21
- position: absolute;
22
- top: 3px;
23
- left: 1%;
24
- width: 98%;
25
- height: 0;
26
- overflow: hidden;
27
- background: transparent;
28
- margin: 0;
29
- padding: 0;
30
- list-style: none;
21
+ .searchableInputComponent :global(.list) {
22
+ position: absolute;
23
+ top: 3px;
24
+ left: 1%;
25
+ width: 98%;
26
+ height: 0;
27
+ overflow: hidden;
28
+ background: transparent;
29
+ margin: 0;
30
+ padding: 0;
31
+ list-style: none;
31
32
  }
32
33
 
33
- .list.open {
34
- height: auto;
35
- max-height: 300px;
36
- overflow-x: hidden;
37
- overflow-y: visible;
38
- padding: 5px 0;
39
- border: 1px #ced4da solid;
40
- background: #fff;
34
+ .searchableInputComponent :global(.list.open) {
35
+ height: auto;
36
+ max-height: 300px;
37
+ overflow-x: hidden;
38
+ overflow-y: visible;
39
+ padding: 5px 0;
40
+ border: 1px #ced4da solid;
41
+ background: #fff;
41
42
  }
42
43
 
43
- .listItem {
44
- cursor: pointer;
45
- display: block;
46
- padding: 8px 10px;
47
- text-overflow: ellipsis;
48
- overflow: hidden;
49
- white-space: nowrap;
44
+ .searchableInputComponent :global(.list li) {
45
+ cursor: pointer;
46
+ display: block;
47
+ padding: 8px 10px;
48
+ text-overflow: ellipsis;
49
+ overflow: hidden;
50
+ white-space: nowrap;
50
51
  }
51
52
 
52
- .listItem:hover,
53
- .listItem.selected {
54
- background: #d9e0e3;
53
+ .searchableInputComponent :global(.list li:hover),
54
+ .searchableInputComponent :global(.list li.selected) {
55
+ background: #d9e0e3;
55
56
  }
56
57
 
57
- .listItem.active {
58
- background: #cbe2ef;
59
- font-weight: 500;
58
+ .searchableInputComponent :global(.list li.active) {
59
+ background: #cbe2ef;
60
+ font-weight: 500;
60
61
  }
61
62
 
62
- .newCreate {
63
- margin-right: 5px;
64
- font-style: italic;
63
+ .searchableInputComponent :global(.newCreate) {
64
+ margin-right: 5px;
65
+ font-style: italic;
65
66
  }
66
67
 
67
- .message {
68
- text-overflow: ellipsis;
69
- overflow: hidden;
70
- white-space: nowrap;
71
- display: block;
72
- padding: 15px 10px;
73
- cursor: default;
68
+ .searchableInputComponent :global(.message) {
69
+ text-overflow: ellipsis;
70
+ overflow: hidden;
71
+ white-space: nowrap;
72
+ display: block;
73
+ padding: 15px 10px;
74
+ cursor: default;
74
75
  }
75
- .loading {
76
- padding: 5px 10px;
77
- background-color: #ced4da38;
78
- text-align: center;
76
+ .searchableInputComponent :global(.loading) {
77
+ padding: 5px 10px;
78
+ background-color: #ced4da38;
79
+ text-align: center;
79
80
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sydsoft/base",
3
3
  "private": false,
4
- "version": "1.32.0",
4
+ "version": "1.34.0",
5
5
  "description": "",
6
6
  "main": "./dist/cjs/index.js",
7
7
  "module": "./dist/esm/index.js",