@idds/vue 1.3.5 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, inject, ref, computed, onMounted, onUnmounted, watch, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, createVNode, createCommentVNode, createBlock, resolveDynamicComponent, Transition, withCtx, provide, withModifiers, normalizeStyle, nextTick, h, unref, Fragment, renderList, mergeProps, withDirectives, vModelDynamic, withKeys, vModelText, Teleport, createStaticVNode, vModelRadio, useAttrs } from "vue";
1
+ import { defineComponent, inject, ref, computed, onMounted, onUnmounted, watch, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, createVNode, createCommentVNode, createBlock, resolveDynamicComponent, Transition, withCtx, provide, withModifiers, normalizeStyle, nextTick, h, unref, Fragment, renderList, mergeProps, useAttrs, withDirectives, vModelDynamic, withKeys, vModelText, Teleport, createStaticVNode, vModelRadio } from "vue";
2
2
  const iddsColorTokens = {
3
3
  // Neutral Colors
4
4
  "neutral-25": "var(--ina-neutral-25)",
@@ -572,7 +572,7 @@ const _hoisted_7$j = {
572
572
  key: 0,
573
573
  class: "ina-accordion-card__subtitle"
574
574
  };
575
- const _hoisted_8$f = ["id", "aria-labelledby"];
575
+ const _hoisted_8$e = ["id", "aria-labelledby"];
576
576
  const _hoisted_9$b = { class: "ina-accordion-card__body" };
577
577
  const _sfc_main$N = /* @__PURE__ */ defineComponent({
578
578
  __name: "AccordionCard",
@@ -667,7 +667,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
667
667
  createElementVNode("div", _hoisted_9$b, [
668
668
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
669
669
  ])
670
- ], 8, _hoisted_8$f)) : createCommentVNode("", true)
670
+ ], 8, _hoisted_8$e)) : createCommentVNode("", true)
671
671
  ]),
672
672
  _: 3
673
673
  })
@@ -1694,7 +1694,7 @@ const _hoisted_6$i = {
1694
1694
  class: "ina-card__avatar"
1695
1695
  };
1696
1696
  const _hoisted_7$h = ["src", "alt"];
1697
- const _hoisted_8$e = {
1697
+ const _hoisted_8$d = {
1698
1698
  key: 0,
1699
1699
  class: "ina-card__title"
1700
1700
  };
@@ -1843,7 +1843,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
1843
1843
  ])
1844
1844
  ])) : createCommentVNode("", true),
