@sellmate/design-system 0.0.53 → 0.0.54
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/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{sd-button_21.cjs.entry.js → sd-button_23.cjs.entry.js} +591 -80
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +266 -0
- package/dist/cjs/sd-tbody_3.cjs.entry.js +3 -3
- package/dist/cjs/sd-td.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sd-number-input/sd-number-input.css +128 -0
- package/dist/collection/components/sd-number-input/sd-number-input.js +744 -0
- package/dist/collection/components/sd-number-input/sd-number-input.js.map +1 -0
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +2 -2
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.css +5 -0
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js +91 -42
- package/dist/collection/components/sd-select-multiple-group/sd-select-multiple-group.js.map +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +1 -1
- package/dist/collection/components/sd-table/sd-td/sd-td.js +2 -2
- package/dist/collection/components/sd-table/sd-th/sd-th.js +1 -1
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +4 -4
- package/dist/collection/components/sd-tooltip-portal/sd-tooltip-portal.js +1 -1
- package/dist/components/{p-CYadUxId.js → p-BBNolp5g.js} +3 -3
- package/dist/components/{p-CYadUxId.js.map → p-BBNolp5g.js.map} +1 -1
- package/dist/components/{p-71Aop19u.js → p-BH3t01Im.js} +5 -5
- package/dist/components/{p-71Aop19u.js.map → p-BH3t01Im.js.map} +1 -1
- package/dist/components/{p-Be8w5kOo.js → p-BqxmCDlz.js} +7 -7
- package/dist/components/{p-Be8w5kOo.js.map → p-BqxmCDlz.js.map} +1 -1
- package/dist/components/{p-B13lOU0D.js → p-C5T02a4h.js} +4 -4
- package/dist/components/{p-B13lOU0D.js.map → p-C5T02a4h.js.map} +1 -1
- package/dist/components/{p-Cf-LyLYk.js → p-CEDtmtIo.js} +3 -3
- package/dist/components/{p-Cf-LyLYk.js.map → p-CEDtmtIo.js.map} +1 -1
- package/dist/components/{p-DP33nj_I.js → p-Cx3euWvk.js} +3 -3
- package/dist/components/{p-DP33nj_I.js.map → p-Cx3euWvk.js.map} +1 -1
- package/dist/components/{p-ChQIkICO.js → p-DdeknsBE.js} +3 -3
- package/dist/components/{p-ChQIkICO.js.map → p-DdeknsBE.js.map} +1 -1
- package/dist/components/{p-j-ZEdgz4.js → p-GHGGjwP3.js} +3 -3
- package/dist/components/{p-j-ZEdgz4.js.map → p-GHGGjwP3.js.map} +1 -1
- package/dist/components/{p-B4wWf5r8.js → p-XAhTfI7Q.js} +4 -4
- package/dist/components/{p-B4wWf5r8.js.map → p-XAhTfI7Q.js.map} +1 -1
- package/dist/components/{p-CVtij2QI.js → p-at_j60O8.js} +3 -3
- package/dist/components/{p-CVtij2QI.js.map → p-at_j60O8.js.map} +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-number-input.d.ts +11 -0
- package/dist/components/sd-number-input.js +335 -0
- package/dist/components/sd-number-input.js.map +1 -0
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +3 -3
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +2 -2
- package/dist/components/sd-select-multiple-group.js +74 -45
- package/dist/components/sd-select-multiple-group.js.map +1 -1
- package/dist/components/sd-select-multiple.js +4 -4
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table-backup.js +6 -6
- package/dist/components/sd-table.js +9 -9
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +2 -2
- package/dist/components/sd-th.js +1 -1
- package/dist/components/sd-toggle-button.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip-portal.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-26266f8c.entry.js +2 -0
- package/dist/design-system/p-2df41cc3.entry.js +2 -0
- package/dist/design-system/p-2df41cc3.entry.js.map +1 -0
- package/dist/design-system/p-3cc7957d.entry.js +2 -0
- package/dist/design-system/p-a18c202d.entry.js +2 -0
- package/dist/design-system/{p-0cbdb34f.entry.js → p-b0668ce9.entry.js} +2 -2
- package/dist/design-system/{p-d02b3369.entry.js → p-f9e04bf9.entry.js} +2 -2
- package/dist/design-system/p-f9e04bf9.entry.js.map +1 -0
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{sd-button_21.entry.js → sd-button_23.entry.js} +589 -80
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-multiple.entry.js +264 -0
- package/dist/esm/sd-select-multiple.entry.js.map +1 -0
- package/dist/esm/sd-tbody_3.entry.js +3 -3
- package/dist/esm/sd-td.entry.js +2 -2
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +58 -0
- package/dist/types/components/sd-select-multiple-group/sd-select-multiple-group.d.ts +2 -0
- package/dist/types/components.d.ts +145 -0
- package/hydrate/index.js +407 -68
- package/hydrate/index.mjs +407 -68
- package/package.json +1 -1
- package/dist/cjs/sd-select-multiple-group.cjs.entry.js +0 -406
- package/dist/cjs/sd-select-option-group.cjs.entry.js +0 -69
- package/dist/design-system/p-1e7a06ef.entry.js +0 -2
- package/dist/design-system/p-761882f5.entry.js +0 -2
- package/dist/design-system/p-790ae9ce.entry.js +0 -2
- package/dist/design-system/p-790ae9ce.entry.js.map +0 -1
- package/dist/design-system/p-a8e8fc17.entry.js +0 -2
- package/dist/design-system/p-d02b3369.entry.js.map +0 -1
- package/dist/design-system/p-e492d625.entry.js +0 -2
- package/dist/design-system/p-e492d625.entry.js.map +0 -1
- package/dist/esm/sd-select-multiple-group.entry.js +0 -404
- package/dist/esm/sd-select-multiple-group.entry.js.map +0 -1
- package/dist/esm/sd-select-option-group.entry.js +0 -67
- package/dist/esm/sd-select-option-group.entry.js.map +0 -1
- /package/dist/design-system/{p-1e7a06ef.entry.js.map → p-26266f8c.entry.js.map} +0 -0
- /package/dist/design-system/{p-761882f5.entry.js.map → p-3cc7957d.entry.js.map} +0 -0
- /package/dist/design-system/{p-a8e8fc17.entry.js.map → p-a18c202d.entry.js.map} +0 -0
- /package/dist/design-system/{p-0cbdb34f.entry.js.map → p-b0668ce9.entry.js.map} +0 -0
|
@@ -2483,6 +2483,285 @@ const SdLoadingSpinner = class {
|
|
|
2483
2483
|
};
|
|
2484
2484
|
SdLoadingSpinner.style = sdLoadingSpinnerCss();
|
|
2485
2485
|
|
|
2486
|
+
const sdNumberInputCss = () => `sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}.sd-number-input{box-sizing:border-box;display:flex;width:var(--input-width, 100%);align-items:center;height:28px;padding:4px 8px;border:1px solid #aaaaaa;border-radius:4px;color:#333333;font-size:12px;line-height:20px;background:white;position:relative}.sd-number-input--hovered{border-color:#0075ff;box-shadow:0 0 4px 0 rgba(0, 113, 255, 0.4)}.sd-number-input.sd-number-input--error{border-color:#fb4444}.sd-number-input.sd-number-input--pass{border-color:#2bce6c}.sd-number-input.sd-number-input--disabled{background-color:#eeeeee !important;border-color:#cccccc !important;cursor:not-allowed !important;box-shadow:none !important}.sd-number-input.sd-number-input--disabled .sd-number-input__input{color:#888888 !important}.sd-number-input .sd-number-input__input{display:block;width:100%;height:20px;line-height:20px;border:none;outline:none;background:transparent;font-size:inherit;color:#333333;margin-left:4px;margin-right:4px;padding-block:0;padding-inline:0;text-align:right}.sd-number-input .sd-number-input__input::placeholder{font-size:12px;height:20px;line-height:20px;color:#aaaaaa}.sd-number-input .sd-number-input__clear-icon{cursor:pointer;margin-left:8px}.sd-number-input .sd-number-input__buttons{padding:4px;display:flex;justify-content:space-between;align-items:center;position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity 0.2s ease}.sd-number-input .sd-number-input__button{width:20px;height:20px;border:none;border-radius:2px;background-color:#eff6ff;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.2s ease}.sd-number-input .sd-number-input__button:hover:not(:disabled){background-color:#e6f1ff}.sd-number-input .sd-number-input__button:disabled{background-color:#eeeeee;cursor:not-allowed}.sd-number-input .sd-number-input__button--decrement{border-bottom-left-radius:0;border-bottom-right-radius:0}.sd-number-input .sd-number-input__button--increment{border-top-left-radius:0;border-top-right-radius:0}.sd-number-input .sd-number-input__label{margin-bottom:8px;font-weight:500;color:#333333}sd-number-input:focus-within .sd-number-input__buttons{opacity:1;pointer-events:auto}sd-number-input:focus-within .sd-number-input{border-color:#0075ff;box-shadow:0 0 4px 0 rgba(0, 113, 255, 0.4)}`;
|
|
2487
|
+
|
|
2488
|
+
const SdNumberInput = class {
|
|
2489
|
+
constructor(hostRef) {
|
|
2490
|
+
index.registerInstance(this, hostRef);
|
|
2491
|
+
this.sdIncrement = index.createEvent(this, "sdIncrement");
|
|
2492
|
+
this.sdDecrement = index.createEvent(this, "sdDecrement");
|
|
2493
|
+
this.sdInput = index.createEvent(this, "sdInput");
|
|
2494
|
+
this.sdChange = index.createEvent(this, "sdChange");
|
|
2495
|
+
this.sdFocus = index.createEvent(this, "sdFocus");
|
|
2496
|
+
this.sdBlur = index.createEvent(this, "sdBlur");
|
|
2497
|
+
}
|
|
2498
|
+
get el() { return index.getElement(this); }
|
|
2499
|
+
min = Number.NEGATIVE_INFINITY;
|
|
2500
|
+
max = Number.POSITIVE_INFINITY;
|
|
2501
|
+
step = 1;
|
|
2502
|
+
useButton = false;
|
|
2503
|
+
useDecimal = false;
|
|
2504
|
+
value = null;
|
|
2505
|
+
label;
|
|
2506
|
+
placeholder = '입력해 주세요.';
|
|
2507
|
+
disabled = false;
|
|
2508
|
+
width;
|
|
2509
|
+
rules;
|
|
2510
|
+
autoFocus = false;
|
|
2511
|
+
status;
|
|
2512
|
+
inputClass = '';
|
|
2513
|
+
readonly = false;
|
|
2514
|
+
inputStyle = {};
|
|
2515
|
+
internalValue = null;
|
|
2516
|
+
displayValue = '';
|
|
2517
|
+
hovered = false;
|
|
2518
|
+
error = false;
|
|
2519
|
+
nativeEl = undefined;
|
|
2520
|
+
sdIncrement;
|
|
2521
|
+
sdDecrement;
|
|
2522
|
+
sdInput;
|
|
2523
|
+
sdChange;
|
|
2524
|
+
sdFocus;
|
|
2525
|
+
sdBlur;
|
|
2526
|
+
formatWithCommas(value) {
|
|
2527
|
+
if (value === null || value === undefined)
|
|
2528
|
+
return '';
|
|
2529
|
+
const isNegative = value < 0;
|
|
2530
|
+
const absValue = Math.abs(value);
|
|
2531
|
+
const [intPart, decPart] = absValue.toString().split('.');
|
|
2532
|
+
const formatted = (+intPart).toLocaleString();
|
|
2533
|
+
const result = isNegative ? '-' + formatted : formatted;
|
|
2534
|
+
return decPart ? result + '.' + decPart : String(result);
|
|
2535
|
+
}
|
|
2536
|
+
parseInput(input) {
|
|
2537
|
+
if (!input || input.trim() === '')
|
|
2538
|
+
return null;
|
|
2539
|
+
const cleaned = input.replace(/,/g, '').trim();
|
|
2540
|
+
// -로 시작을 할 수 있을 수 있고, 소수점 0.n | .n
|
|
2541
|
+
if (!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(cleaned)) {
|
|
2542
|
+
return null;
|
|
2543
|
+
}
|
|
2544
|
+
const parsed = parseFloat(cleaned);
|
|
2545
|
+
if (isNaN(parsed))
|
|
2546
|
+
return null;
|
|
2547
|
+
// 소수점 사용 하지 않는데 . 이 있는 경우
|
|
2548
|
+
if (!this.useDecimal && cleaned.includes('.')) {
|
|
2549
|
+
return null;
|
|
2550
|
+
}
|
|
2551
|
+
return parsed;
|
|
2552
|
+
}
|
|
2553
|
+
clampMinMax(value) {
|
|
2554
|
+
return Math.min(Math.max(value, this.min), this.max);
|
|
2555
|
+
}
|
|
2556
|
+
updateDisplay() {
|
|
2557
|
+
this.displayValue = this.formatWithCommas(this.internalValue);
|
|
2558
|
+
}
|
|
2559
|
+
isIncrementDisabled() {
|
|
2560
|
+
if (this.disabled || this.readonly)
|
|
2561
|
+
return true;
|
|
2562
|
+
if (this.internalValue !== null) {
|
|
2563
|
+
return this.internalValue >= this.max;
|
|
2564
|
+
}
|
|
2565
|
+
return false;
|
|
2566
|
+
}
|
|
2567
|
+
isDecrementDisabled() {
|
|
2568
|
+
if (this.disabled || this.readonly)
|
|
2569
|
+
return true;
|
|
2570
|
+
if (this.internalValue !== null) {
|
|
2571
|
+
return this.internalValue <= this.min;
|
|
2572
|
+
}
|
|
2573
|
+
return false;
|
|
2574
|
+
}
|
|
2575
|
+
valueChanged(newValue) {
|
|
2576
|
+
if (newValue === null || newValue === '') {
|
|
2577
|
+
this.internalValue = null;
|
|
2578
|
+
}
|
|
2579
|
+
else {
|
|
2580
|
+
const parsed = typeof newValue === 'string' ? this.parseInput(newValue) : newValue;
|
|
2581
|
+
if (parsed !== null) {
|
|
2582
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
this.updateDisplay();
|
|
2586
|
+
}
|
|
2587
|
+
internalValueChanged(newValue) {
|
|
2588
|
+
this.updateDisplay();
|
|
2589
|
+
if (newValue !== this.value) {
|
|
2590
|
+
this.value = newValue;
|
|
2591
|
+
this.sdInput?.emit(newValue);
|
|
2592
|
+
}
|
|
2593
|
+
if (!this.rules || this.rules.length === 0)
|
|
2594
|
+
return;
|
|
2595
|
+
this.error = false;
|
|
2596
|
+
for (const rule of this.rules) {
|
|
2597
|
+
const result = rule(newValue);
|
|
2598
|
+
if (result !== true) {
|
|
2599
|
+
this.error = true;
|
|
2600
|
+
break;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
componentWillLoad() {
|
|
2605
|
+
if (this.value !== null && this.value !== undefined) {
|
|
2606
|
+
const parsed = typeof this.value === 'string' ? this.parseInput(this.value) : this.value;
|
|
2607
|
+
if (parsed !== null) {
|
|
2608
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
this.updateDisplay();
|
|
2612
|
+
}
|
|
2613
|
+
handleInput = (event) => {
|
|
2614
|
+
const target = event.target;
|
|
2615
|
+
const inputValue = target.value;
|
|
2616
|
+
if (inputValue === '') {
|
|
2617
|
+
this.internalValue = null;
|
|
2618
|
+
this.displayValue = '';
|
|
2619
|
+
return;
|
|
2620
|
+
}
|
|
2621
|
+
const commasRemoved = inputValue.replace(/,/g, '');
|
|
2622
|
+
// 만약에 소수점 (.) 이 여러개 일 경우
|
|
2623
|
+
const decimalCount = (commasRemoved.match(/\./g) || []).length;
|
|
2624
|
+
if (decimalCount > 1) {
|
|
2625
|
+
target.value = this.displayValue;
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
// 가능: "-", ".", "-." (단순 기호만 있는 경우)
|
|
2629
|
+
if (commasRemoved === '-' || commasRemoved === '.' || commasRemoved === '-.') {
|
|
2630
|
+
target.value = commasRemoved;
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
// 숫자 뒤에 . 이 있는 경우 (예: "1000.") -> 콤마 포맷 적용 + . 유지
|
|
2634
|
+
if (commasRemoved.endsWith('.') && decimalCount === 1) {
|
|
2635
|
+
const numberPart = commasRemoved.slice(0, -1);
|
|
2636
|
+
const parsed = this.parseInput(numberPart);
|
|
2637
|
+
if (parsed !== null) {
|
|
2638
|
+
const formatted = this.formatWithCommas(parsed);
|
|
2639
|
+
target.value = formatted + '.';
|
|
2640
|
+
return;
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
const parsed = this.parseInput(commasRemoved);
|
|
2644
|
+
if (parsed !== null) {
|
|
2645
|
+
if (parsed < this.min) {
|
|
2646
|
+
target.value = this.displayValue;
|
|
2647
|
+
return;
|
|
2648
|
+
}
|
|
2649
|
+
if (parsed > this.max) {
|
|
2650
|
+
target.value = this.displayValue;
|
|
2651
|
+
return;
|
|
2652
|
+
}
|
|
2653
|
+
this.internalValue = parsed;
|
|
2654
|
+
this.displayValue = this.formatWithCommas(parsed);
|
|
2655
|
+
target.value = this.displayValue;
|
|
2656
|
+
}
|
|
2657
|
+
else {
|
|
2658
|
+
target.value = this.displayValue;
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
handleChange = (event) => {
|
|
2662
|
+
const target = event.target;
|
|
2663
|
+
const inputValue = target.value;
|
|
2664
|
+
if (inputValue === '') {
|
|
2665
|
+
this.internalValue = null;
|
|
2666
|
+
}
|
|
2667
|
+
else {
|
|
2668
|
+
const parsed = this.parseInput(inputValue);
|
|
2669
|
+
if (parsed !== null) {
|
|
2670
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
this.sdChange?.emit(this.internalValue);
|
|
2674
|
+
};
|
|
2675
|
+
handleFocus = (event) => {
|
|
2676
|
+
this.sdFocus?.emit(event);
|
|
2677
|
+
};
|
|
2678
|
+
handleBlur = (event) => {
|
|
2679
|
+
this.updateDisplay();
|
|
2680
|
+
if (this.nativeEl) {
|
|
2681
|
+
this.nativeEl.value = this.displayValue;
|
|
2682
|
+
}
|
|
2683
|
+
this.sdBlur?.emit(event);
|
|
2684
|
+
};
|
|
2685
|
+
handleKeyDown = (event) => {
|
|
2686
|
+
if (event.key === 'ArrowUp') {
|
|
2687
|
+
event.preventDefault();
|
|
2688
|
+
this.handleIncrement();
|
|
2689
|
+
}
|
|
2690
|
+
else if (event.key === 'ArrowDown') {
|
|
2691
|
+
event.preventDefault();
|
|
2692
|
+
this.handleDecrement();
|
|
2693
|
+
}
|
|
2694
|
+
};
|
|
2695
|
+
handleIncrement = () => {
|
|
2696
|
+
if (this.isIncrementDisabled())
|
|
2697
|
+
return;
|
|
2698
|
+
const currentVal = this.internalValue ?? (this.min ?? 0);
|
|
2699
|
+
let nextVal = currentVal + this.step;
|
|
2700
|
+
if (nextVal > this.max) {
|
|
2701
|
+
nextVal = this.max;
|
|
2702
|
+
}
|
|
2703
|
+
if (nextVal === currentVal)
|
|
2704
|
+
return;
|
|
2705
|
+
this.sdIncrement?.emit({ currentVal: nextVal, prevVal: currentVal });
|
|
2706
|
+
this.internalValue = nextVal;
|
|
2707
|
+
this.sdChange?.emit(nextVal);
|
|
2708
|
+
};
|
|
2709
|
+
handleDecrement = () => {
|
|
2710
|
+
if (this.isDecrementDisabled())
|
|
2711
|
+
return;
|
|
2712
|
+
const currentVal = this.internalValue ?? (this.min ?? 0);
|
|
2713
|
+
let nextVal = currentVal - this.step;
|
|
2714
|
+
if (nextVal < this.min) {
|
|
2715
|
+
nextVal = this.min;
|
|
2716
|
+
}
|
|
2717
|
+
if (nextVal === currentVal)
|
|
2718
|
+
return;
|
|
2719
|
+
this.sdDecrement?.emit({ currentVal: nextVal, prevVal: currentVal });
|
|
2720
|
+
this.internalValue = nextVal;
|
|
2721
|
+
this.sdChange?.emit(nextVal);
|
|
2722
|
+
};
|
|
2723
|
+
async getNativeElement() {
|
|
2724
|
+
return this.nativeEl || null;
|
|
2725
|
+
}
|
|
2726
|
+
getInputStatus() {
|
|
2727
|
+
if (this.disabled)
|
|
2728
|
+
return 'sd-number-input--disabled';
|
|
2729
|
+
if (this.hovered)
|
|
2730
|
+
return 'sd-number-input--hovered';
|
|
2731
|
+
if (this.status)
|
|
2732
|
+
return `sd-number-input--${this.status}`;
|
|
2733
|
+
if (this.error)
|
|
2734
|
+
return 'sd-number-input--error';
|
|
2735
|
+
return '';
|
|
2736
|
+
}
|
|
2737
|
+
render() {
|
|
2738
|
+
const inputWidth = this.width
|
|
2739
|
+
? {
|
|
2740
|
+
'--input-width': typeof this.width === 'number' ? `${this.width}px` : this.width,
|
|
2741
|
+
}
|
|
2742
|
+
: {};
|
|
2743
|
+
const inputStyles = {
|
|
2744
|
+
textAlign: this.useButton ? 'center' : 'right',
|
|
2745
|
+
};
|
|
2746
|
+
return (index.h(index.Host, { key: '353b3f99bf5933d6f445a78c9cecd93fcbdd3a9c', style: inputWidth, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.useButton ? 'use buttons' : 'dont use buttons', this.label && index.h("div", { key: '95d9687fa5634fb53f6a2120d2125cf92e12ccdd', class: "sd-number-input__label" }, this.label), index.h("label", { key: '05ba4deb72261325788b25842c27d7a177fda58a', class: {
|
|
2747
|
+
'sd-number-input': true,
|
|
2748
|
+
[this.getInputStatus()]: true,
|
|
2749
|
+
'sd-number-input--with-buttons': this.useButton,
|
|
2750
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, index.h("input", { key: 'e4c415d40c20f5e915765f4f7d68cd123517acc1', ref: el => (this.nativeEl = el), class: `sd-number-input__input ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onChange: this.handleChange, onKeyDown: this.handleKeyDown, style: inputStyles }), this.useButton && (index.h("div", { key: '1b960a710170212032a8cd7c1c6ad002a3275d69', class: "sd-number-input__buttons" }, index.h("button", { key: 'c9a80bbdf96e4e191c2d43f581eba9c77f465464', type: "button", class: {
|
|
2751
|
+
'sd-number-input__button': true,
|
|
2752
|
+
'sd-number-input__button--decrement': true,
|
|
2753
|
+
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, index.h("sd-icon", { key: 'c4791c052f390013e7dfdf78ef42d987e9609da1', name: "minus", size: 12, color: this.isDecrementDisabled() ? '#CCCCCC' : '#2D8DFF' })), index.h("button", { key: '769fb6ebcde814f1f8667eaadd35f97139869bf3', type: "button", class: {
|
|
2754
|
+
'sd-number-input__button': true,
|
|
2755
|
+
'sd-number-input__button--increment': true,
|
|
2756
|
+
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, index.h("sd-icon", { key: '6a4d263152daaf8f4a565f6659f6bfa6c0acc814', name: "add", size: 12, color: this.isIncrementDisabled() ? '#CCCCCC' : '#2D8DFF' })))))));
|
|
2757
|
+
}
|
|
2758
|
+
static get watchers() { return {
|
|
2759
|
+
"value": ["valueChanged"],
|
|
2760
|
+
"internalValue": ["internalValueChanged"]
|
|
2761
|
+
}; }
|
|
2762
|
+
};
|
|
2763
|
+
SdNumberInput.style = sdNumberInputCss();
|
|
2764
|
+
|
|
2486
2765
|
const sdPaginationCss = () => `.sd-pagination{display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;gap:8px;color:#555555;width:100%;font-size:12px}.sd-pagination .prepend-btns{display:flex;flex-flow:row nowrap;align-items:center;gap:8px;width:60px}.sd-pagination .prepend-btns button{width:26px;height:26px;border:0;background:none}.sd-pagination .prepend-btns button:hover{border:1px solid #006ac1;border-radius:14px}.sd-pagination .append-btns{display:flex;flex-flow:row nowrap;align-items:center;gap:8px;width:60px}.sd-pagination .append-btns button{width:26px;height:26px;border:0;background:none}.sd-pagination .append-btns button:hover{border:1px solid #006ac1;border-radius:14px}.sd-pagination .pagination-btn{display:flex;align-items:center;justify-content:center;border-radius:14px;outline:none;border:none;cursor:pointer;height:26px;color:#555555;width:var(--pagination-btn-width, 26px)}.sd-pagination .pagination-btn--selected{background-color:#006ac1;color:white}.sd-pagination .pagination-btn:hover{border:1px solid #006ac1}.sd-pagination--simple .pagination-info{line-height:26px;display:flex;flex-flow:row nowrap;align-items:center;gap:8px}.sd-pagination--simple .pagination-info .current-page,.sd-pagination--simple .pagination-info .last-page{padding:0 2px}`;
|
|
2487
2766
|
|
|
2488
2767
|
const BUTTON_WIDTH = {
|
|
@@ -2557,12 +2836,12 @@ const SdPagination = class {
|
|
|
2557
2836
|
}
|
|
2558
2837
|
}
|
|
2559
2838
|
render() {
|
|
2560
|
-
return (index.h("div", { key: '
|
|
2839
|
+
return (index.h("div", { key: 'b027af83594c0408615d4c34b861c5c31112f298', class: this.paginationClasses }, index.h("div", { key: '959c79e58c7745606d719c66e8090ef23f7db554', class: "prepend-btns" }, this.renderPrevButtons()), this.simple ? (index.h("div", { class: "pagination-info" }, index.h("span", { class: "current-page" }, this.currentPage), index.h("span", null, "/"), index.h("span", { class: "last-page" }, this.lastPage))) : (this.pageNumbers.map(n => (index.h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
2561
2840
|
'pagination-btn': true,
|
|
2562
2841
|
'pagination-btn--selected': this.currentPage === n,
|
|
2563
2842
|
}, disabled: this.currentPage === n, style: {
|
|
2564
2843
|
'--pagination-btn-width': `${this.buttonWidth}px`,
|
|
2565
|
-
}, onClick: () => this.handlePageChange(n) }, n)))), index.h("div", { key: '
|
|
2844
|
+
}, onClick: () => this.handlePageChange(n) }, n)))), index.h("div", { key: '64f13226aa9249395ac7aa7d11ea5cc946f5477a', class: "append-btns" }, this.renderNextButtons())));
|
|
2566
2845
|
}
|
|
2567
2846
|
};
|
|
2568
2847
|
SdPagination.style = sdPaginationCss();
|
|
@@ -2685,7 +2964,7 @@ const SdPortal = class {
|
|
|
2685
2964
|
this.sdClose.emit();
|
|
2686
2965
|
}
|
|
2687
2966
|
render() {
|
|
2688
|
-
return index.h("slot", { key: '
|
|
2967
|
+
return index.h("slot", { key: 'd93a68ecf1a281765225bf204cd479bb4b7bfdbf' });
|
|
2689
2968
|
}
|
|
2690
2969
|
};
|
|
2691
2970
|
|
|
@@ -3005,9 +3284,9 @@ const SdSelect = class extends selectKeyboardNavigation.BaseDropdownEvent {
|
|
|
3005
3284
|
};
|
|
3006
3285
|
SdSelect.style = sdSelectCss();
|
|
3007
3286
|
|
|
3008
|
-
const
|
|
3287
|
+
const sdSelectMultipleGroupCss = () => `.sd-select-multiple-group__dropdown{overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth}.sd-select-multiple-group__dropdown::-webkit-scrollbar{opacity:0;background:#e5e5e5}.sd-select-multiple-group__dropdown::-webkit-scrollbar:horizontal{height:8px}.sd-select-multiple-group__dropdown::-webkit-scrollbar:vertical{width:8px}.sd-select-multiple-group__dropdown::-webkit-scrollbar-thumb{height:80px;background-color:#cccccc;border-radius:4px}.sd-select-multiple-group__dropdown::-webkit-scrollbar-track{background-color:transparent}sd-select-multiple-group{display:inline-block;height:fit-content}sd-select-multiple-group .sd-select-multiple-group{display:flex;flex-wrap:nowrap;width:var(--select-width, 200px);cursor:pointer;user-select:none;border:1px solid #aaaaaa;border-radius:4px;background-color:white;color:#333333}sd-select-multiple-group .sd-select-multiple-group:hover:not(.sd-select-multiple-group--disabled){background:#f6f6f6}sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled{cursor:not-allowed;background-color:#eeeeee;border-color:#cccccc}sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled .sd-select-multiple-group__label{border-right:1px solid #cccccc}sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled .sd-select-multiple-group__trigger{color:#888888}sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled .sd-select-multiple-group__trigger:focus,sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled .sd-select-multiple-group__trigger:focus-visible,sd-select-multiple-group .sd-select-multiple-group.sd-select-multiple-group--disabled .sd-select-multiple-group__trigger:focus-within{outline:none !important}sd-select-multiple-group .sd-select-multiple-group__label{font-size:12px;font-weight:500;color:#333333;padding:4px 12px;border-right:1px solid #cccccc;border-radius:4px 0 0 4px;background-color:#f6f6f6}sd-select-multiple-group .sd-select-multiple-group__container{position:relative;width:100%;display:flex}sd-select-multiple-group .sd-select-multiple-group__container .sd-select-multiple-group__trigger{padding:4px 20px 4px 12px;display:flex;width:100%;align-items:center}sd-select-multiple-group .sd-select-multiple-group__container .sd-select-multiple-group__trigger .sd-select-multiple-group__value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:20px;font-size:12px;font-weight:400}sd-select-multiple-group .sd-select-multiple-group__container .sd-select-multiple-group__trigger .sd-select-multiple-group__clear{margin:0 4px;width:8px;height:8px;background-color:transparent;outline:none;border:none}sd-select-multiple-group .sd-select-multiple-group__container .sd-select-multiple-group__arrow{position:absolute;top:8px;right:8px;width:12px;height:12px;color:#888888;transition:transform 0.3s ease}sd-select-multiple-group .sd-select-multiple-group__container .sd-select-multiple-group__arrow--open{transform:rotate(180deg)}.sd-select-multiple-group__dropdown{width:var(--select-width, 200px);max-height:var(--select-dropdown-height, 260px);padding-bottom:2px;background-color:white;box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.1);border-radius:4px;overflow-y:auto;color:#333333;opacity:0.5;transition:opacity 0.15s ease-in}.sd-select-multiple-group__dropdown--ready{opacity:1}.sd-select-multiple-group__dropdown .sd-select-multiple-group__search-container{position:sticky;top:0;display:flex;width:100%;background-color:white;align-items:center;padding:4px 8px}.sd-select-multiple-group__dropdown .sd-select-multiple-group__search-container sd-input{width:100%}.sd-select-multiple-group__dropdown .sd-select-multiple-group__search-container--scrolled{box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}.sd-select-multiple-group__dropdown .sd-select-multiple-group__option-placeholder{padding:4px 12px;font-size:12px;line-height:20px}`;
|
|
3009
3288
|
|
|
3010
|
-
const
|
|
3289
|
+
const SdSelectMultipleGroup = class extends selectKeyboardNavigation.BaseDropdownEvent {
|
|
3011
3290
|
constructor(hostRef) {
|
|
3012
3291
|
super();
|
|
3013
3292
|
index.registerInstance(this, hostRef);
|
|
@@ -3027,6 +3306,15 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3027
3306
|
clearable = false;
|
|
3028
3307
|
searchable = false;
|
|
3029
3308
|
useCheckbox = false;
|
|
3309
|
+
useAll = false;
|
|
3310
|
+
allCheckedLabel = '전체';
|
|
3311
|
+
allCheckOptionLabel = '전체';
|
|
3312
|
+
// props - custom styles
|
|
3313
|
+
containerStyle = {};
|
|
3314
|
+
triggerStyle = {};
|
|
3315
|
+
dropdownStyle = {};
|
|
3316
|
+
optionStyle = {};
|
|
3317
|
+
labelStyle = {};
|
|
3030
3318
|
// props - custom slots
|
|
3031
3319
|
optionRenderer;
|
|
3032
3320
|
// states
|
|
@@ -3035,6 +3323,7 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3035
3323
|
searchText = null;
|
|
3036
3324
|
itemIndex = -1;
|
|
3037
3325
|
isScrolled = false;
|
|
3326
|
+
isDropdownReady = false;
|
|
3038
3327
|
// events
|
|
3039
3328
|
sdChange;
|
|
3040
3329
|
dropDownShow;
|
|
@@ -3042,9 +3331,6 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3042
3331
|
searchRef;
|
|
3043
3332
|
optionRef;
|
|
3044
3333
|
dropdownRef;
|
|
3045
|
-
async open() {
|
|
3046
|
-
this.isOpen = true;
|
|
3047
|
-
}
|
|
3048
3334
|
valueChanged() {
|
|
3049
3335
|
this.sdChange?.emit(this.value);
|
|
3050
3336
|
}
|
|
@@ -3059,15 +3345,17 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3059
3345
|
if (this.searchable) {
|
|
3060
3346
|
const searchInput = await this.getNativeInputElement();
|
|
3061
3347
|
if (this.itemIndex === -1) {
|
|
3062
|
-
searchInput?.focus();
|
|
3348
|
+
searchInput?.focus({ preventScroll: true });
|
|
3063
3349
|
return;
|
|
3064
3350
|
}
|
|
3065
3351
|
else if (searchInput?.matches(':focus')) {
|
|
3066
3352
|
searchInput?.blur();
|
|
3067
3353
|
}
|
|
3068
3354
|
}
|
|
3069
|
-
const optionElements = Array.from(this.dropdownRef?.querySelectorAll('
|
|
3070
|
-
|
|
3355
|
+
const optionElements = Array.from(this.dropdownRef?.querySelectorAll('sd-select-option-group') || []);
|
|
3356
|
+
// useAll 사용시 "전체" 옵션 포함한 인덱스 사용
|
|
3357
|
+
const actualIndex = this.useAll ? this.itemIndex + 1 : this.itemIndex;
|
|
3358
|
+
const currentItem = optionElements?.[actualIndex];
|
|
3071
3359
|
if (!currentItem || !this.isOpen)
|
|
3072
3360
|
return;
|
|
3073
3361
|
this.optionRef = currentItem;
|
|
@@ -3081,30 +3369,45 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3081
3369
|
async isOpenChanged() {
|
|
3082
3370
|
// Base class의 이벤트 관리 호출 - 다른 select와의 이벤트 충돌 방지
|
|
3083
3371
|
this.onDropdownToggle(this.isOpen);
|
|
3084
|
-
const selectedOption = this.getSelectedOption();
|
|
3085
|
-
if (!selectedOption) {
|
|
3086
|
-
this.itemIndex = -1;
|
|
3087
|
-
}
|
|
3088
|
-
else {
|
|
3089
|
-
this.itemIndex = this.options.indexOf(selectedOption[0]);
|
|
3090
|
-
}
|
|
3091
3372
|
this.dropDownShow?.emit({ isOpen: this.isOpen });
|
|
3092
|
-
|
|
3373
|
+
this.isDropdownReady = false;
|
|
3374
|
+
if (this.isOpen === false) {
|
|
3093
3375
|
return;
|
|
3094
|
-
await new Promise(resolve => setTimeout(resolve, 10));
|
|
3095
|
-
const optionElements = Array.from(this.dropdownRef?.querySelectorAll('.sd-select-multiple__dropdown sd-select-item') || []);
|
|
3096
|
-
const currentItem = optionElements?.[this.itemIndex];
|
|
3097
|
-
// 드롭다운이 열릴 때 검색 입력에 포커스
|
|
3098
|
-
if (this.searchable) {
|
|
3099
|
-
const searchInput = await this.getNativeInputElement();
|
|
3100
|
-
searchInput?.focus();
|
|
3101
3376
|
}
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3377
|
+
// DOM 렌더링을 기다리기 위해 이중 requestAnimationFrame 사용 - (레이아웃/스타일 계산 - 페인트 이후)
|
|
3378
|
+
requestAnimationFrame(() => {
|
|
3379
|
+
requestAnimationFrame(async () => {
|
|
3380
|
+
const selectedOptions = this.getSelectedOption();
|
|
3381
|
+
// 선택된 옵션이 있으면 첫 번째 선택된 항목으로 스크롤
|
|
3382
|
+
if (selectedOptions && selectedOptions.length > 0) {
|
|
3383
|
+
const selectedIndex = this.options.indexOf(selectedOptions[0]);
|
|
3384
|
+
const optionElements = Array.from(this.dropdownRef?.querySelectorAll('sd-select-option-group') || []);
|
|
3385
|
+
// useAll 사용시 "전체" 옵션 포함한 인덱스 사용
|
|
3386
|
+
const actualIndex = this.useAll ? selectedIndex + 1 : selectedIndex;
|
|
3387
|
+
// 선택된 옵션이 화면 가운데에 오도록 index 조정
|
|
3388
|
+
const targetIndex = Math.min(actualIndex + 4, optionElements.length - 1);
|
|
3389
|
+
const currentItem = optionElements?.[targetIndex];
|
|
3390
|
+
if (currentItem) {
|
|
3391
|
+
this.scrollToOption(currentItem);
|
|
3392
|
+
}
|
|
3393
|
+
}
|
|
3394
|
+
this.isDropdownReady = true;
|
|
3395
|
+
if (this.searchable) {
|
|
3396
|
+
const searchInput = await this.getNativeInputElement();
|
|
3397
|
+
if (searchInput) {
|
|
3398
|
+
requestAnimationFrame(() => {
|
|
3399
|
+
searchInput.focus({ preventScroll: true });
|
|
3400
|
+
});
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
});
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3406
|
+
async open() {
|
|
3407
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
3408
|
+
this.isOpen = true;
|
|
3106
3409
|
}
|
|
3107
|
-
|
|
3410
|
+
componentWillLoad() {
|
|
3108
3411
|
// props가 모두 설정된 후에 실행되므로 올바른 options 값을 가져올 수 있음
|
|
3109
3412
|
this.filteredOptions = this.options;
|
|
3110
3413
|
this.initializeEvent(); // global dropdown Manager에 등록 + 이벤트 핸들러 초기화
|
|
@@ -3149,19 +3452,84 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3149
3452
|
this.dropDownShow?.emit({ isOpen: this.isOpen });
|
|
3150
3453
|
}
|
|
3151
3454
|
};
|
|
3455
|
+
handleAllOptionClick = (detail) => {
|
|
3456
|
+
if (detail.isSelected) {
|
|
3457
|
+
// 이미 선택된 옵션인 경우, 선택 해제
|
|
3458
|
+
const filterDisabledOptions = this.filteredOptions.filter(opt => opt.type === 'item' && !opt.disabled);
|
|
3459
|
+
this.value =
|
|
3460
|
+
this.value?.filter(selected => !filterDisabledOptions.some(opt => opt.value === selected.value)) || this.value;
|
|
3461
|
+
}
|
|
3462
|
+
else {
|
|
3463
|
+
// 새로운 옵션 선택
|
|
3464
|
+
const valueSet = new Set([
|
|
3465
|
+
...(this.value || []),
|
|
3466
|
+
...this.filteredOptions.filter(opt => opt.type === 'item' && !opt.disabled),
|
|
3467
|
+
]);
|
|
3468
|
+
this.value = Array.from(valueSet);
|
|
3469
|
+
}
|
|
3470
|
+
};
|
|
3152
3471
|
handleOptionClick = (detail) => {
|
|
3153
3472
|
const { option, event } = detail;
|
|
3154
3473
|
event.stopPropagation();
|
|
3155
|
-
|
|
3474
|
+
if (option.type === 'group')
|
|
3475
|
+
this.handleGroupOptionClick(detail);
|
|
3476
|
+
if (option.type === 'subgroup')
|
|
3477
|
+
this.handleSubGroupOptionClick(detail);
|
|
3478
|
+
if (option.type === 'item')
|
|
3479
|
+
this.handleOptionSelection(option);
|
|
3480
|
+
};
|
|
3481
|
+
handleGroupOptionClick = (detail) => {
|
|
3482
|
+
const { option, isSelected } = detail;
|
|
3483
|
+
const childOptions = this.filteredOptions.filter(opt => opt.parent === option.value && !opt.disabled);
|
|
3484
|
+
childOptions.forEach(subgroup => {
|
|
3485
|
+
this.handleSubGroupOptionClick({
|
|
3486
|
+
option: subgroup,
|
|
3487
|
+
isSelected: isSelected || isSelected === null,
|
|
3488
|
+
});
|
|
3489
|
+
});
|
|
3490
|
+
};
|
|
3491
|
+
handleSubGroupOptionClick = (detail) => {
|
|
3492
|
+
const { option, isSelected } = detail;
|
|
3493
|
+
const childOptions = this.filteredOptions.filter(opt => opt.parent === option.value && !opt.disabled);
|
|
3494
|
+
if (isSelected || isSelected === null) {
|
|
3495
|
+
// 모든 자식 옵션이 선택된 경우, 모두 선택 해제
|
|
3496
|
+
this.value =
|
|
3497
|
+
this.value?.filter(selected => !childOptions.some(child => child.value === selected.value)) ||
|
|
3498
|
+
null;
|
|
3499
|
+
}
|
|
3500
|
+
else {
|
|
3501
|
+
// 일부 또는 전체 자식 옵션이 선택되지 않은 경우, 모두 선택
|
|
3502
|
+
const newSelections = childOptions.filter(child => !this.value?.some(selected => selected.value === child.value));
|
|
3503
|
+
this.value = [...(this.value || []), ...newSelections];
|
|
3504
|
+
}
|
|
3156
3505
|
};
|
|
3157
3506
|
filterOptions() {
|
|
3158
3507
|
if (!this.searchText || this.searchText.trim() === '') {
|
|
3159
3508
|
// 검색어가 없으면 전체 옵션 표시
|
|
3160
3509
|
this.filteredOptions = this.options;
|
|
3510
|
+
return;
|
|
3161
3511
|
}
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3512
|
+
const searchTerm = this.searchText.toLowerCase();
|
|
3513
|
+
const matchedOptions = new Set();
|
|
3514
|
+
// 1. 직접 매칭되는 옵션들 찾기
|
|
3515
|
+
this.options.forEach(option => {
|
|
3516
|
+
if (option.label.toLowerCase().includes(searchTerm)) {
|
|
3517
|
+
matchedOptions.add(option);
|
|
3518
|
+
// 매칭된 옵션의 상위 그룹들도 포함
|
|
3519
|
+
this.addParentGroups(option, matchedOptions);
|
|
3520
|
+
}
|
|
3521
|
+
});
|
|
3522
|
+
// 2. Set을 배열로 변환하고 원본 순서 유지
|
|
3523
|
+
this.filteredOptions = this.options.filter(option => matchedOptions.has(option));
|
|
3524
|
+
}
|
|
3525
|
+
addParentGroups(option, matchedSet) {
|
|
3526
|
+
if (!option.parent)
|
|
3527
|
+
return;
|
|
3528
|
+
const parentOption = this.options.find(opt => opt.value === option.parent);
|
|
3529
|
+
if (parentOption && !matchedSet.has(parentOption)) {
|
|
3530
|
+
matchedSet.add(parentOption);
|
|
3531
|
+
// 재귀적으로 상위 그룹들도 추가
|
|
3532
|
+
this.addParentGroups(parentOption, matchedSet);
|
|
3165
3533
|
}
|
|
3166
3534
|
}
|
|
3167
3535
|
getSelectedOption() {
|
|
@@ -3192,67 +3560,145 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3192
3560
|
this.value = [...(this.value || []), option];
|
|
3193
3561
|
}
|
|
3194
3562
|
};
|
|
3563
|
+
getAllItemsUnderOption(parentOption, includeDisabled = false) {
|
|
3564
|
+
const filterChildrenWithParent = (option) => option.parent === parentOption.value && (includeDisabled || !option.disabled);
|
|
3565
|
+
if (parentOption.type === 'subgroup') {
|
|
3566
|
+
return this.filteredOptions.filter(option => filterChildrenWithParent(option) && option.type === 'item');
|
|
3567
|
+
}
|
|
3568
|
+
const allItems = [];
|
|
3569
|
+
const childOptions = this.filteredOptions.filter(filterChildrenWithParent);
|
|
3570
|
+
const subgroupOptions = childOptions.filter(option => option.type === 'subgroup');
|
|
3571
|
+
subgroupOptions.forEach(subgroup => {
|
|
3572
|
+
const itemsUnderSubgroup = this.filteredOptions.filter(option => option.parent === subgroup.value &&
|
|
3573
|
+
option.type === 'item' &&
|
|
3574
|
+
(includeDisabled ? true : !option.disabled));
|
|
3575
|
+
allItems.push(...itemsUnderSubgroup);
|
|
3576
|
+
});
|
|
3577
|
+
const directItems = childOptions.filter(option => option.type === 'item');
|
|
3578
|
+
allItems.push(...directItems);
|
|
3579
|
+
return allItems;
|
|
3580
|
+
}
|
|
3581
|
+
isAllChildrenSelected(groupOption) {
|
|
3582
|
+
const allItems = this.getAllItemsUnderOption(groupOption);
|
|
3583
|
+
if (allItems.length === 0)
|
|
3584
|
+
return false;
|
|
3585
|
+
const selectedItems = allItems.filter(item => this.value?.some(selected => selected.value === item.value));
|
|
3586
|
+
if (selectedItems.length === allItems.length)
|
|
3587
|
+
return true;
|
|
3588
|
+
if (selectedItems.length > 0)
|
|
3589
|
+
return null;
|
|
3590
|
+
return false;
|
|
3591
|
+
}
|
|
3592
|
+
getChildrenOptions(parentOption) {
|
|
3593
|
+
const allItems = this.getAllItemsUnderOption(parentOption, true);
|
|
3594
|
+
const selectedCount = allItems.filter(item => this.value?.some(val => val.value === item.value)).length;
|
|
3595
|
+
return {
|
|
3596
|
+
selectedCount,
|
|
3597
|
+
totalCount: allItems.length,
|
|
3598
|
+
};
|
|
3599
|
+
}
|
|
3600
|
+
isAllOptionsSelected() {
|
|
3601
|
+
if (!this.value || this.value.length === 0)
|
|
3602
|
+
return false;
|
|
3603
|
+
const selectableItems = this.options.filter(opt => opt.type === 'item' && !opt.disabled);
|
|
3604
|
+
if (selectableItems.length === 0)
|
|
3605
|
+
return false;
|
|
3606
|
+
const selectedValues = new Set(this.value.map(v => v.value));
|
|
3607
|
+
return selectableItems.every(option => selectedValues.has(option.value));
|
|
3608
|
+
}
|
|
3609
|
+
getTriggerLabel() {
|
|
3610
|
+
const selectedOption = this.getSelectedOption();
|
|
3611
|
+
if (!selectedOption)
|
|
3612
|
+
return '선택';
|
|
3613
|
+
if (selectedOption.length === 0)
|
|
3614
|
+
return this.placeholder;
|
|
3615
|
+
const isAllChecked = this.isAllOptionsSelected();
|
|
3616
|
+
return isAllChecked
|
|
3617
|
+
? this.allCheckedLabel
|
|
3618
|
+
: selectedOption.map(option => option.label).join(', ');
|
|
3619
|
+
}
|
|
3195
3620
|
closeDropdown() {
|
|
3196
3621
|
this.isOpen = false;
|
|
3197
3622
|
}
|
|
3198
|
-
scrollToOption(optionElement) {
|
|
3623
|
+
async scrollToOption(optionElement) {
|
|
3199
3624
|
if (!this.dropdownRef || !optionElement)
|
|
3200
3625
|
return;
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3626
|
+
requestAnimationFrame(() => {
|
|
3627
|
+
const dropdown = this.dropdownRef;
|
|
3628
|
+
const optionTop = optionElement.offsetTop;
|
|
3629
|
+
const optionHeight = optionElement.offsetHeight;
|
|
3630
|
+
const dropdownScrollTop = dropdown.scrollTop;
|
|
3631
|
+
const dropdownHeight = dropdown.clientHeight;
|
|
3632
|
+
const searchContainer = dropdown.querySelector('.sd-select-multiple-group__search-container');
|
|
3633
|
+
const searchOffset = searchContainer ? searchContainer.offsetHeight : 0;
|
|
3634
|
+
const visibleContentHeight = dropdownHeight - searchOffset;
|
|
3635
|
+
const visibleTop = dropdownScrollTop + searchOffset;
|
|
3636
|
+
const visibleBottom = dropdownScrollTop + dropdownHeight;
|
|
3637
|
+
if (optionTop < visibleTop) {
|
|
3638
|
+
dropdown.scrollTo({ top: optionTop - searchOffset, behavior: 'instant' });
|
|
3639
|
+
}
|
|
3640
|
+
else if (optionTop + optionHeight > visibleBottom) {
|
|
3641
|
+
dropdown.scrollTo({
|
|
3642
|
+
top: optionTop + optionHeight - visibleContentHeight - searchOffset,
|
|
3643
|
+
behavior: 'instant',
|
|
3644
|
+
});
|
|
3645
|
+
}
|
|
3646
|
+
});
|
|
3216
3647
|
}
|
|
3217
|
-
// render method
|
|
3218
3648
|
render() {
|
|
3219
3649
|
const style = {
|
|
3220
3650
|
'--select-width': this.width || '200px',
|
|
3221
3651
|
'--select-dropdown-height': this.dropdownHeight || '260px',
|
|
3222
3652
|
};
|
|
3223
|
-
return (index.h(index.Host, { key: '
|
|
3224
|
-
'sd-select-multiple': true,
|
|
3225
|
-
'sd-select-multiple--open': this.isOpen,
|
|
3226
|
-
'sd-select-multiple--disabled': this.disabled,
|
|
3227
|
-
}, ref: el => (this.selectRef = el) }, this.renderLabel(this.label), index.h("div", { key: '
|
|
3653
|
+
return (index.h(index.Host, { key: '00e3f75c997fe76087ddfa2d9fef2ddb11a10a3e', style: style }, index.h("div", { key: 'f7e5a9f0d3704e0cfb014c8b7a84e6c93d61d31b', class: {
|
|
3654
|
+
'sd-select-multiple-group': true,
|
|
3655
|
+
'sd-select-multiple-group--open': this.isOpen,
|
|
3656
|
+
'sd-select-multiple-group--disabled': this.disabled,
|
|
3657
|
+
}, style: this.containerStyle, ref: el => (this.selectRef = el) }, this.renderLabel(this.label, this.labelStyle), index.h("div", { key: '5b4d771e6ba76ce56974eeee2f01e6a267f557f5', class: "sd-select-multiple-group__container" }, this.renderTrigger(), this.renderDropdown()))));
|
|
3228
3658
|
}
|
|
3229
|
-
renderLabel(label) {
|
|
3659
|
+
renderLabel(label, labelStyle) {
|
|
3230
3660
|
if (!label)
|
|
3231
3661
|
return null;
|
|
3232
|
-
return index.h("label", { class: "sd-select-
|
|
3662
|
+
return (index.h("label", { class: "sd-select-multiple-group__label", style: labelStyle }, label));
|
|
3233
3663
|
}
|
|
3234
3664
|
renderTrigger() {
|
|
3235
3665
|
const selectedOption = this.getSelectedOption();
|
|
3236
|
-
return (index.h("div", { class: "sd-select-
|
|
3237
|
-
? '선택'
|
|
3238
|
-
: selectedOption.length
|
|
3239
|
-
? selectedOption.map(option => option.label).join(', ')
|
|
3240
|
-
: this.placeholder), this.clearable && selectedOption?.length > 0 && !this.disabled && (index.h("sd-icon", { key: "close-icon", name: "close", size: 10, color: "#888", class: "sd-select-multiple__clear", onClick: event => {
|
|
3666
|
+
return (index.h("div", { class: "sd-select-multiple-group__trigger", tabindex: this.disabled ? -1 : 0, onClick: this.handleTriggerClick, style: this.triggerStyle }, index.h("span", { class: "sd-select-multiple-group__value" }, this.getTriggerLabel()), this.clearable && selectedOption?.length > 0 && !this.disabled && (index.h("sd-icon", { key: "close-icon", name: "close", size: 10, color: "#888", class: "sd-select-multiple-group__clear", onClick: event => {
|
|
3241
3667
|
event.stopPropagation();
|
|
3242
3668
|
this.value = null;
|
|
3243
|
-
} })), index.h("sd-icon", { key: "arrow-icon", name: "arrowDown", color: "#888", class: {
|
|
3669
|
+
} })), index.h("sd-icon", { key: "arrow-icon", name: "arrowDown", color: "#888", class: {
|
|
3670
|
+
'sd-select-multiple-group__arrow': true,
|
|
3671
|
+
'sd-select-multiple-group__arrow--open': this.isOpen,
|
|
3672
|
+
} })));
|
|
3244
3673
|
}
|
|
3245
3674
|
renderDropdown() {
|
|
3675
|
+
const style = {
|
|
3676
|
+
'--select-width': this.width || '200px',
|
|
3677
|
+
'--select-dropdown-height': this.dropdownHeight || '260px',
|
|
3678
|
+
};
|
|
3246
3679
|
if (this.isOpen === false)
|
|
3247
3680
|
return null;
|
|
3248
|
-
return (index.h("sd-portal", { open: this.isOpen, parentRef: this.selectRef, onSdClose: this.closeDropdown }, index.h("div", {
|
|
3249
|
-
'sd-select-
|
|
3250
|
-
'sd-select-
|
|
3681
|
+
return (index.h("sd-portal", { open: this.isOpen, parentRef: this.selectRef, onSdClose: this.closeDropdown }, index.h("div", { style: { width: '0', height: '0', overflow: 'visible' } }, index.h("div", { class: {
|
|
3682
|
+
'sd-select-multiple-group__dropdown': true,
|
|
3683
|
+
'sd-select-multiple-group__dropdown--ready': this.isDropdownReady,
|
|
3684
|
+
}, style: { ...style, ...this.dropdownStyle }, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (index.h("div", { class: {
|
|
3685
|
+
'sd-select-multiple-group__search-container': true,
|
|
3686
|
+
'sd-select-multiple-group__search-container--scrolled': this.isScrolled,
|
|
3251
3687
|
}, onClick: event => event.stopPropagation() }, index.h("sd-input", { ref: el => (this.searchRef = el), value: this.searchText, placeholder: "\uAC80\uC0C9", clearable: true, inputStyle: { 'padding-left': '8px' }, autofocus: true, onSdInput: event => {
|
|
3252
3688
|
this.searchText = String(event?.detail);
|
|
3253
3689
|
}, onSdFocus: () => {
|
|
3254
3690
|
this.itemIndex = -1;
|
|
3255
|
-
}
|
|
3691
|
+
}, onKeyDown: e => {
|
|
3692
|
+
if (e.code === 'Enter')
|
|
3693
|
+
e.stopPropagation();
|
|
3694
|
+
} }, index.h("sd-icon", { name: "search", size: 16, color: "#737373", slot: "prefix" })))), this.filteredOptions.length > 0 ? (index.h(index.Fragment, null, this.useAll && (index.h("sd-select-option-group", { option: { label: this.allCheckOptionLabel, value: '', type: 'all' }, index: 0, isSelected: this.isAllOptionsSelected(), isFocused: this.itemIndex === 0, optionStyle: this.optionStyle, onOptionClick: ({ detail, }) => this.handleAllOptionClick(detail), useCheckbox: this.useCheckbox, useIndicator: false })), this.filteredOptions.map((option, index$1) => (index.h("slot", { name: `option-${option.value}` }, index.h("sd-select-option-group", { option: option, index: index$1, isSelected: option.type === 'item'
|
|
3695
|
+
? this.value?.some(selected => selected.value === option.value)
|
|
3696
|
+
: this.isAllChildrenSelected(option), isFocused: index$1 === this.itemIndex, optionStyle: this.optionStyle, onOptionClick: ({ detail, }) => {
|
|
3697
|
+
if (option.type !== 'item' && !this.useCheckbox) {
|
|
3698
|
+
return;
|
|
3699
|
+
}
|
|
3700
|
+
this.handleOptionClick(detail);
|
|
3701
|
+
}, useCheckbox: this.useCheckbox, ...(option.type !== 'item' && { countInfo: this.getChildrenOptions(option) }) })))))) : (index.h("slot", { name: "option-placeholder" }, index.h("div", { class: 'sd-select-multiple-group__option-placeholder', style: this.optionStyle }, this.optionPlaceholder)))))));
|
|
3256
3702
|
}
|
|
3257
3703
|
static get watchers() { return {
|
|
3258
3704
|
"value": ["valueChanged"],
|
|
@@ -3262,7 +3708,7 @@ const SdSelectMultiple = class extends selectKeyboardNavigation.BaseDropdownEven
|
|
|
3262
3708
|
"isOpen": ["isOpenChanged"]
|
|
3263
3709
|
}; }
|
|
3264
3710
|
};
|
|
3265
|
-
|
|
3711
|
+
SdSelectMultipleGroup.style = sdSelectMultipleGroupCss();
|
|
3266
3712
|
|
|
3267
3713
|
const sdSelectOptionCss = () => `sd-select-option{display:block;height:fit-content;line-height:0}sd-select-option .sd-select__option{display:flex;padding:4px 12px;font-size:12px;line-height:20px;cursor:pointer}sd-select-option .sd-select__option__checkbox-wrapper{display:flex;width:100%;column-gap:8px;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}sd-select-option .sd-select__option--focused{background-color:#e6f1ff}sd-select-option .sd-select__option--selected:not(:hover):not(.sd-select__option--use-checkbox),sd-select-option .sd-select__option--focused:not(:hover):not(.sd-select__option--use-checkbox){color:#0075ff;font-weight:700}sd-select-option .sd-select__option--disabled{color:#aaaaaa;cursor:not-allowed}sd-select-option .sd-select__option:hover:not(.sd-select__option--disabled){background-color:#0075ff;color:white}`;
|
|
3268
3714
|
|
|
@@ -3295,7 +3741,7 @@ const SdSelectOption = class {
|
|
|
3295
3741
|
}
|
|
3296
3742
|
};
|
|
3297
3743
|
render() {
|
|
3298
|
-
return (index.h(index.Host, { key: '
|
|
3744
|
+
return (index.h(index.Host, { key: 'd106374cd96d326e885b65ac94ecf1a397ea2ad9' }, index.h("div", { key: 'e07601d9c735f7950102449342257a7e39d28a42', class: {
|
|
3299
3745
|
'sd-select__option': true,
|
|
3300
3746
|
'sd-select__option--selected': this.isSelected,
|
|
3301
3747
|
'sd-select__option--disabled': !!this.option.disabled,
|
|
@@ -3317,6 +3763,69 @@ const SdSelectOption = class {
|
|
|
3317
3763
|
};
|
|
3318
3764
|
SdSelectOption.style = sdSelectOptionCss();
|
|
3319
3765
|
|
|
3766
|
+
const sdSelectOptionGroupCss = () => `sd-select-option-group{display:block;height:fit-content}sd-select-option-group .sd-select__option-group{display:flex;padding:4px 12px;padding-left:12px;font-size:12px;line-height:20px;cursor:pointer}sd-select-option-group .sd-select__option-group.sd-select__option-group--group:not(.sd-select__option-group--use-checkbox),sd-select-option-group .sd-select__option-group.sd-select__option-group--subgroup:not(.sd-select__option-group--use-checkbox){cursor:default !important}sd-select-option-group .sd-select__option-group.sd-select__option-group--group{background-color:#f5faff !important;color:#333333 !important;font-weight:700}sd-select-option-group .sd-select__option-group.sd-select__option-group--subgroup{padding-left:20px;background-color:#f9f9f9 !important;color:#333333 !important;font-weight:500}sd-select-option-group .sd-select__option-group.sd-select__option-group--item{padding-left:28px}sd-select-option-group .sd-select__option-group sd-checkbox__bg{border-color:#888888}sd-select-option-group .sd-select__option-group__label-wrapper{display:flex;width:100%;column-gap:8px;align-items:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}sd-select-option-group .sd-select__option-group__label-wrapper sd-checkbox{flex-shrink:0}sd-select-option-group .sd-select__option-group__label-wrapper .sd-select__option-group-label{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-select-option-group .sd-select__option-group__label-wrapper .sd-select__option-group__count-indicator{width:fit-content;flex-shrink:0;font-size:12px;font-weight:500;color:#888888}sd-select-option-group .sd-select__option-group--focused{background-color:#e6f1ff}sd-select-option-group .sd-select__option-group--selected.sd-select__option-group--item:not(:hover):not(.sd-select__option-group--use-checkbox),sd-select-option-group .sd-select__option-group--focused.sd-select__option-group--item:not(:hover):not(.sd-select__option-group--use-checkbox){color:#0075ff;font-weight:700}sd-select-option-group .sd-select__option-group--disabled{color:#aaaaaa;cursor:not-allowed}sd-select-option-group .sd-select__option-group:hover:not(.sd-select__option-group--disabled){background-color:#0075ff;color:white}sd-select-option-group .sd-select__option-group:hover.sd-select__option-group--selected:not(.sd-select__option-group--group):not(.sd-select__option-group--subgroup) sd-checkbox .sd-checkbox__bg{border-color:white !important}`;
|
|
3767
|
+
|
|
3768
|
+
const SdSelectOptionGroup = class {
|
|
3769
|
+
constructor(hostRef) {
|
|
3770
|
+
index.registerInstance(this, hostRef);
|
|
3771
|
+
this.optionClick = index.createEvent(this, "optionClick");
|
|
3772
|
+
}
|
|
3773
|
+
get el() { return index.getElement(this); }
|
|
3774
|
+
option;
|
|
3775
|
+
index;
|
|
3776
|
+
isSelected = false;
|
|
3777
|
+
isFocused = false;
|
|
3778
|
+
optionStyle;
|
|
3779
|
+
disabled = false;
|
|
3780
|
+
useCheckbox = false;
|
|
3781
|
+
useIndicator = true;
|
|
3782
|
+
countInfo = {
|
|
3783
|
+
selectedCount: 0,
|
|
3784
|
+
totalCount: 0,
|
|
3785
|
+
};
|
|
3786
|
+
isHovered = false;
|
|
3787
|
+
async isDisabled() {
|
|
3788
|
+
return !!this.option.disabled || this.option.type === 'group' || this.option.type === 'subgroup';
|
|
3789
|
+
}
|
|
3790
|
+
optionClick;
|
|
3791
|
+
handleClick = (option, isSelected, event) => {
|
|
3792
|
+
event.stopPropagation();
|
|
3793
|
+
if (option.type === 'group' || option.type === 'subgroup') {
|
|
3794
|
+
this.optionClick.emit({
|
|
3795
|
+
option: this.option,
|
|
3796
|
+
isSelected,
|
|
3797
|
+
index: this.index,
|
|
3798
|
+
event,
|
|
3799
|
+
});
|
|
3800
|
+
return;
|
|
3801
|
+
}
|
|
3802
|
+
if (!this.option.disabled && !this.disabled) {
|
|
3803
|
+
this.optionClick.emit({
|
|
3804
|
+
option: this.option,
|
|
3805
|
+
isSelected,
|
|
3806
|
+
index: this.index,
|
|
3807
|
+
event,
|
|
3808
|
+
});
|
|
3809
|
+
}
|
|
3810
|
+
};
|
|
3811
|
+
render() {
|
|
3812
|
+
return (index.h("div", { key: 'd00236bc84a194509b25efa21ef1c53a25923a60', class: {
|
|
3813
|
+
'sd-select__option-group': true,
|
|
3814
|
+
'sd-select__option-group--selected': !!this.isSelected,
|
|
3815
|
+
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
3816
|
+
'sd-select__option-group--focused': this.isFocused,
|
|
3817
|
+
'sd-select__option-group--use-checkbox': this.useCheckbox,
|
|
3818
|
+
'sd-select__option-group--group': this.option.type === 'group',
|
|
3819
|
+
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
3820
|
+
'sd-select__option-group--item': this.option.type === 'item',
|
|
3821
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, index.h("div", { key: 'c635bb5ce073594dd05926529472db1665d5f86d', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (index.h("sd-checkbox", { key: '984289c89fe90f0cd40a3d022a29b9b974321db0', checked: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
3822
|
+
e.preventDefault();
|
|
3823
|
+
this.handleClick(this.option, this.isSelected, e);
|
|
3824
|
+
} })), index.h("span", { key: 'b01a4ad8c906d6990dcf5c8eb1affa17f3605452', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (index.h("span", { key: '9103fa0bfe93caf8b5c3dea936334cd22727dff0', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
3825
|
+
}
|
|
3826
|
+
};
|
|
3827
|
+
SdSelectOptionGroup.style = sdSelectOptionGroupCss();
|
|
3828
|
+
|
|
3320
3829
|
const sdTableBackupCss = () => `.sd-table__wrapper .sd-table__container .sd-table__middle{overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth}.sd-table__wrapper .sd-table__container .sd-table__middle::-webkit-scrollbar{opacity:0;background:#e5e5e5}.sd-table__wrapper .sd-table__container .sd-table__middle::-webkit-scrollbar:horizontal{height:8px}.sd-table__wrapper .sd-table__container .sd-table__middle::-webkit-scrollbar:vertical{width:8px}.sd-table__wrapper .sd-table__container .sd-table__middle::-webkit-scrollbar-thumb{height:80px;background-color:#cccccc;border-radius:4px}.sd-table__wrapper .sd-table__container .sd-table__middle::-webkit-scrollbar-track{background-color:transparent}.sd-table__wrapper{height:var(--table-height, auto);width:var(--table-width, 100%);color:#222222}.sd-table__wrapper .sd-table__container{width:100%;height:var(--table-container-height, auto);position:relative;border:1px solid #e1e1e1;border-radius:8px;font-size:12px;overflow:hidden;background:#ffffff}.sd-table__wrapper .sd-table__container .sd-table__middle{overflow:auto;will-change:scroll-position;min-height:var(--table-container-height, auto)}.sd-table__wrapper .sd-table__container .sd-table__middle--scrollable{height:var(--table-container-height, auto)}.sd-table__wrapper .sd-table__container .sd-table__middle--loading{overflow:hidden !important;pointer-events:none}.sd-table__wrapper .sd-table__container .sd-table__middle--loading__spinner{position:absolute;top:0;left:0;width:100%;height:var(--table-container-height, 100%);min-height:var(--table-container-height, 100%);background:rgba(255, 255, 255, 0.6);z-index:200;display:flex;align-items:center;justify-content:center}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table{background-color:white;display:table;width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody.sd-table-tbody--virtual-scroll{position:relative;height:var(--total-virtual-height, --table-container-height, auto)}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody.sd-table-tbody--virtual-scroll tr:not([aria-hidden=true]){width:100%}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody.sd-table-tbody--virtual-scroll tr[aria-hidden=true]{padding:0;border:none}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody.sd-table-tbody--virtual-scroll tr[aria-hidden=true]:not(.sd-table__virtual-row-spacer) td{display:none}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--selectable td.sd-td--selected,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--selectable th.sd-th--selected{width:52px !important;max-width:52px !important;min-width:52px !important;padding:0 10px 0 24px;text-align:left}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-header thead{position:sticky;top:0;z-index:120}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column th.sticky-left,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column th.sticky-right{position:sticky;background-color:#f5faff;z-index:110 !important}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column td.sticky-left,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column td.sticky-right{position:sticky;background-color:white;z-index:100 !important}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column .sticky-left{left:var(--sticky-left-offset, 0)}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column .sticky-right{right:var(--sticky-right-offset, 0)}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column th.sticky-cell{position:sticky;z-index:102;background-color:#f5faff}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--sticky-column td.sticky-cell{position:sticky;z-index:101;background-color:white}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-left th.sticky-left-edge,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-left td.sticky-left-edge{overflow:visible}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-left th.sticky-left-edge:after,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-left td.sticky-left-edge:after{content:"";position:absolute;top:0;left:100%;right:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset 12px 0 20px -25px;opacity:1;pointer-events:none}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-right th.sticky-right-edge,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-right td.sticky-right-edge{overflow:visible}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-right th.sticky-right-edge:after,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--scrolled-right td.sticky-right-edge:after{content:"";position:absolute;top:0;left:-20px;width:20px;height:100%;z-index:101 !important;box-shadow:inset -12px 0 20px -25px;opacity:1;pointer-events:none}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--no-data thead{opacity:0.4}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table--no-data thead tr th.sd-th{border-bottom:1px solid rgba(225, 225, 225, 0.4) !important}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table sd-td,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table sd-th,.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table .sd-th__content--label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;word-break:keep-all}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead{height:36px}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr{width:100%}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th{background:#f5faff;height:36px;padding:0 16px;font-weight:500;vertical-align:middle;border-bottom:1px solid #e1e1e1;-webkit-user-select:none;user-select:none;position:relative}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th.sd-th .sd-th__content{display:flex;flex-flow:row nowrap;align-items:center;gap:4px}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th.sd-th .sd-th__content--left{justify-content:flex-start}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th.sd-th .sd-th__content--center{justify-content:center}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th.sd-th .sd-th__content--right{justify-content:flex-end}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table thead tr th.sd-th .sd-th__resizer{position:absolute;top:50%;right:0;transform:translateY(-50%);width:4px;height:16px;cursor:col-resize;z-index:3;border-left:1px solid #cccccc;border-right:1px solid #cccccc}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody tr td{height:44px;padding:0 16px;border-bottom:1px solid #e1e1e1;background:white;vertical-align:middle}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody tr td.sd-td--left{text-align:left}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody tr td.sd-td--center{text-align:center}.sd-table__wrapper .sd-table__container .sd-table__middle .sd-table tbody tr td.sd-td--right{text-align:right}.sd-table__wrapper .sd-table__container .sd-table__bottom{background:white;text-align:center}.sd-table__wrapper .sd-table__container .sd-table__bottom .sd-table__no-data{padding-top:15%;color:#888888}.sd-table__wrapper .sd-table__pagination{position:relative;background:#f9f9f9;height:48px;display:flex;align-items:center;justify-content:center;border:1px solid #e1e1e1;border-top:none;border-radius:8px}.sd-table__wrapper .sd-table__pagination sd-select{position:absolute;right:10px;top:50%;transform:translateY(-50%)}.sd-table__wrapper .sd-table__virtual-spacer,.sd-table__wrapper .sd-table__virtual-row-spacer{padding:0 !important}.sd-table__wrapper .sd-table__virtual-spacer td,.sd-table__wrapper .sd-table__virtual-row-spacer td{padding:0 !important;border:none}.sd-table__wrapper .sd-table__virtual-spacer .sd-table__skeleton,.sd-table__wrapper .sd-table__virtual-row-spacer .sd-table__skeleton{width:100%;height:100%;background-image:repeating-linear-gradient(0deg, rgba(246, 246, 246, 0.3) 0px, rgba(225, 225, 225, 0.5) calc(var(--row-height, 44px) / 2), rgba(246, 246, 246, 0.3) var(--row-height, 44px));background-size:100% 200%;animation:skeleton-loading 1.5s ease-in-out infinite;position:relative}.sd-table__wrapper .sd-table__virtual-spacer .sd-table__skeleton::before,.sd-table__wrapper .sd-table__virtual-row-spacer .sd-table__skeleton::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background-image:repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row-height, 44px) - 1px), #e1e1e1 calc(var(--row-height, 44px) - 1px), #e1e1e1 var(--row-height, 44px));pointer-events:none}.sd-table__wrapper .sd-table__skeleton-cell{width:100%;height:20px;background:linear-gradient(90deg, rgba(246, 246, 246, 0.3) 0%, rgba(225, 225, 225, 0.5) 50%, rgba(246, 246, 246, 0.3) 100%);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}@keyframes skeleton-loading{0%{background-position:0% 0%}50%{background-position:100% 100%}100%{background-position:0% 0%}}`;
|
|
3321
3830
|
|
|
3322
3831
|
const SdTable = class {
|
|
@@ -4184,7 +4693,7 @@ const SdToggle = class {
|
|
|
4184
4693
|
this.sdChange.emit(newValue);
|
|
4185
4694
|
};
|
|
4186
4695
|
render() {
|
|
4187
|
-
return (index.h("label", { key: '
|
|
4696
|
+
return (index.h("label", { key: 'dda95f842f686a3f595db6ecb651551f717cab18', "aria-checked": this.isChecked.toString(), "aria-disabled": this.disabled.toString(), role: "switch", "aria-label": this.label || 'toggle', class: this.toggleClasses }, index.h("input", { key: 'a281a6572b7fca32242ba08ad45984445bd1a009', type: "checkbox", checked: this.isChecked, disabled: this.disabled, onInput: this.handleChange }), this.label && index.h("span", { key: 'dfae7796e9e421e7d6ebc6e6693e6266b2ff87cd', class: "sd-toggle__label" }, this.label), index.h("div", { key: 'e4343307f2df5f5c68509a3e9576a811bd9192ff', class: "sd-toggle__track" }, index.h("div", { key: 'be214081e5ccc21ad306e52ce186ba4dc56c6c3b', class: "sd-toggle__thumb" }))));
|
|
4188
4697
|
}
|
|
4189
4698
|
};
|
|
4190
4699
|
SdToggle.style = sdToggleCss();
|
|
@@ -4228,7 +4737,7 @@ const SdToggleButton = class {
|
|
|
4228
4737
|
this.sdChange.emit(newValue);
|
|
4229
4738
|
};
|
|
4230
4739
|
render() {
|
|
4231
|
-
return (index.h("label", { key: '
|
|
4740
|
+
return (index.h("label", { key: '4ac2cac1d4b1da4d707f4ce84a03ffc7a8ec7cb8', class: this.buttonClasses, role: "button", "aria-pressed": this.isActive.toString(), "aria-disabled": this.disabled.toString(), "aria-label": this.label || 'toggle button' }, this.label, index.h("input", { key: 'e9a974d34d7b3803b5ed44dc1b2da1199daf5bef', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
|
|
4232
4741
|
}
|
|
4233
4742
|
};
|
|
4234
4743
|
SdToggleButton.style = sdToggleButtonCss();
|
|
@@ -4281,20 +4790,20 @@ const SdTooltip = class {
|
|
|
4281
4790
|
: {
|
|
4282
4791
|
onClick: () => (this.showTooltip = !this.showTooltip),
|
|
4283
4792
|
};
|
|
4284
|
-
return (index.h(index.Fragment, { key: '
|
|
4793
|
+
return (index.h(index.Fragment, { key: '55a62a0b80b8c10d8c0d8ced1a34178191b8a688' }, this.label ? (index.h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-tooltip", ...handleTrigger })) : (index.h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-tooltip", ...handleTrigger })), this.showTooltip && (index.h("sd-tooltip-portal", { key: '21aaf4460591401ec5eb890d123e3cb381fb76f6', parentRef: this.buttonEl, onSdClose: () => this.handleClose(), placement: this.placement }, index.h("div", { key: 'ee5d301a2fa72f95a0f89242b174f7e21a086a15', class: {
|
|
4285
4794
|
'sd-tooltip-menu': true,
|
|
4286
4795
|
[`sd-tooltip-menu--${this.type}`]: true,
|
|
4287
4796
|
[`sd-tooltip-menu--${this.placement}`]: true,
|
|
4288
4797
|
'sd-tooltip-menu--with-close': this.useClose,
|
|
4289
4798
|
[`bg-${SdTooltip.COLOR_OF_TYPE[this.type].background}`]: true,
|
|
4290
4799
|
[`text-${SdTooltip.COLOR_OF_TYPE[this.type].text}`]: true,
|
|
4291
|
-
} }, index.h("i", { key: '
|
|
4800
|
+
} }, index.h("i", { key: '4f7e09f6770fbde0f2e9df81d401ea7cd6739df2', class: `sd-tooltip-menu__arrow sd-tooltip-menu__arrow--${this.placement}` }, index.h(tooltipArrow.TooltipArrow, { key: 'd0856082e623129eb56aaab87e54d1b19f33555a', class: {
|
|
4292
4801
|
[`text-${SdTooltip.COLOR_OF_TYPE[this.type].background}`]: true,
|
|
4293
|
-
} })), index.h("div", { key: '
|
|
4802
|
+
} })), index.h("div", { key: '40dc2a7d4254ed0e712f22cf19032e2f5ef846b4', class: "sd-tooltip-menu__content", ref: el => {
|
|
4294
4803
|
if (el && this.slotContent && !el.hasChildNodes()) {
|
|
4295
4804
|
el.appendChild(this.slotContent.cloneNode(true));
|
|
4296
4805
|
}
|
|
4297
|
-
} }, !this.slotContent && index.h("span", { key: '
|
|
4806
|
+
} }, !this.slotContent && index.h("span", { key: 'd897c210bb76de430a89243177f3a436cc684e09' }, this.el.textContent)), this.useClose && (index.h("div", { key: 'ca41d884070a25443833162e2dc50fcb91a6bd2a', class: "sd-tooltip-menu__close-button" }, index.h("button", { key: '75c911fa76787dda3346b4f18d6169304966d49b', type: "button", "aria-label": "Close tooltip", title: "Close tooltip", onClick: () => this.handleClose() }, index.h("sd-icon", { key: '4d737bf6cc2952776016b9bc7f11cf90364cdcdb', name: "close", size: "12", color: "#AAAAAA" })))))))));
|
|
4298
4807
|
}
|
|
4299
4808
|
};
|
|
4300
4809
|
SdTooltip.style = sdTooltipCss();
|
|
@@ -4448,7 +4957,7 @@ const SdTooltipPortal = class {
|
|
|
4448
4957
|
this.sdClose.emit();
|
|
4449
4958
|
}
|
|
4450
4959
|
render() {
|
|
4451
|
-
return index.h("slot", { key: '
|
|
4960
|
+
return index.h("slot", { key: 'c389b848b1dc63a0484f6000ac5443cce752e4ac' });
|
|
4452
4961
|
}
|
|
4453
4962
|
};
|
|
4454
4963
|
|
|
@@ -4459,12 +4968,14 @@ exports.sd_guide = SdGuide;
|
|
|
4459
4968
|
exports.sd_icon = SdIcon;
|
|
4460
4969
|
exports.sd_input = SdInput;
|
|
4461
4970
|
exports.sd_loading_spinner = SdLoadingSpinner;
|
|
4971
|
+
exports.sd_number_input = SdNumberInput;
|
|
4462
4972
|
exports.sd_pagination = SdPagination;
|
|
4463
4973
|
exports.sd_portal = SdPortal;
|
|
4464
4974
|
exports.sd_radio_group = SdRadioGroup;
|
|
4465
4975
|
exports.sd_select = SdSelect;
|
|
4466
|
-
exports.
|
|
4976
|
+
exports.sd_select_multiple_group = SdSelectMultipleGroup;
|
|
4467
4977
|
exports.sd_select_option = SdSelectOption;
|
|
4978
|
+
exports.sd_select_option_group = SdSelectOptionGroup;
|
|
4468
4979
|
exports.sd_table_backup = SdTable;
|
|
4469
4980
|
exports.sd_tabs = SdTabs;
|
|
4470
4981
|
exports.sd_tag = SdTag;
|
|
@@ -4473,4 +4984,4 @@ exports.sd_toggle = SdToggle;
|
|
|
4473
4984
|
exports.sd_toggle_button = SdToggleButton;
|
|
4474
4985
|
exports.sd_tooltip = SdTooltip;
|
|
4475
4986
|
exports.sd_tooltip_portal = SdTooltipPortal;
|
|
4476
|
-
//# sourceMappingURL=sd-button.sd-checkbox.sd-file-picker.sd-guide.sd-icon.sd-input.sd-loading-spinner.sd-pagination.sd-portal.sd-radio-group.sd-select.sd-select-multiple.sd-select-option.sd-table-backup.sd-tabs.sd-tag.sd-toast-message.sd-toggle.sd-toggle-button.sd-tooltip.sd-tooltip-portal.entry.cjs.js.map
|
|
4987
|
+
//# sourceMappingURL=sd-button.sd-checkbox.sd-file-picker.sd-guide.sd-icon.sd-input.sd-loading-spinner.sd-number-input.sd-pagination.sd-portal.sd-radio-group.sd-select.sd-select-multiple-group.sd-select-option.sd-select-option-group.sd-table-backup.sd-tabs.sd-tag.sd-toast-message.sd-toggle.sd-toggle-button.sd-tooltip.sd-tooltip-portal.entry.cjs.js.map
|