1845
1845
  createElementVNode("div", null, [
1846
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("h3", _hoisted_8$e, [
1846
+ __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("h3", _hoisted_8$d, [
1847
1847
  renderSlot(_ctx.$slots, "title", {}, () => [
1848
1848
  createTextVNode(toDisplayString(__props.title), 1)
1849
1849
  ])
@@ -2317,7 +2317,7 @@ const _hoisted_4$n = {
2317
2317
  key: 0,
2318
2318
  class: "ina-text-field__prefix-icon"
2319
2319
  };
2320
- const _hoisted_5$j = ["id", "type", "placeholder", "disabled", "readonly", "maxlength", "autocomplete", "spellcheck", "autocapitalize", "autocorrect", "inputmode", "dir"];
2320
+ const _hoisted_5$j = ["id", "name", "type", "placeholder", "disabled", "readonly", "maxlength", "autocomplete", "spellcheck", "autocapitalize", "autocorrect", "inputmode", "dir"];
2321
2321
  const _hoisted_6$g = {
2322
2322
  key: 1,
2323
2323
  class: "ina-text-field__char-count"
@@ -2354,6 +2354,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2354
2354
  setup(__props, { emit: __emit }) {
2355
2355
  const props = __props;
2356
2356
  const emit = __emit;
2357
+ const attrs = useAttrs();
2357
2358
  const inputRef = ref();
2358
2359
  const inputValue = ref(getInitialValue());
2359
2360
  const debounceTimer = ref();
@@ -2367,9 +2368,20 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2367
2368
  }
2368
2369
  return value;
2369
2370
  }
2370
- const inputId = computed(
2371
- () => `text-field-${Math.random().toString(36).substr(2, 9)}`
2372
- );
2371
+ const inputId = computed(() => {
2372
+ const providedId = attrs.id || attrs.name;
2373
+ if (providedId) {
2374
+ return String(providedId);
2375
+ }
2376
+ if (props.label) {
2377
+ return String(props.label).toLowerCase();
2378
+ }
2379
+ return `text-field-${Math.random().toString(36).substr(2, 9)}`;
2380
+ });
2381
+ const filteredAttrs = computed(() => {
2382
+ const { id, name, ...rest } = attrs;
2383
+ return rest;
2384
+ });
2373
2385
  const wrapperClasses = computed(() => {
2374
2386
  const classes = ["ina-text-field__wrapper"];
2375
2387
  classes.push(`ina-text-field__wrapper--size-${props.size}`);
@@ -2538,11 +2550,12 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
2538
2550
  __props.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_4$n, [
2539
2551
  (openBlock(), createBlock(resolveDynamicComponent(__props.prefixIcon), { size: 16 }))
2540
2552
  ])) : createCommentVNode("", true),
2541
- withDirectives(createElementVNode("input", mergeProps(_ctx.$attrs, {
2553
+ withDirectives(createElementVNode("input", mergeProps(filteredAttrs.value, {
2542
2554
  id: inputId.value,
2543
2555
  ref_key: "inputRef",
2544
2556
  ref: inputRef,
2545
2557
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
2558
+ name: unref(attrs).name || void 0,
2546
2559
  type: __props.type,
2547
2560
  placeholder: __props.placeholder,
2548
2561
  disabled: __props.disabled,
@@ -3336,7 +3349,7 @@ const _hoisted_4$j = { class: "ina-file-upload__icon" };
3336
3349
  const _hoisted_5$h = { class: "ina-file-upload__text" };
3337
3350
  const _hoisted_6$f = { class: "ina-file-upload__title" };
3338
3351
  const _hoisted_7$f = { class: "ina-file-upload__description" };
3339
- const _hoisted_8$d = ["disabled"];
3352
+ const _hoisted_8$c = ["disabled"];
3340
3353
  const _hoisted_9$9 = { class: "ina-file-upload__files" };
3341
3354
  const _hoisted_10$8 = { class: "ina-file-upload__file-indicator" };
3342
3355
  const _hoisted_11$8 = {
@@ -3618,7 +3631,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
3618
3631
  class: "ina-file-upload__button",
3619
3632
  disabled: __props.disabled,
3620
3633
  onClick: withModifiers(triggerFileInput, ["stop"])
3621
- }, " Pilih File ", 8, _hoisted_8$d)
3634
+ }, " Pilih File ", 8, _hoisted_8$c)
3622
3635
  ])
3623
3636
  ], 34),
3624
3637
  files.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
@@ -3948,7 +3961,7 @@ const _hoisted_4$h = ["id"];
3948
3961
  const _hoisted_5$g = ["aria-label"];
3949
3962
  const _hoisted_6$e = { class: "ina-modal__body" };
3950
3963
  const _hoisted_7$e = ["id"];
3951
- const _hoisted_8$c = {
3964
+ const _hoisted_8$b = {
3952
3965
  key: 1,
3953
3966
  class: "ina-modal__footer"
3954
3967
  };
@@ -4084,7 +4097,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
4084
4097
  }, toDisplayString(__props.description), 9, _hoisted_7$e)) : createCommentVNode("", true),
4085
4098
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
4086
4099
  ]),
4087
- __props.showFooter ? (openBlock(), createElementBlock("div", _hoisted_8$c, [
4100
+ __props.showFooter ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
4088
4101
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
4089
4102
  ])) : createCommentVNode("", true)
4090
4103
  ], 10, _hoisted_2$o)
@@ -4116,15 +4129,14 @@ const _hoisted_2$n = {
4116
4129
  key: 0,
4117
4130
  class: "ina-month-picker__required"
4118
4131
  };
4119
- const _hoisted_3$l = { class: "ina-month-picker__wrapper" };
4120
- const _hoisted_4$g = ["id", "disabled", "aria-expanded", "aria-labelledby"];
4121
- const _hoisted_5$f = {
4132
+ const _hoisted_3$l = ["id", "disabled", "aria-expanded", "aria-labelledby"];
4133
+ const _hoisted_4$g = {
4122
4134
  key: 0,
4123
4135
  class: "ina-month-picker__prefix-icon"
4124
4136
  };
4125
- const _hoisted_6$d = { class: "ina-month-picker__trigger-text" };
4126
- const _hoisted_7$d = { class: "ina-month-picker__grid" };
4127
- const _hoisted_8$b = ["disabled", "onClick", "onMouseenter"];
4137
+ const _hoisted_5$f = { class: "ina-month-picker__trigger-text" };
4138
+ const _hoisted_6$d = { class: "ina-month-picker__grid" };
4139
+ const _hoisted_7$d = ["disabled", "onClick", "onMouseenter"];
4128
4140
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
4129
4141
  __name: "MonthPicker",
4130
4142
  props: {
@@ -4144,6 +4156,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4144
4156
  setup(__props, { emit: __emit }) {
4145
4157
  const props = __props;
4146
4158
  const emit = __emit;
4159
+ const containerRef = ref();
4147
4160
  const triggerRef = ref();
4148
4161
  const panelRef = ref();
4149
4162
  const isOpen = ref(false);
@@ -4240,39 +4253,23 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4240
4253
  let leftValue = void 0;
4241
4254
  let rightValue = void 0;
4242
4255
  if (isMobile) {
4243
- const threshold = 16;
4244
- const triggerCenter = triggerRect.left + triggerRect.width / 2;
4245
- const viewportCenter = viewportWidth / 2;
4246
- if (triggerRect.right > viewportWidth - threshold) {
4247
- shouldUseRight = true;
4248
- rightValue = `${viewportWidth - triggerRect.right}px`;
4249
- leftValue = void 0;
4250
- } else if (triggerRect.left < threshold) {
4251
- shouldUseRight = false;
4252
- leftValue = `${triggerRect.left}px`;
4253
- rightValue = void 0;
4254
- } else if (Math.abs(triggerCenter - viewportCenter) < panelWidthValue / 2) {
4255
- const panelLeft = triggerRect.left - (panelWidthValue - triggerRect.width) / 2;
4256
- if (panelLeft < 0) {
4257
- leftValue = "0";
4258
- rightValue = void 0;
4259
- } else if (panelLeft + panelWidthValue > viewportWidth) {
4260
- rightValue = "0";
4261
- leftValue = void 0;
4262
- } else {
4263
- leftValue = `${panelLeft}px`;
4264
- rightValue = void 0;
4256
+ const panelCenterX = viewportWidth / 2;
4257
+ const panelLeftFromViewport = panelCenterX - panelWidthValue / 2;
4258
+ if (containerRef.value) {
4259
+ const containerRect = containerRef.value.getBoundingClientRect();
4260
+ const leftRelativeToContainer = panelLeftFromViewport - containerRect.left;
4261
+ let calculatedLeft = Math.max(0, leftRelativeToContainer);
4262
+ const maxLeft = viewportWidth - panelWidthValue - containerRect.left;
4263
+ if (leftRelativeToContainer > maxLeft) {
4264
+ calculatedLeft = Math.max(0, maxLeft);
4265
4265
  }
4266
+ leftValue = `${calculatedLeft}px`;
4267
+ rightValue = void 0;
4266
4268
  shouldUseRight = false;
4267
4269
  } else {
4268
- shouldUseRight = panelWidthValue > availableSpaceRight;
4269
- if (shouldUseRight) {
4270
- rightValue = `${viewportWidth - triggerRect.right}px`;
4271
- leftValue = void 0;
4272
- } else {
4273
- leftValue = `${triggerRect.left}px`;
4274
- rightValue = void 0;
4275
- }
4270
+ leftValue = `${Math.max(0, panelLeftFromViewport)}px`;
4271
+ rightValue = void 0;
4272
+ shouldUseRight = false;
4276
4273
  }
4277
4274
  } else {
4278
4275
  shouldUseRight = panelWidthValue > availableSpaceRight;
@@ -4377,6 +4374,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4377
4374
  });
4378
4375
  return (_ctx, _cache) => {
4379
4376
  return openBlock(), createElementBlock("div", {
4377
+ ref_key: "containerRef",
4378
+ ref: containerRef,
4380
4379
  class: normalizeClass(["ina-month-picker", containerClasses.value])
4381
4380
  }, [
4382
4381
  __props.label ? (openBlock(), createElementBlock("label", {
@@ -4387,94 +4386,92 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4387
4386
  createTextVNode(toDisplayString(__props.label) + " ", 1),
4388
4387
  __props.required ? (openBlock(), createElementBlock("span", _hoisted_2$n, "*")) : createCommentVNode("", true)
4389
4388
  ], 8, _hoisted_1$o)) : createCommentVNode("", true),
4390
- createElementVNode("div", _hoisted_3$l, [
4391
- createElementVNode("button", {
4392
- id: triggerId.value,
4393
- ref_key: "triggerRef",
4394
- ref: triggerRef,
4389
+ createElementVNode("button", {
4390
+ id: triggerId.value,
4391
+ ref_key: "triggerRef",
4392
+ ref: triggerRef,
4393
+ type: "button",
4394
+ class: normalizeClass(triggerClasses.value),
4395
+ disabled: __props.disabled || __props.readonly,
4396
+ "aria-expanded": isOpen.value,
4397
+ "aria-haspopup": true,
4398
+ "aria-labelledby": __props.label ? `${triggerId.value}-label` : void 0,
4399
+ onClick: togglePanel,
4400
+ onKeydown: handleKeydown
4401
+ }, [
4402
+ __props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_4$g, [..._cache[1] || (_cache[1] = [
4403
+ createStaticVNode('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-f53ade24><rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" data-v-f53ade24></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-f53ade24></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-f53ade24></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-f53ade24></line></svg>', 1)
4404
+ ])])) : createCommentVNode("", true),
4405
+ createElementVNode("span", _hoisted_5$f, toDisplayString(selectedMonthDisplay.value || __props.placeholder), 1),
4406
+ __props.showClearButton && selectedMonth.value !== void 0 && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("button", {
4407
+ key: 1,
4395
4408
  type: "button",
4396
- class: normalizeClass(triggerClasses.value),
4397
- disabled: __props.disabled || __props.readonly,
4398
- "aria-expanded": isOpen.value,
4399
- "aria-haspopup": true,
4400
- "aria-labelledby": __props.label ? `${triggerId.value}-label` : void 0,
4401
- onClick: togglePanel,
4402
- onKeydown: handleKeydown
4403
- }, [
4404
- __props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_5$f, [..._cache[1] || (_cache[1] = [
4405
- createStaticVNode('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-452431d5><rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" data-v-452431d5></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-452431d5></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-452431d5></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-452431d5></line></svg>', 1)
4406
- ])])) : createCommentVNode("", true),
4407
- createElementVNode("span", _hoisted_6$d, toDisplayString(selectedMonthDisplay.value || __props.placeholder), 1),
4408
- __props.showClearButton && selectedMonth.value !== void 0 && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("button", {
4409
- key: 1,
4410
- type: "button",
4411
- class: "ina-month-picker__clear-button",
4412
- onClick: withModifiers(handleClear, ["stop"])
4413
- }, [..._cache[2] || (_cache[2] = [
4414
- createElementVNode("svg", {
4415
- width: "16",
4416
- height: "16",
4417
- viewBox: "0 0 24 24",
4418
- fill: "none",
4419
- xmlns: "http://www.w3.org/2000/svg"
4420
- }, [
4421
- createElementVNode("path", {
4422
- d: "M18 6L6 18M6 6L18 18",
4423
- stroke: "currentColor",
4424
- "stroke-width": "2",
4425
- "stroke-linecap": "round",
4426
- "stroke-linejoin": "round"
4427
- })
4428
- ], -1)
4429
- ])])) : createCommentVNode("", true),
4430
- (openBlock(), createElementBlock("svg", {
4431
- class: normalizeClass(["ina-month-picker__chevron", { "ina-month-picker__chevron--open": isOpen.value }]),
4409
+ class: "ina-month-picker__clear-button",
4410
+ onClick: withModifiers(handleClear, ["stop"])
4411
+ }, [..._cache[2] || (_cache[2] = [
4412
+ createElementVNode("svg", {
4432
4413
  width: "16",
4433
4414
  height: "16",
4434
4415
  viewBox: "0 0 24 24",
4435
4416
  fill: "none",
4436
4417
  xmlns: "http://www.w3.org/2000/svg"
4437
- }, [..._cache[3] || (_cache[3] = [
4418
+ }, [
4438
4419
  createElementVNode("path", {
4439
- d: "M6 9L12 15L18 9",
4420
+ d: "M18 6L6 18M6 6L18 18",
4440
4421
  stroke: "currentColor",
4441
4422
  "stroke-width": "2",
4442
4423
  "stroke-linecap": "round",
4443
4424
  "stroke-linejoin": "round"
4444
- }, null, -1)
4445
- ])], 2))
4446
- ], 42, _hoisted_4$g),
4447
- createVNode(Transition, { name: "panel" }, {
4448
- default: withCtx(() => [
4449
- isOpen.value ? (openBlock(), createElementBlock("div", {
4450
- key: 0,
4451
- ref_key: "panelRef",
4452
- ref: panelRef,
4453
- class: normalizeClass([
4454
- "ina-month-picker__panel",
4455
- { "ina-month-picker__panel--open": isOpen.value },
4456
- { "ina-month-picker__panel--right-aligned": useRightPositioning.value }
4457
- ]),
4458
- style: normalizeStyle(panelStyle.value)
4459
- }, [
4460
- createElementVNode("div", _hoisted_7$d, [
4461
- (openBlock(), createElementBlock(Fragment, null, renderList(monthNames, (month, index2) => {
4462
- return createElementVNode("button", {
4463
- key: index2,
4464
- type: "button",
4465
- class: normalizeClass(getMonthClasses(index2)),
4466
- disabled: props.disabled,
4467
- onClick: ($event) => selectMonth(index2),
4468
- onMouseenter: ($event) => !props.disabled && (hoveredMonth.value = index2),
4469
- onMouseleave: _cache[0] || (_cache[0] = ($event) => hoveredMonth.value = null)
4470
- }, toDisplayString(month), 43, _hoisted_8$b);
4471
- }), 64))
4472
- ])
4473
- ], 6)) : createCommentVNode("", true)
4474
- ]),
4475
- _: 1
4476
- })
4477
- ]),
4425
+ })
4426
+ ], -1)
4427
+ ])])) : createCommentVNode("", true),
4428
+ (openBlock(), createElementBlock("svg", {
4429
+ class: normalizeClass(["ina-month-picker__chevron", { "ina-month-picker__chevron--open": isOpen.value }]),
4430
+ width: "16",
4431
+ height: "16",
4432
+ viewBox: "0 0 24 24",
4433
+ fill: "none",
4434
+ xmlns: "http://www.w3.org/2000/svg"
4435
+ }, [..._cache[3] || (_cache[3] = [
4436
+ createElementVNode("path", {
4437
+ d: "M6 9L12 15L18 9",
4438
+ stroke: "currentColor",
4439
+ "stroke-width": "2",
4440
+ "stroke-linecap": "round",
4441
+ "stroke-linejoin": "round"
4442
+ }, null, -1)
4443
+ ])], 2))
4444
+ ], 42, _hoisted_3$l),
4445
+ createVNode(Transition, { name: "panel" }, {
4446
+ default: withCtx(() => [
4447
+ isOpen.value ? (openBlock(), createElementBlock("div", {
4448
+ key: 0,
4449
+ ref_key: "panelRef",
4450
+ ref: panelRef,
4451
+ class: normalizeClass([
4452
+ "ina-month-picker__panel",
4453
+ { "ina-month-picker__panel--open": isOpen.value },
4454
+ { "ina-month-picker__panel--right-aligned": useRightPositioning.value }
4455
+ ]),
4456
+ style: normalizeStyle(panelStyle.value)
4457
+ }, [
4458
+ createElementVNode("div", _hoisted_6$d, [
4459
+ (openBlock(), createElementBlock(Fragment, null, renderList(monthNames, (month, index2) => {
4460
+ return createElementVNode("button", {
4461
+ key: index2,
4462
+ type: "button",
4463
+ class: normalizeClass(getMonthClasses(index2)),
4464
+ disabled: props.disabled,
4465
+ onClick: ($event) => selectMonth(index2),
4466
+ onMouseenter: ($event) => !props.disabled && (hoveredMonth.value = index2),
4467
+ onMouseleave: _cache[0] || (_cache[0] = ($event) => hoveredMonth.value = null)
4468
+ }, toDisplayString(month), 43, _hoisted_7$d);
4469
+ }), 64))
4470
+ ])
4471
+ ], 6)) : createCommentVNode("", true)
4472
+ ]),
4473
+ _: 1
4474
+ }),
4478
4475
  __props.statusMessage ? (openBlock(), createElementBlock("div", {
4479
4476
  key: 1,
4480
4477
  class: normalizeClass(statusClasses.value)
@@ -4483,7 +4480,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
4483
4480
  };
4484
4481
  }
4485
4482
  });
4486
- const MonthPicker = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-452431d5"]]);
4483
+ const MonthPicker = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-f53ade24"]]);
4487
4484
  const _hoisted_1$n = {
4488
4485
  key: 0,
4489
4486
  class: "ina-multiple-choice-grid__title"
@@ -5588,6 +5585,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5588
5585
  setup(__props, { emit: __emit }) {
5589
5586
  const props = __props;
5590
5587
  const emit = __emit;
5588
+ const containerRef = ref();
5591
5589
  const triggerRef = ref();
5592
5590
  const panelRef = ref();
5593
5591
  const isOpen = ref(false);
@@ -5683,48 +5681,32 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5683
5681
  const panelRect = panelRef.value.getBoundingClientRect();
5684
5682
  const viewportWidth = window.innerWidth;
5685
5683
  const viewportHeight = window.innerHeight;
5686
- const defaultPanelWidth = 320;
5684
+ const isMobile = viewportWidth <= 640;
5685
+ const defaultPanelWidth = isMobile ? 200 : 320;
5687
5686
  const panelWidthValue = panelRect.width || defaultPanelWidth;
5688
5687
  const availableSpaceRight = viewportWidth - triggerRect.right;
5689
5688
  triggerRect.left;
5690
- const isMobile = viewportWidth <= 640;
5691
5689
  let shouldUseRight = false;
5692
5690
  let leftValue = void 0;
5693
5691
  let rightValue = void 0;
5694
5692
  if (isMobile) {
5695
- const threshold = 16;
5696
- const triggerCenter = triggerRect.left + triggerRect.width / 2;
5697
- const viewportCenter = viewportWidth / 2;
5698
- if (triggerRect.right > viewportWidth - threshold) {
5699
- shouldUseRight = true;
5700
- rightValue = `${viewportWidth - triggerRect.right}px`;
5701
- leftValue = void 0;
5702
- } else if (triggerRect.left < threshold) {
5703
- shouldUseRight = false;
5704
- leftValue = `${triggerRect.left}px`;
5705
- rightValue = void 0;
5706
- } else if (Math.abs(triggerCenter - viewportCenter) < panelWidthValue / 2) {
5707
- const panelLeft = triggerRect.left - (panelWidthValue - triggerRect.width) / 2;
5708
- if (panelLeft < 0) {
5709
- leftValue = "0";
5710
- rightValue = void 0;
5711
- } else if (panelLeft + panelWidthValue > viewportWidth) {
5712
- rightValue = "0";
5713
- leftValue = void 0;
5714
- } else {
5715
- leftValue = `${panelLeft}px`;
5716
- rightValue = void 0;
5693
+ const panelCenterX = viewportWidth / 2;
5694
+ const panelLeftFromViewport = panelCenterX - panelWidthValue / 2;
5695
+ if (containerRef.value) {
5696
+ const containerRect = containerRef.value.getBoundingClientRect();
5697
+ const leftRelativeToContainer = panelLeftFromViewport - containerRect.left;
5698
+ let calculatedLeft = Math.max(0, leftRelativeToContainer);
5699
+ const maxLeft = viewportWidth - panelWidthValue - containerRect.left;
5700
+ if (leftRelativeToContainer > maxLeft) {
5701
+ calculatedLeft = Math.max(0, maxLeft);
5717
5702
  }
5703
+ leftValue = `${calculatedLeft}px`;
5704
+ rightValue = void 0;
5718
5705
  shouldUseRight = false;
5719
5706
  } else {
5720
- shouldUseRight = panelWidthValue > availableSpaceRight;
5721
- if (shouldUseRight) {
5722
- rightValue = `${viewportWidth - triggerRect.right}px`;
5723
- leftValue = void 0;
5724
- } else {
5725
- leftValue = `${triggerRect.left}px`;
5726
- rightValue = void 0;
5727
- }
5707
+ leftValue = `${Math.max(0, panelLeftFromViewport)}px`;
5708
+ rightValue = void 0;
5709
+ shouldUseRight = false;
5728
5710
  }
5729
5711
  } else {
5730
5712
  shouldUseRight = panelWidthValue > availableSpaceRight;
@@ -5848,6 +5830,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5848
5830
  });
5849
5831
  return (_ctx, _cache) => {
5850
5832
  return openBlock(), createElementBlock("div", {
5833
+ ref_key: "containerRef",
5834
+ ref: containerRef,
5851
5835
  class: normalizeClass(["ina-year-picker", containerClasses.value])
5852
5836
  }, [
5853
5837
  __props.label ? (openBlock(), createElementBlock("label", {
@@ -5873,7 +5857,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5873
5857
  onKeydown: handleKeydown
5874
5858
  }, [
5875
5859
  __props.showIcon ? (openBlock(), createElementBlock("div", _hoisted_5$9, [..._cache[1] || (_cache[1] = [
5876
- createStaticVNode('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-3336f854><rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" data-v-3336f854></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-3336f854></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-3336f854></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-3336f854></line></svg>', 1)
5860
+ createStaticVNode('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6e7c1cdf><rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" data-v-6e7c1cdf></rect><line x1="16" y1="2" x2="16" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-6e7c1cdf></line><line x1="8" y1="2" x2="8" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-6e7c1cdf></line><line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" data-v-6e7c1cdf></line></svg>', 1)
5877
5861
  ])])) : createCommentVNode("", true),
5878
5862
  createElementVNode("span", _hoisted_6$8, toDisplayString(selectedYear.value || __props.placeholder), 1),
5879
5863
  __props.showClearButton && selectedYear.value && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("button", {
@@ -5957,7 +5941,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5957
5941
  };
5958
5942
  }
5959
5943
  });
5960
- const YearPicker = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-3336f854"]]);
5944
+ const YearPicker = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6e7c1cdf"]]);
5961
5945
  const _hoisted_1$g = ["for"];
5962
5946
  const _hoisted_2$g = {
5963
5947
  key: 0,
@@ -5982,13 +5966,15 @@ const _hoisted_15$2 = { class: "ina-date-picker__dropdown-container" };
5982
5966
  const _hoisted_16$1 = { class: "ina-date-picker__dropdown-container" };
5983
5967
  const _hoisted_17$1 = { class: "ina-date-picker__calendar-grid" };
5984
5968
  const _hoisted_18$1 = ["disabled", "onClick"];
5985
- const _hoisted_19$1 = { class: "ina-date-picker__calendar" };
5986
- const _hoisted_20$1 = { class: "ina-date-picker__next-month-header" };
5987
- const _hoisted_21$1 = { class: "ina-date-picker__next-month-controls" };
5988
- const _hoisted_22 = { class: "ina-date-picker__dropdown-container" };
5969
+ const _hoisted_19$1 = { class: "ina-date-picker__day-number" };
5970
+ const _hoisted_20$1 = { class: "ina-date-picker__calendar" };
5971
+ const _hoisted_21$1 = { class: "ina-date-picker__next-month-header" };
5972
+ const _hoisted_22 = { class: "ina-date-picker__next-month-controls" };
5989
5973
  const _hoisted_23 = { class: "ina-date-picker__dropdown-container" };
5990
- const _hoisted_24 = { class: "ina-date-picker__calendar-grid" };
5991
- const _hoisted_25 = ["disabled", "onClick"];
5974
+ const _hoisted_24 = { class: "ina-date-picker__dropdown-container" };
5975
+ const _hoisted_25 = { class: "ina-date-picker__calendar-grid" };
5976
+ const _hoisted_26 = ["disabled", "onClick"];
5977
+ const _hoisted_27 = { class: "ina-date-picker__day-number" };
5992
5978
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
5993
5979
  __name: "DatePicker",
5994
5980
  props: {
@@ -6012,7 +5998,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6012
5998
  disabledFutureDate: { type: Boolean },
6013
5999
  disabledDateBefore: {},
6014
6000
  disabledDateAfter: {},
6015
- triggerWidth: { default: "100%" },
6001
+ triggerWidth: { default: "" },
6016
6002
  panelMaxHeight: { default: void 0 },
6017
6003
  panelClassName: { default: "" },
6018
6004
  triggerClassname: { default: "" },
@@ -6941,12 +6927,14 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6941
6927
  class: normalizeClass(getDayClasses(day)),
6942
6928
  disabled: isDayDisabled(day.date),
6943
6929
  onClick: ($event) => selectDay(day)
6944
- }, toDisplayString(day.date.getDate()), 11, _hoisted_18$1);
6930
+ }, [
6931
+ createElementVNode("span", _hoisted_19$1, toDisplayString(day.date.getDate()), 1)
6932
+ ], 10, _hoisted_18$1);
6945
6933
  }), 128))
6946
6934
  ])
6947
6935
  ]),
6948
- createElementVNode("div", _hoisted_19$1, [
6949
- createElementVNode("div", _hoisted_20$1, [
6936
+ createElementVNode("div", _hoisted_20$1, [
6937
+ createElementVNode("div", _hoisted_21$1, [
6950
6938
  createElementVNode("button", {
6951
6939
  type: "button",
6952
6940
  class: "ina-date-picker__nav-button",
@@ -6957,8 +6945,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6957
6945
  class: "ina-date-picker__nav-icon"
6958
6946
  })
6959
6947
  ]),
6960
- createElementVNode("div", _hoisted_21$1, [
6961
- createElementVNode("div", _hoisted_22, [
6948
+ createElementVNode("div", _hoisted_22, [
6949
+ createElementVNode("div", _hoisted_23, [
6962
6950
  createVNode(MonthPicker, {
6963
6951
  "model-value": nextMonth.value,
6964
6952
  disabled: __props.disabled,
@@ -6967,7 +6955,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6967
6955
  "onUpdate:modelValue": handleNextMonthChange
6968
6956
  }, null, 8, ["model-value", "disabled", "readonly"])
6969
6957
  ]),
6970
- createElementVNode("div", _hoisted_23, [
6958
+ createElementVNode("div", _hoisted_24, [
6971
6959
  createVNode(YearPicker, {
6972
6960
  "model-value": nextYear.value,
6973
6961
  "min-year": 1900,
@@ -6991,7 +6979,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6991
6979
  })
6992
6980
  ])
6993
6981
  ]),
6994
- createElementVNode("div", _hoisted_24, [
6982
+ createElementVNode("div", _hoisted_25, [
6995
6983
  (openBlock(), createElementBlock(Fragment, null, renderList(dayNames, (day) => {
6996
6984
  return createElementVNode("div", {
6997
6985
  key: `rh-${day}`,
@@ -7005,7 +6993,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
7005
6993
  class: normalizeClass(getDayClasses(day)),
7006
6994
  disabled: isDayDisabled(day.date),
7007
6995
  onClick: ($event) => selectDay(day)
7008
- }, toDisplayString(day.date.getDate()), 11, _hoisted_25);
6996
+ }, [
6997
+ createElementVNode("span", _hoisted_27, toDisplayString(day.date.getDate()), 1)
6998
+ ], 10, _hoisted_26);
7009
6999
  }), 128))
7010
7000
  ])
7011
7001
  ])
@@ -7020,7 +7010,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
7020
7010
  };
7021
7011
  }
7022
7012
  });
7023
- const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-9cd9726e"]]);
7013
+ const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-d43f3297"]]);
7024
7014
  const _hoisted_1$f = ["disabled"];
7025
7015
  const _hoisted_2$f = {
7026
7016
  key: 0,
@@ -7617,10 +7607,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
7617
7607
  return openBlock(), createBlock(Teleport, { to: "body" }, [
7618
7608
  createVNode(Transition, { name: "drawer" }, {
7619
7609
  default: withCtx(() => [
7620
- isOpen.value ? (openBlock(), createElementBlock("div", {
7610
+ isOpen.value ? (openBlock(), createElementBlock("div", mergeProps({
7621
7611
  key: 0,
7622
- class: normalizeClass(["ina-drawer", drawerClasses.value])
7623
- }, [
7612
+ class: ["ina-drawer", drawerClasses.value]
7613
+ }, _ctx.$attrs), [
7624
7614
  createElementVNode("div", {
7625
7615
  class: "ina-drawer__backdrop",
7626
7616
  onClick: handleBackdropClick
@@ -7681,7 +7671,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
7681
7671
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
7682
7672
  ])) : createCommentVNode("", true)
7683
7673
  ], 10, _hoisted_1$e)
7684
- ], 2)) : createCommentVNode("", true)
7674
+ ], 16)) : createCommentVNode("", true)
7685
7675
  ]),
7686
7676
  _: 3
7687
7677
  })
@@ -7689,7 +7679,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
7689
7679
  };
7690
7680
  }
7691
7681
  });
7692
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-cdbda5b3"]]);
7682
+ const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-a924d690"]]);
7693
7683
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
7694
7684
  __name: "Skeleton",
7695
7685
  props: {
@@ -8720,7 +8710,7 @@ const _hoisted_2$8 = {
8720
8710
  key: 0,
8721
8711
  class: "ina-text-area__required"
8722
8712
  };
8723
- const _hoisted_3$6 = ["id", "placeholder", "disabled", "readonly", "maxlength", "rows", "autocomplete", "spellcheck", "autocapitalize", "autocorrect", "dir"];
8713
+ const _hoisted_3$6 = ["id", "name", "placeholder", "disabled", "readonly", "maxlength", "rows", "autocomplete", "spellcheck", "autocapitalize", "autocorrect", "dir"];
8724
8714
  const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8725
8715
  __name: "TextArea",
8726
8716
  props: {
@@ -8751,6 +8741,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8751
8741
  setup(__props, { emit: __emit }) {
8752
8742
  const props = __props;
8753
8743
  const emit = __emit;
8744
+ const attrs = useAttrs();
8754
8745
  const textareaRef = ref();
8755
8746
  const inputValue = ref(getInitialValue());
8756
8747
  const validationError = ref(null);
@@ -8763,9 +8754,20 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8763
8754
  }
8764
8755
  return value;
8765
8756
  }
8766
- const textareaId = computed(
8767
- () => `text-area-${Math.random().toString(36).substr(2, 9)}`
8768
- );
8757
+ const textareaId = computed(() => {
8758
+ const providedId = attrs.id || attrs.name;
8759
+ if (providedId) {
8760
+ return String(providedId);
8761
+ }
8762
+ if (props.label) {
8763
+ return String(props.label).toLowerCase();
8764
+ }
8765
+ return `text-area-${Math.random().toString(36).substr(2, 9)}`;
8766
+ });
8767
+ const filteredAttrs = computed(() => {
8768
+ const { id, name, ...rest } = attrs;
8769
+ return rest;
8770
+ });
8769
8771
  const containerClasses = computed(() => {
8770
8772
  const classes = ["ina-text-area"];
8771
8773
  if (props.disabled) {
@@ -8923,11 +8925,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8923
8925
  createElementVNode("div", {
8924
8926
  class: normalizeClass(["ina-text-area__wrapper", wrapperClasses.value])
8925
8927
  }, [
8926
- withDirectives(createElementVNode("textarea", mergeProps({
8928
+ withDirectives(createElementVNode("textarea", mergeProps(filteredAttrs.value, {
8927
8929
  id: textareaId.value,
8928
8930
  ref_key: "textareaRef",
8929
8931
  ref: textareaRef,
8930
8932
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
8933
+ name: unref(attrs).name || void 0,
8931
8934
  placeholder: __props.placeholder,
8932
8935
  disabled: __props.disabled,
8933
8936
  readonly: __props.readonly,
@@ -8938,8 +8941,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
8938
8941
  autocapitalize: __props.autoCapitalize,
8939
8942
  autocorrect: __props.autoCorrect,
8940
8943
  dir: __props.dir,
8941
- class: textareaClasses.value
8942
- }, _ctx.$attrs, {
8944
+ class: textareaClasses.value,
8943
8945
  onInput: handleInput,
8944
8946
  onBlur: handleBlur,
8945
8947
  onFocus: handleFocus