@plaidev/karte-action-sdk 1.1.206 → 1.1.207

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.
@@ -1324,21 +1324,49 @@ function request(url, data, cb) {
1324
1324
  'Content-Type': 'text/plain;charset=UTF-8',
1325
1325
  },
1326
1326
  body: JSON.stringify({ ...data }),
1327
- }).then(response => {
1327
+ })
1328
+ .then(response => {
1328
1329
  if (!response.ok) {
1329
- return cb(new Error(`fail to request collection api. reason: ${response.status}`));
1330
+ throw new Error(`fail to request collection api. reason: ${response.status}`);
1330
1331
  }
1331
- return cb(null, response.json());
1332
+ return response.json();
1333
+ })
1334
+ .then(data => {
1335
+ return cb(null, data);
1336
+ })
1337
+ .catch(err => {
1338
+ return cb(err, null);
1332
1339
  });
1333
1340
  }
1334
1341
  /** @internal */
1335
1342
  const loadActionTableRow = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
1343
+ const defaultValue = config.query.default_value ?? null;
1336
1344
  const key = data[config.query.key] ?? null;
1337
1345
  if (key == null) {
1338
1346
  console.warn('key is not found. key: ', config.query.key);
1347
+ if (defaultValue != null) {
1348
+ return resolve(defaultValue);
1349
+ }
1339
1350
  return reject('key is not found.');
1340
1351
  }
1341
- return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => err ? reject(err) : resolve(data));
1352
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => {
1353
+ if (err) {
1354
+ if (defaultValue != null) {
1355
+ return resolve(defaultValue);
1356
+ }
1357
+ return reject(err);
1358
+ }
1359
+ if (!Array.isArray(data)) {
1360
+ return resolve(data);
1361
+ }
1362
+ if (data.length !== 0) {
1363
+ return resolve(data[0]);
1364
+ }
1365
+ if (defaultValue != null) {
1366
+ return resolve(defaultValue);
1367
+ }
1368
+ return resolve(data);
1369
+ });
1342
1370
  });
1343
1371
  /** @internal */
1344
1372
  const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
@@ -1346,21 +1374,42 @@ const loadActionTableRows = async (config, data, api_key, endpoint) => new Promi
1346
1374
  console.warn('key is not defined.');
1347
1375
  return reject('key is not defined.');
1348
1376
  }
1377
+ const defaultValue = config.query.default_value ?? null;
1349
1378
  const keys = [];
1350
1379
  let hasError = false;
1351
1380
  const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
1352
1381
  originalKeys.forEach(key => {
1353
1382
  const d = data[key];
1354
- if (d == null) {
1383
+ if (d == null || d === '') {
1355
1384
  console.warn('key is not found. key: ', key);
1356
1385
  hasError = true;
1357
1386
  }
1358
1387
  keys.push(d);
1359
1388
  });
1360
1389
  if (hasError) {
1390
+ if (defaultValue != null) {
1391
+ return resolve(defaultValue);
1392
+ }
1361
1393
  return reject('key is not found.');
1362
1394
  }
1363
- return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => (err ? reject(err) : resolve(data)));
1395
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => {
1396
+ if (err) {
1397
+ if (defaultValue != null) {
1398
+ return resolve(defaultValue);
1399
+ }
1400
+ return reject(err);
1401
+ }
1402
+ if (!Array.isArray(data)) {
1403
+ return resolve([data]);
1404
+ }
1405
+ if (data.length !== 0) {
1406
+ return resolve(data);
1407
+ }
1408
+ if (defaultValue != null) {
1409
+ return resolve(defaultValue);
1410
+ }
1411
+ return resolve(data);
1412
+ });
1364
1413
  });
1365
1414
  /** @internal */
1366
1415
  const loadActionTableQuery = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
@@ -1368,20 +1417,41 @@ const loadActionTableQuery = async (config, data, api_key, endpoint) => new Prom
1368
1417
  console.warn('key is not defined.');
1369
1418
  return reject('key is not defined.');
1370
1419
  }
1420
+ const defaultValue = config.query.default_value ?? null;
1371
1421
  const params = {};
1372
1422
  let hasError = false;
1373
1423
  Object.entries(config.query.params).forEach(([key, param]) => {
1374
1424
  const d = data[param];
1375
- if (d == null) {
1425
+ if (d == null || d === '') {
1376
1426
  console.warn('key is not found. param: ', param);
1377
1427
  hasError = true;
1378
1428
  }
1379
1429
  params[key] = d;
1380
1430
  });
1381
1431
  if (hasError) {
1432
+ if (defaultValue != null) {
1433
+ return resolve(defaultValue);
1434
+ }
1382
1435
  return reject('key is not found.');
1383
1436
  }
1384
- return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => (err ? reject(err) : resolve(data)));
1437
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => {
1438
+ if (err) {
1439
+ if (defaultValue != null) {
1440
+ return resolve(defaultValue);
1441
+ }
1442
+ return reject(err);
1443
+ }
1444
+ if (!Array.isArray(data)) {
1445
+ return resolve([data]);
1446
+ }
1447
+ if (data.length !== 0) {
1448
+ return resolve(data);
1449
+ }
1450
+ if (defaultValue != null) {
1451
+ return resolve(defaultValue);
1452
+ }
1453
+ return resolve(data);
1454
+ });
1385
1455
  });
1386
1456
  /** @internal */
1387
1457
  const loadActionTable = async (config, data, api_key, endpoint) => {
@@ -6493,7 +6563,7 @@ class MovieVimeoElement extends SvelteComponent {
6493
6563
  /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
6494
6564
 
6495
6565
  function add_css$g(target) {
6496
- append_styles(target, "svelte-13z4kn0", ".textarea-wrapper.svelte-13z4kn0{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-13z4kn0{width:100%;resize:none}");
6566
+ append_styles(target, "svelte-1fjy5oo", ".textarea-wrapper.svelte-1fjy5oo{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-1fjy5oo{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.textarea.svelte-1fjy5oo::placeholder{color:var(--placeholder-color)}.textarea.svelte-1fjy5oo:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}");
6497
6567
  }
6498
6568
 
6499
6569
  function create_fragment$h(ctx) {
@@ -6509,13 +6579,13 @@ function create_fragment$h(ctx) {
6509
6579
  this.h();
6510
6580
  },
6511
6581
  l(nodes) {
6512
- div = claim_element(nodes, "DIV", { class: true });
6582
+ div = claim_element(nodes, "DIV", { class: true, style: true });
6513
6583
  var div_nodes = children(div);
6514
6584
 
6515
6585
  textarea = claim_element(div_nodes, "TEXTAREA", {
6516
6586
  class: true,
6517
- rows: true,
6518
- placeholder: true
6587
+ placeholder: true,
6588
+ style: true
6519
6589
  });
6520
6590
 
6521
6591
  children(textarea).forEach(detach);
@@ -6523,37 +6593,42 @@ function create_fragment$h(ctx) {
6523
6593
  this.h();
6524
6594
  },
6525
6595
  h() {
6526
- attr(textarea, "class", "textarea svelte-13z4kn0");
6527
- textarea.value = /*$value*/ ctx[3];
6528
- textarea.required = /*required*/ ctx[0];
6529
- attr(textarea, "rows", /*rows*/ ctx[1]);
6530
- attr(textarea, "placeholder", /*placeholder*/ ctx[2]);
6531
- attr(div, "class", "textarea-wrapper svelte-13z4kn0");
6596
+ attr(textarea, "class", "textarea svelte-1fjy5oo");
6597
+ textarea.value = /*$value*/ ctx[4];
6598
+ textarea.required = /*required*/ ctx[1];
6599
+ attr(textarea, "placeholder", /*placeholder*/ ctx[0]);
6600
+ attr(textarea, "style", /*style*/ ctx[3]);
6601
+ attr(div, "class", "textarea-wrapper svelte-1fjy5oo");
6602
+ attr(div, "style", /*styleVariables*/ ctx[2]);
6532
6603
  },
6533
6604
  m(target, anchor) {
6534
6605
  insert_hydration(target, div, anchor);
6535
6606
  append_hydration(div, textarea);
6536
6607
 
6537
6608
  if (!mounted) {
6538
- dispose = listen(textarea, "input", /*handleInput*/ ctx[5]);
6609
+ dispose = listen(textarea, "input", /*handleInput*/ ctx[6]);
6539
6610
  mounted = true;
6540
6611
  }
6541
6612
  },
6542
6613
  p(ctx, [dirty]) {
6543
- if (dirty & /*$value*/ 8) {
6544
- textarea.value = /*$value*/ ctx[3];
6614
+ if (dirty & /*$value*/ 16) {
6615
+ textarea.value = /*$value*/ ctx[4];
6545
6616
  }
6546
6617
 
6547
- if (dirty & /*required*/ 1) {
6548
- textarea.required = /*required*/ ctx[0];
6618
+ if (dirty & /*required*/ 2) {
6619
+ textarea.required = /*required*/ ctx[1];
6549
6620
  }
6550
6621
 
6551
- if (dirty & /*rows*/ 2) {
6552
- attr(textarea, "rows", /*rows*/ ctx[1]);
6622
+ if (dirty & /*placeholder*/ 1) {
6623
+ attr(textarea, "placeholder", /*placeholder*/ ctx[0]);
6553
6624
  }
6554
6625
 
6555
- if (dirty & /*placeholder*/ 4) {
6556
- attr(textarea, "placeholder", /*placeholder*/ ctx[2]);
6626
+ if (dirty & /*style*/ 8) {
6627
+ attr(textarea, "style", /*style*/ ctx[3]);
6628
+ }
6629
+
6630
+ if (dirty & /*styleVariables*/ 4) {
6631
+ attr(div, "style", /*styleVariables*/ ctx[2]);
6557
6632
  }
6558
6633
  },
6559
6634
  i: noop,
@@ -6567,11 +6642,17 @@ function create_fragment$h(ctx) {
6567
6642
  }
6568
6643
 
6569
6644
  function instance$h($$self, $$props, $$invalidate) {
6645
+ let style;
6646
+ let styleVariables;
6570
6647
  let $value;
6571
6648
  let { name = '' } = $$props;
6649
+ let { placeholder = '回答を入力してください' } = $$props;
6572
6650
  let { required = true } = $$props;
6573
- let { rows = 2 } = $$props;
6574
- let { placeholder = '' } = $$props;
6651
+ let { _style = '' } = $$props;
6652
+ let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
6653
+ let { font = SYSTEM_FONT } = $$props;
6654
+ let { _textStyle = '' } = $$props;
6655
+ let { _placeholderStyle = 'color: #ccc;' } = $$props;
6575
6656
  const { path: statePath } = getStateItemContext();
6576
6657
 
6577
6658
  const value = registerInput({
@@ -6583,7 +6664,7 @@ function instance$h($$self, $$props, $$invalidate) {
6583
6664
  }
6584
6665
  });
6585
6666
 
6586
- component_subscribe($$self, value, value => $$invalidate(3, $value = value));
6667
+ component_subscribe($$self, value, value => $$invalidate(4, $value = value));
6587
6668
 
6588
6669
  function handleInput(event) {
6589
6670
  const updated = event.target.value;
@@ -6591,13 +6672,54 @@ function instance$h($$self, $$props, $$invalidate) {
6591
6672
  }
6592
6673
 
6593
6674
  $$self.$$set = $$props => {
6594
- if ('name' in $$props) $$invalidate(6, name = $$props.name);
6595
- if ('required' in $$props) $$invalidate(0, required = $$props.required);
6596
- if ('rows' in $$props) $$invalidate(1, rows = $$props.rows);
6597
- if ('placeholder' in $$props) $$invalidate(2, placeholder = $$props.placeholder);
6675
+ if ('name' in $$props) $$invalidate(7, name = $$props.name);
6676
+ if ('placeholder' in $$props) $$invalidate(0, placeholder = $$props.placeholder);
6677
+ if ('required' in $$props) $$invalidate(1, required = $$props.required);
6678
+ if ('_style' in $$props) $$invalidate(8, _style = $$props._style);
6679
+ if ('_focusStyle' in $$props) $$invalidate(9, _focusStyle = $$props._focusStyle);
6680
+ if ('font' in $$props) $$invalidate(10, font = $$props.font);
6681
+ if ('_textStyle' in $$props) $$invalidate(11, _textStyle = $$props._textStyle);
6682
+ if ('_placeholderStyle' in $$props) $$invalidate(12, _placeholderStyle = $$props._placeholderStyle);
6598
6683
  };
6599
6684
 
6600
- return [required, rows, placeholder, $value, value, handleInput, name];
6685
+ $$self.$$.update = () => {
6686
+ if ($$self.$$.dirty & /*font*/ 1024) {
6687
+ addFont(font);
6688
+ }
6689
+
6690
+ if ($$self.$$.dirty & /*_style, _textStyle, font*/ 3328) {
6691
+ $$invalidate(3, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
6692
+ }
6693
+
6694
+ if ($$self.$$.dirty & /*_focusStyle, _placeholderStyle*/ 4608) {
6695
+ $$invalidate(2, styleVariables = (() => {
6696
+ const variables = {};
6697
+ const focusStyleObj = parseStyle(_focusStyle);
6698
+ const placeholderStyle = parseStyle(_placeholderStyle);
6699
+ if (focusStyleObj['border-width']) variables['--focus-border-width'] = focusStyleObj['border-width'];
6700
+ if (focusStyleObj['border-color']) variables['--focus-border-color'] = focusStyleObj['border-color'];
6701
+ if (focusStyleObj['border-style']) variables['--focus-border-style'] = focusStyleObj['border-style'];
6702
+ if (placeholderStyle.color) variables['--placeholder-color'] = placeholderStyle.color;
6703
+ return stringifyStyleObj(variables);
6704
+ })());
6705
+ }
6706
+ };
6707
+
6708
+ return [
6709
+ placeholder,
6710
+ required,
6711
+ styleVariables,
6712
+ style,
6713
+ $value,
6714
+ value,
6715
+ handleInput,
6716
+ name,
6717
+ _style,
6718
+ _focusStyle,
6719
+ font,
6720
+ _textStyle,
6721
+ _placeholderStyle
6722
+ ];
6601
6723
  }
6602
6724
 
6603
6725
  class FormTextarea extends SvelteComponent {
@@ -6611,10 +6733,14 @@ class FormTextarea extends SvelteComponent {
6611
6733
  create_fragment$h,
6612
6734
  safe_not_equal,
6613
6735
  {
6614
- name: 6,
6615
- required: 0,
6616
- rows: 1,
6617
- placeholder: 2
6736
+ name: 7,
6737
+ placeholder: 0,
6738
+ required: 1,
6739
+ _style: 8,
6740
+ _focusStyle: 9,
6741
+ font: 10,
6742
+ _textStyle: 11,
6743
+ _placeholderStyle: 12
6618
6744
  },
6619
6745
  add_css$g
6620
6746
  );
@@ -6629,12 +6755,12 @@ function add_css$f(target) {
6629
6755
 
6630
6756
  function get_each_context$5(ctx, list, i) {
6631
6757
  const child_ctx = ctx.slice();
6632
- child_ctx[16] = list[i];
6633
- child_ctx[18] = i;
6758
+ child_ctx[17] = list[i];
6759
+ child_ctx[19] = i;
6634
6760
  return child_ctx;
6635
6761
  }
6636
6762
 
6637
- // (98:2) {#each _options as option, i}
6763
+ // (99:2) {#each _options as option, i}
6638
6764
  function create_each_block$5(ctx) {
6639
6765
  let label;
6640
6766
  let input;
@@ -6642,8 +6768,9 @@ function create_each_block$5(ctx) {
6642
6768
  let input_checked_value;
6643
6769
  let t0;
6644
6770
  let span;
6645
- let t1_value = /*option*/ ctx[16] + "";
6771
+ let t1_value = /*option*/ ctx[17] + "";
6646
6772
  let t1;
6773
+ let span_style_value;
6647
6774
  let t2;
6648
6775
  let mounted;
6649
6776
  let dispose;
@@ -6683,10 +6810,10 @@ function create_each_block$5(ctx) {
6683
6810
  attr(input, "class", "radio-button-input svelte-1ntb6j8");
6684
6811
  attr(input, "style", /*buttonStyle*/ ctx[5]);
6685
6812
  attr(input, "name", /*name*/ ctx[0]);
6686
- input.value = input_value_value = /*option*/ ctx[16];
6687
- input.checked = input_checked_value = /*option*/ ctx[16] === /*_value*/ ctx[3];
6813
+ input.value = input_value_value = /*option*/ ctx[17];
6814
+ input.checked = input_checked_value = /*option*/ ctx[17] === /*_value*/ ctx[3];
6688
6815
  attr(span, "class", "radio-button-text svelte-1ntb6j8");
6689
- attr(span, "style", /*_textStyle*/ ctx[2]);
6816
+ attr(span, "style", span_style_value = `${/*_textStyle*/ ctx[2]} ${/*fontCss*/ ctx[6]}`);
6690
6817
  attr(label, "class", "radio-button svelte-1ntb6j8");
6691
6818
  },
6692
6819
  m(target, anchor) {
@@ -6698,7 +6825,7 @@ function create_each_block$5(ctx) {
6698
6825
  append_hydration(label, t2);
6699
6826
 
6700
6827
  if (!mounted) {
6701
- dispose = listen(input, "change", /*handleChange*/ ctx[7](/*i*/ ctx[18]));
6828
+ dispose = listen(input, "change", /*handleChange*/ ctx[8](/*i*/ ctx[19]));
6702
6829
  mounted = true;
6703
6830
  }
6704
6831
  },
@@ -6713,18 +6840,18 @@ function create_each_block$5(ctx) {
6713
6840
  attr(input, "name", /*name*/ ctx[0]);
6714
6841
  }
6715
6842
 
6716
- if (dirty & /*_options*/ 16 && input_value_value !== (input_value_value = /*option*/ ctx[16])) {
6843
+ if (dirty & /*_options*/ 16 && input_value_value !== (input_value_value = /*option*/ ctx[17])) {
6717
6844
  input.value = input_value_value;
6718
6845
  }
6719
6846
 
6720
- if (dirty & /*_options, _value*/ 24 && input_checked_value !== (input_checked_value = /*option*/ ctx[16] === /*_value*/ ctx[3])) {
6847
+ if (dirty & /*_options, _value*/ 24 && input_checked_value !== (input_checked_value = /*option*/ ctx[17] === /*_value*/ ctx[3])) {
6721
6848
  input.checked = input_checked_value;
6722
6849
  }
6723
6850
 
6724
- if (dirty & /*_options*/ 16 && t1_value !== (t1_value = /*option*/ ctx[16] + "")) set_data(t1, t1_value);
6851
+ if (dirty & /*_options*/ 16 && t1_value !== (t1_value = /*option*/ ctx[17] + "")) set_data(t1, t1_value);
6725
6852
 
6726
- if (dirty & /*_textStyle*/ 4) {
6727
- attr(span, "style", /*_textStyle*/ ctx[2]);
6853
+ if (dirty & /*_textStyle*/ 4 && span_style_value !== (span_style_value = `${/*_textStyle*/ ctx[2]} ${/*fontCss*/ ctx[6]}`)) {
6854
+ attr(span, "style", span_style_value);
6728
6855
  }
6729
6856
  },
6730
6857
  d(detaching) {
@@ -6777,7 +6904,7 @@ function create_fragment$g(ctx) {
6777
6904
  }
6778
6905
  },
6779
6906
  p(ctx, [dirty]) {
6780
- if (dirty & /*_textStyle, _options, buttonStyle, name, _value, handleChange*/ 189) {
6907
+ if (dirty & /*_textStyle, fontCss, _options, buttonStyle, name, _value, handleChange*/ 381) {
6781
6908
  each_value = /*_options*/ ctx[4];
6782
6909
  let i;
6783
6910
 
@@ -6823,6 +6950,7 @@ function instance$g($$self, $$props, $$invalidate) {
6823
6950
  let { required = false } = $$props;
6824
6951
  let { _layoutStyle = 'flex-direction: column; gap: 0px;' } = $$props;
6825
6952
  let { font = SYSTEM_FONT } = $$props;
6953
+ const fontCss = font ? 'font-family:' + font : '';
6826
6954
  let { _textStyle = 'color: #333; font-size: 12px; line-height:1.5;' } = $$props;
6827
6955
  let { buttonSize = '16px' } = $$props;
6828
6956
  let { buttonColor = { main: '#f0f1f1', sub: '#f0f1f1' } } = $$props;
@@ -6839,7 +6967,7 @@ function instance$g($$self, $$props, $$invalidate) {
6839
6967
  }
6840
6968
  });
6841
6969
 
6842
- component_subscribe($$self, value, value => $$invalidate(14, $value = value));
6970
+ component_subscribe($$self, value, value => $$invalidate(15, $value = value));
6843
6971
 
6844
6972
  const handleChange = index => event => {
6845
6973
  if (event.target.checked) {
@@ -6849,26 +6977,26 @@ function instance$g($$self, $$props, $$invalidate) {
6849
6977
 
6850
6978
  $$self.$$set = $$props => {
6851
6979
  if ('name' in $$props) $$invalidate(0, name = $$props.name);
6852
- if ('options' in $$props) $$invalidate(8, options = $$props.options);
6853
- if ('required' in $$props) $$invalidate(9, required = $$props.required);
6980
+ if ('options' in $$props) $$invalidate(9, options = $$props.options);
6981
+ if ('required' in $$props) $$invalidate(10, required = $$props.required);
6854
6982
  if ('_layoutStyle' in $$props) $$invalidate(1, _layoutStyle = $$props._layoutStyle);
6855
- if ('font' in $$props) $$invalidate(10, font = $$props.font);
6983
+ if ('font' in $$props) $$invalidate(11, font = $$props.font);
6856
6984
  if ('_textStyle' in $$props) $$invalidate(2, _textStyle = $$props._textStyle);
6857
- if ('buttonSize' in $$props) $$invalidate(11, buttonSize = $$props.buttonSize);
6858
- if ('buttonColor' in $$props) $$invalidate(12, buttonColor = $$props.buttonColor);
6859
- if ('buttonColorActive' in $$props) $$invalidate(13, buttonColorActive = $$props.buttonColorActive);
6985
+ if ('buttonSize' in $$props) $$invalidate(12, buttonSize = $$props.buttonSize);
6986
+ if ('buttonColor' in $$props) $$invalidate(13, buttonColor = $$props.buttonColor);
6987
+ if ('buttonColorActive' in $$props) $$invalidate(14, buttonColorActive = $$props.buttonColorActive);
6860
6988
  };
6861
6989
 
6862
6990
  $$self.$$.update = () => {
6863
- if ($$self.$$.dirty & /*font*/ 1024) {
6991
+ if ($$self.$$.dirty & /*font*/ 2048) {
6864
6992
  addFont(font);
6865
6993
  }
6866
6994
 
6867
- if ($$self.$$.dirty & /*options*/ 256) {
6995
+ if ($$self.$$.dirty & /*options*/ 512) {
6868
6996
  $$invalidate(4, _options = options.split(','));
6869
6997
  }
6870
6998
 
6871
- if ($$self.$$.dirty & /*buttonColor, buttonColorActive, buttonSize*/ 14336) {
6999
+ if ($$self.$$.dirty & /*buttonColor, buttonColorActive, buttonSize*/ 28672) {
6872
7000
  $$invalidate(5, buttonStyle = (() => {
6873
7001
  return stringifyStyleObj({
6874
7002
  '--color-main': buttonColor.main,
@@ -6880,7 +7008,7 @@ function instance$g($$self, $$props, $$invalidate) {
6880
7008
  })());
6881
7009
  }
6882
7010
 
6883
- if ($$self.$$.dirty & /*$value*/ 16384) {
7011
+ if ($$self.$$.dirty & /*$value*/ 32768) {
6884
7012
  $$invalidate(3, _value = $value[0]);
6885
7013
  }
6886
7014
  };
@@ -6892,6 +7020,7 @@ function instance$g($$self, $$props, $$invalidate) {
6892
7020
  _value,
6893
7021
  _options,
6894
7022
  buttonStyle,
7023
+ fontCss,
6895
7024
  value,
6896
7025
  handleChange,
6897
7026
  options,
@@ -6916,14 +7045,14 @@ class FormRadioButtons extends SvelteComponent {
6916
7045
  safe_not_equal,
6917
7046
  {
6918
7047
  name: 0,
6919
- options: 8,
6920
- required: 9,
7048
+ options: 9,
7049
+ required: 10,
6921
7050
  _layoutStyle: 1,
6922
- font: 10,
7051
+ font: 11,
6923
7052
  _textStyle: 2,
6924
- buttonSize: 11,
6925
- buttonColor: 12,
6926
- buttonColorActive: 13
7053
+ buttonSize: 12,
7054
+ buttonColor: 13,
7055
+ buttonColorActive: 14
6927
7056
  },
6928
7057
  add_css$f
6929
7058
  );
@@ -6943,7 +7072,7 @@ function get_each_context$4(ctx, list, i) {
6943
7072
  return child_ctx;
6944
7073
  }
6945
7074
 
6946
- // (108:10) {:else}
7075
+ // (107:10) {:else}
6947
7076
  function create_else_block(ctx) {
6948
7077
  let t;
6949
7078
 
@@ -6966,7 +7095,7 @@ function create_else_block(ctx) {
6966
7095
  };
6967
7096
  }
6968
7097
 
6969
- // (106:10) {#if option}
7098
+ // (105:10) {#if option}
6970
7099
  function create_if_block$2(ctx) {
6971
7100
  let t_value = /*option*/ ctx[19] + "";
6972
7101
  let t;
@@ -6990,7 +7119,7 @@ function create_if_block$2(ctx) {
6990
7119
  };
6991
7120
  }
6992
7121
 
6993
- // (104:6) {#each _options as option, i}
7122
+ // (103:6) {#each _options as option, i}
6994
7123
  function create_each_block$4(ctx) {
6995
7124
  let option;
6996
7125
  let t;
@@ -7232,11 +7361,12 @@ function instance$f($$self, $$props, $$invalidate) {
7232
7361
  $$invalidate(1, _value = $value[0]);
7233
7362
  }
7234
7363
 
7235
- if ($$self.$$.dirty & /*_style, _textStyle, _value, _placeholderStyle*/ 25602) {
7364
+ if ($$self.$$.dirty & /*_style, _textStyle, _value, _placeholderStyle, font*/ 29698) {
7236
7365
  $$invalidate(3, style = [
7237
7366
  ..._style.split(';'),
7238
7367
  ..._textStyle.split(';'),
7239
- ...!_value ? _placeholderStyle.split(';') : []
7368
+ ...!_value ? _placeholderStyle.split(';') : [],
7369
+ `font-family:${font}`
7240
7370
  ].join(';'));
7241
7371
  }
7242
7372
 
@@ -7244,11 +7374,10 @@ function instance$f($$self, $$props, $$invalidate) {
7244
7374
  $$invalidate(2, styleVariables = (() => {
7245
7375
  const variables = {};
7246
7376
  const focusStyleObj = parseStyle(_focusStyle);
7247
- const placeholderStyle = parseStyle(_placeholderStyle);
7377
+ parseStyle(_placeholderStyle);
7248
7378
  if (focusStyleObj['border-width']) variables['--focus-border-width'] = focusStyleObj['border-width'];
7249
7379
  if (focusStyleObj['border-color']) variables['--focus-border-color'] = focusStyleObj['border-color'];
7250
7380
  if (focusStyleObj['border-style']) variables['--focus-border-style'] = focusStyleObj['border-style'];
7251
- if (placeholderStyle.color) variables['--placeholder-color'] = placeholderStyle.color;
7252
7381
  variables['--icon-color'] = iconColor;
7253
7382
  variables['--icon-size'] = iconSize;
7254
7383
  return stringifyStyleObj(variables);
@@ -7813,9 +7942,11 @@ function instance$d($$self, $$props, $$invalidate) {
7813
7942
  };
7814
7943
 
7815
7944
  function getTextButtonStyle(isActive) {
7816
- return isActive
7817
- ? [...buttonStyle.split(';'), ...buttonActiveStyle.split(';')].join(';')
7818
- : buttonStyle;
7945
+ return [
7946
+ ...buttonStyle.split(';'),
7947
+ `font-family:${font}`,
7948
+ ...isActive ? buttonActiveStyle : []
7949
+ ].join(';');
7819
7950
  }
7820
7951
 
7821
7952
  $$self.$$set = $$props => {
package/dist/index.es.js CHANGED
@@ -1347,21 +1347,49 @@ function request(url, data, cb) {
1347
1347
  'Content-Type': 'text/plain;charset=UTF-8',
1348
1348
  },
1349
1349
  body: JSON.stringify({ ...data }),
1350
- }).then(response => {
1350
+ })
1351
+ .then(response => {
1351
1352
  if (!response.ok) {
1352
- return cb(new Error(`fail to request collection api. reason: ${response.status}`));
1353
+ throw new Error(`fail to request collection api. reason: ${response.status}`);
1353
1354
  }
1354
- return cb(null, response.json());
1355
+ return response.json();
1356
+ })
1357
+ .then(data => {
1358
+ return cb(null, data);
1359
+ })
1360
+ .catch(err => {
1361
+ return cb(err, null);
1355
1362
  });
1356
1363
  }
1357
1364
  /** @internal */
1358
1365
  const loadActionTableRow = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
1366
+ const defaultValue = config.query.default_value ?? null;
1359
1367
  const key = data[config.query.key] ?? null;
1360
1368
  if (key == null) {
1361
1369
  console.warn('key is not found. key: ', config.query.key);
1370
+ if (defaultValue != null) {
1371
+ return resolve(defaultValue);
1372
+ }
1362
1373
  return reject('key is not found.');
1363
1374
  }
1364
- return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => err ? reject(err) : resolve(data));
1375
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).get(key, (err, data) => {
1376
+ if (err) {
1377
+ if (defaultValue != null) {
1378
+ return resolve(defaultValue);
1379
+ }
1380
+ return reject(err);
1381
+ }
1382
+ if (!Array.isArray(data)) {
1383
+ return resolve(data);
1384
+ }
1385
+ if (data.length !== 0) {
1386
+ return resolve(data[0]);
1387
+ }
1388
+ if (defaultValue != null) {
1389
+ return resolve(defaultValue);
1390
+ }
1391
+ return resolve(data);
1392
+ });
1365
1393
  });
1366
1394
  /** @internal */
1367
1395
  const loadActionTableRows = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
@@ -1369,21 +1397,42 @@ const loadActionTableRows = async (config, data, api_key, endpoint) => new Promi
1369
1397
  console.warn('key is not defined.');
1370
1398
  return reject('key is not defined.');
1371
1399
  }
1400
+ const defaultValue = config.query.default_value ?? null;
1372
1401
  const keys = [];
1373
1402
  let hasError = false;
1374
1403
  const originalKeys = Array.isArray(config.query.key) ? config.query.key : [config.query.key];
1375
1404
  originalKeys.forEach(key => {
1376
1405
  const d = data[key];
1377
- if (d == null) {
1406
+ if (d == null || d === '') {
1378
1407
  console.warn('key is not found. key: ', key);
1379
1408
  hasError = true;
1380
1409
  }
1381
1410
  keys.push(d);
1382
1411
  });
1383
1412
  if (hasError) {
1413
+ if (defaultValue != null) {
1414
+ return resolve(defaultValue);
1415
+ }
1384
1416
  return reject('key is not found.');
1385
1417
  }
1386
- return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => (err ? reject(err) : resolve(data)));
1418
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).get(keys, (err, data) => {
1419
+ if (err) {
1420
+ if (defaultValue != null) {
1421
+ return resolve(defaultValue);
1422
+ }
1423
+ return reject(err);
1424
+ }
1425
+ if (!Array.isArray(data)) {
1426
+ return resolve([data]);
1427
+ }
1428
+ if (data.length !== 0) {
1429
+ return resolve(data);
1430
+ }
1431
+ if (defaultValue != null) {
1432
+ return resolve(defaultValue);
1433
+ }
1434
+ return resolve(data);
1435
+ });
1387
1436
  });
1388
1437
  /** @internal */
1389
1438
  const loadActionTableQuery = async (config, data, api_key, endpoint) => new Promise((resolve, reject) => {
@@ -1391,20 +1440,41 @@ const loadActionTableQuery = async (config, data, api_key, endpoint) => new Prom
1391
1440
  console.warn('key is not defined.');
1392
1441
  return reject('key is not defined.');
1393
1442
  }
1443
+ const defaultValue = config.query.default_value ?? null;
1394
1444
  const params = {};
1395
1445
  let hasError = false;
1396
1446
  Object.entries(config.query.params).forEach(([key, param]) => {
1397
1447
  const d = data[param];
1398
- if (d == null) {
1448
+ if (d == null || d === '') {
1399
1449
  console.warn('key is not found. param: ', param);
1400
1450
  hasError = true;
1401
1451
  }
1402
1452
  params[key] = d;
1403
1453
  });
1404
1454
  if (hasError) {
1455
+ if (defaultValue != null) {
1456
+ return resolve(defaultValue);
1457
+ }
1405
1458
  return reject('key is not found.');
1406
1459
  }
1407
- return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => (err ? reject(err) : resolve(data)));
1460
+ return collection$1({ endpoint, api_key, table: config.query.table_name }).getByQuery(config.query.query_name, params, null, (err, data) => {
1461
+ if (err) {
1462
+ if (defaultValue != null) {
1463
+ return resolve(defaultValue);
1464
+ }
1465
+ return reject(err);
1466
+ }
1467
+ if (!Array.isArray(data)) {
1468
+ return resolve([data]);
1469
+ }
1470
+ if (data.length !== 0) {
1471
+ return resolve(data);
1472
+ }
1473
+ if (defaultValue != null) {
1474
+ return resolve(defaultValue);
1475
+ }
1476
+ return resolve(data);
1477
+ });
1408
1478
  });
1409
1479
  /** @internal */
1410
1480
  const loadActionTable = async (config, data, api_key, endpoint) => {
@@ -6242,7 +6312,7 @@ class MovieVimeoElement extends SvelteComponent {
6242
6312
  /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
6243
6313
 
6244
6314
  function add_css$g(target) {
6245
- append_styles(target, "svelte-13z4kn0", ".textarea-wrapper.svelte-13z4kn0{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-13z4kn0{width:100%;resize:none}");
6315
+ append_styles(target, "svelte-1fjy5oo", ".textarea-wrapper.svelte-1fjy5oo{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-1fjy5oo{width:100%;height:100%;box-sizing:border-box;resize:none;appearance:none;background-color:#fff;border:solid 2px #ccc;border-radius:6px;padding:6px 10px 6px 10px;font-size:12px;line-height:1.5}.textarea.svelte-1fjy5oo::placeholder{color:var(--placeholder-color)}.textarea.svelte-1fjy5oo:focus{outline:none;border-width:var(--focus-border-width) !important;border-color:var(--focus-border-color) !important;border-style:var(--focus-border-style) !important}");
6246
6316
  }
6247
6317
 
6248
6318
  function create_fragment$h(ctx) {
@@ -6255,37 +6325,42 @@ function create_fragment$h(ctx) {
6255
6325
  c() {
6256
6326
  div = element("div");
6257
6327
  textarea = element("textarea");
6258
- attr(textarea, "class", "textarea svelte-13z4kn0");
6259
- textarea.value = /*$value*/ ctx[3];
6260
- textarea.required = /*required*/ ctx[0];
6261
- attr(textarea, "rows", /*rows*/ ctx[1]);
6262
- attr(textarea, "placeholder", /*placeholder*/ ctx[2]);
6263
- attr(div, "class", "textarea-wrapper svelte-13z4kn0");
6328
+ attr(textarea, "class", "textarea svelte-1fjy5oo");
6329
+ textarea.value = /*$value*/ ctx[4];
6330
+ textarea.required = /*required*/ ctx[1];
6331
+ attr(textarea, "placeholder", /*placeholder*/ ctx[0]);
6332
+ attr(textarea, "style", /*style*/ ctx[3]);
6333
+ attr(div, "class", "textarea-wrapper svelte-1fjy5oo");
6334
+ attr(div, "style", /*styleVariables*/ ctx[2]);
6264
6335
  },
6265
6336
  m(target, anchor) {
6266
6337
  insert(target, div, anchor);
6267
6338
  append(div, textarea);
6268
6339
 
6269
6340
  if (!mounted) {
6270
- dispose = listen(textarea, "input", /*handleInput*/ ctx[5]);
6341
+ dispose = listen(textarea, "input", /*handleInput*/ ctx[6]);
6271
6342
  mounted = true;
6272
6343
  }
6273
6344
  },
6274
6345
  p(ctx, [dirty]) {
6275
- if (dirty & /*$value*/ 8) {
6276
- textarea.value = /*$value*/ ctx[3];
6346
+ if (dirty & /*$value*/ 16) {
6347
+ textarea.value = /*$value*/ ctx[4];
6348
+ }
6349
+
6350
+ if (dirty & /*required*/ 2) {
6351
+ textarea.required = /*required*/ ctx[1];
6277
6352
  }
6278
6353
 
6279
- if (dirty & /*required*/ 1) {
6280
- textarea.required = /*required*/ ctx[0];
6354
+ if (dirty & /*placeholder*/ 1) {
6355
+ attr(textarea, "placeholder", /*placeholder*/ ctx[0]);
6281
6356
  }
6282
6357
 
6283
- if (dirty & /*rows*/ 2) {
6284
- attr(textarea, "rows", /*rows*/ ctx[1]);
6358
+ if (dirty & /*style*/ 8) {
6359
+ attr(textarea, "style", /*style*/ ctx[3]);
6285
6360
  }
6286
6361
 
6287
- if (dirty & /*placeholder*/ 4) {
6288
- attr(textarea, "placeholder", /*placeholder*/ ctx[2]);
6362
+ if (dirty & /*styleVariables*/ 4) {
6363
+ attr(div, "style", /*styleVariables*/ ctx[2]);
6289
6364
  }
6290
6365
  },
6291
6366
  i: noop,
@@ -6299,11 +6374,17 @@ function create_fragment$h(ctx) {
6299
6374
  }
6300
6375
 
6301
6376
  function instance$h($$self, $$props, $$invalidate) {
6377
+ let style;
6378
+ let styleVariables;
6302
6379
  let $value;
6303
6380
  let { name = '' } = $$props;
6381
+ let { placeholder = '回答を入力してください' } = $$props;
6304
6382
  let { required = true } = $$props;
6305
- let { rows = 2 } = $$props;
6306
- let { placeholder = '' } = $$props;
6383
+ let { _style = '' } = $$props;
6384
+ let { _focusStyle = 'border-width: 2px; border-color: #2aab9f; border-style: solid' } = $$props;
6385
+ let { font = SYSTEM_FONT } = $$props;
6386
+ let { _textStyle = '' } = $$props;
6387
+ let { _placeholderStyle = 'color: #ccc;' } = $$props;
6307
6388
  const { path: statePath } = getStateItemContext();
6308
6389
 
6309
6390
  const value = registerInput({
@@ -6315,7 +6396,7 @@ function instance$h($$self, $$props, $$invalidate) {
6315
6396
  }
6316
6397
  });
6317
6398
 
6318
- component_subscribe($$self, value, value => $$invalidate(3, $value = value));
6399
+ component_subscribe($$self, value, value => $$invalidate(4, $value = value));
6319
6400
 
6320
6401
  function handleInput(event) {
6321
6402
  const updated = event.target.value;
@@ -6323,13 +6404,54 @@ function instance$h($$self, $$props, $$invalidate) {
6323
6404
  }
6324
6405
 
6325
6406
  $$self.$$set = $$props => {
6326
- if ('name' in $$props) $$invalidate(6, name = $$props.name);
6327
- if ('required' in $$props) $$invalidate(0, required = $$props.required);
6328
- if ('rows' in $$props) $$invalidate(1, rows = $$props.rows);
6329
- if ('placeholder' in $$props) $$invalidate(2, placeholder = $$props.placeholder);
6407
+ if ('name' in $$props) $$invalidate(7, name = $$props.name);
6408
+ if ('placeholder' in $$props) $$invalidate(0, placeholder = $$props.placeholder);
6409
+ if ('required' in $$props) $$invalidate(1, required = $$props.required);
6410
+ if ('_style' in $$props) $$invalidate(8, _style = $$props._style);
6411
+ if ('_focusStyle' in $$props) $$invalidate(9, _focusStyle = $$props._focusStyle);
6412
+ if ('font' in $$props) $$invalidate(10, font = $$props.font);
6413
+ if ('_textStyle' in $$props) $$invalidate(11, _textStyle = $$props._textStyle);
6414
+ if ('_placeholderStyle' in $$props) $$invalidate(12, _placeholderStyle = $$props._placeholderStyle);
6415
+ };
6416
+
6417
+ $$self.$$.update = () => {
6418
+ if ($$self.$$.dirty & /*font*/ 1024) {
6419
+ addFont(font);
6420
+ }
6421
+
6422
+ if ($$self.$$.dirty & /*_style, _textStyle, font*/ 3328) {
6423
+ $$invalidate(3, style = [..._style.split(';'), ..._textStyle.split(';'), `font-family:${font}`].join(';'));
6424
+ }
6425
+
6426
+ if ($$self.$$.dirty & /*_focusStyle, _placeholderStyle*/ 4608) {
6427
+ $$invalidate(2, styleVariables = (() => {
6428
+ const variables = {};
6429
+ const focusStyleObj = parseStyle(_focusStyle);
6430
+ const placeholderStyle = parseStyle(_placeholderStyle);
6431
+ if (focusStyleObj['border-width']) variables['--focus-border-width'] = focusStyleObj['border-width'];
6432
+ if (focusStyleObj['border-color']) variables['--focus-border-color'] = focusStyleObj['border-color'];
6433
+ if (focusStyleObj['border-style']) variables['--focus-border-style'] = focusStyleObj['border-style'];
6434
+ if (placeholderStyle.color) variables['--placeholder-color'] = placeholderStyle.color;
6435
+ return stringifyStyleObj(variables);
6436
+ })());
6437
+ }
6330
6438
  };
6331
6439
 
6332
- return [required, rows, placeholder, $value, value, handleInput, name];
6440
+ return [
6441
+ placeholder,
6442
+ required,
6443
+ styleVariables,
6444
+ style,
6445
+ $value,
6446
+ value,
6447
+ handleInput,
6448
+ name,
6449
+ _style,
6450
+ _focusStyle,
6451
+ font,
6452
+ _textStyle,
6453
+ _placeholderStyle
6454
+ ];
6333
6455
  }
6334
6456
 
6335
6457
  class FormTextarea extends SvelteComponent {
@@ -6343,10 +6465,14 @@ class FormTextarea extends SvelteComponent {
6343
6465
  create_fragment$h,
6344
6466
  safe_not_equal,
6345
6467
  {
6346
- name: 6,
6347
- required: 0,
6348
- rows: 1,
6349
- placeholder: 2
6468
+ name: 7,
6469
+ placeholder: 0,
6470
+ required: 1,
6471
+ _style: 8,
6472
+ _focusStyle: 9,
6473
+ font: 10,
6474
+ _textStyle: 11,
6475
+ _placeholderStyle: 12
6350
6476
  },
6351
6477
  add_css$g
6352
6478
  );
@@ -6361,12 +6487,12 @@ function add_css$f(target) {
6361
6487
 
6362
6488
  function get_each_context$5(ctx, list, i) {
6363
6489
  const child_ctx = ctx.slice();
6364
- child_ctx[16] = list[i];
6365
- child_ctx[18] = i;
6490
+ child_ctx[17] = list[i];
6491
+ child_ctx[19] = i;
6366
6492
  return child_ctx;
6367
6493
  }
6368
6494
 
6369
- // (98:2) {#each _options as option, i}
6495
+ // (99:2) {#each _options as option, i}
6370
6496
  function create_each_block$5(ctx) {
6371
6497
  let label;
6372
6498
  let input;
@@ -6374,8 +6500,9 @@ function create_each_block$5(ctx) {
6374
6500
  let input_checked_value;
6375
6501
  let t0;
6376
6502
  let span;
6377
- let t1_value = /*option*/ ctx[16] + "";
6503
+ let t1_value = /*option*/ ctx[17] + "";
6378
6504
  let t1;
6505
+ let span_style_value;
6379
6506
  let t2;
6380
6507
  let mounted;
6381
6508
  let dispose;
@@ -6392,10 +6519,10 @@ function create_each_block$5(ctx) {
6392
6519
  attr(input, "class", "radio-button-input svelte-1ntb6j8");
6393
6520
  attr(input, "style", /*buttonStyle*/ ctx[5]);
6394
6521
  attr(input, "name", /*name*/ ctx[0]);
6395
- input.value = input_value_value = /*option*/ ctx[16];
6396
- input.checked = input_checked_value = /*option*/ ctx[16] === /*_value*/ ctx[3];
6522
+ input.value = input_value_value = /*option*/ ctx[17];
6523
+ input.checked = input_checked_value = /*option*/ ctx[17] === /*_value*/ ctx[3];
6397
6524
  attr(span, "class", "radio-button-text svelte-1ntb6j8");
6398
- attr(span, "style", /*_textStyle*/ ctx[2]);
6525
+ attr(span, "style", span_style_value = `${/*_textStyle*/ ctx[2]} ${/*fontCss*/ ctx[6]}`);
6399
6526
  attr(label, "class", "radio-button svelte-1ntb6j8");
6400
6527
  },
6401
6528
  m(target, anchor) {
@@ -6407,7 +6534,7 @@ function create_each_block$5(ctx) {
6407
6534
  append(label, t2);
6408
6535
 
6409
6536
  if (!mounted) {
6410
- dispose = listen(input, "change", /*handleChange*/ ctx[7](/*i*/ ctx[18]));
6537
+ dispose = listen(input, "change", /*handleChange*/ ctx[8](/*i*/ ctx[19]));
6411
6538
  mounted = true;
6412
6539
  }
6413
6540
  },
@@ -6422,18 +6549,18 @@ function create_each_block$5(ctx) {
6422
6549
  attr(input, "name", /*name*/ ctx[0]);
6423
6550
  }
6424
6551
 
6425
- if (dirty & /*_options*/ 16 && input_value_value !== (input_value_value = /*option*/ ctx[16])) {
6552
+ if (dirty & /*_options*/ 16 && input_value_value !== (input_value_value = /*option*/ ctx[17])) {
6426
6553
  input.value = input_value_value;
6427
6554
  }
6428
6555
 
6429
- if (dirty & /*_options, _value*/ 24 && input_checked_value !== (input_checked_value = /*option*/ ctx[16] === /*_value*/ ctx[3])) {
6556
+ if (dirty & /*_options, _value*/ 24 && input_checked_value !== (input_checked_value = /*option*/ ctx[17] === /*_value*/ ctx[3])) {
6430
6557
  input.checked = input_checked_value;
6431
6558
  }
6432
6559
 
6433
- if (dirty & /*_options*/ 16 && t1_value !== (t1_value = /*option*/ ctx[16] + "")) set_data(t1, t1_value);
6560
+ if (dirty & /*_options*/ 16 && t1_value !== (t1_value = /*option*/ ctx[17] + "")) set_data(t1, t1_value);
6434
6561
 
6435
- if (dirty & /*_textStyle*/ 4) {
6436
- attr(span, "style", /*_textStyle*/ ctx[2]);
6562
+ if (dirty & /*_textStyle*/ 4 && span_style_value !== (span_style_value = `${/*_textStyle*/ ctx[2]} ${/*fontCss*/ ctx[6]}`)) {
6563
+ attr(span, "style", span_style_value);
6437
6564
  }
6438
6565
  },
6439
6566
  d(detaching) {
@@ -6472,7 +6599,7 @@ function create_fragment$g(ctx) {
6472
6599
  }
6473
6600
  },
6474
6601
  p(ctx, [dirty]) {
6475
- if (dirty & /*_textStyle, _options, buttonStyle, name, _value, handleChange*/ 189) {
6602
+ if (dirty & /*_textStyle, fontCss, _options, buttonStyle, name, _value, handleChange*/ 381) {
6476
6603
  each_value = /*_options*/ ctx[4];
6477
6604
  let i;
6478
6605
 
@@ -6518,6 +6645,7 @@ function instance$g($$self, $$props, $$invalidate) {
6518
6645
  let { required = false } = $$props;
6519
6646
  let { _layoutStyle = 'flex-direction: column; gap: 0px;' } = $$props;
6520
6647
  let { font = SYSTEM_FONT } = $$props;
6648
+ const fontCss = font ? 'font-family:' + font : '';
6521
6649
  let { _textStyle = 'color: #333; font-size: 12px; line-height:1.5;' } = $$props;
6522
6650
  let { buttonSize = '16px' } = $$props;
6523
6651
  let { buttonColor = { main: '#f0f1f1', sub: '#f0f1f1' } } = $$props;
@@ -6534,7 +6662,7 @@ function instance$g($$self, $$props, $$invalidate) {
6534
6662
  }
6535
6663
  });
6536
6664
 
6537
- component_subscribe($$self, value, value => $$invalidate(14, $value = value));
6665
+ component_subscribe($$self, value, value => $$invalidate(15, $value = value));
6538
6666
 
6539
6667
  const handleChange = index => event => {
6540
6668
  if (event.target.checked) {
@@ -6544,26 +6672,26 @@ function instance$g($$self, $$props, $$invalidate) {
6544
6672
 
6545
6673
  $$self.$$set = $$props => {
6546
6674
  if ('name' in $$props) $$invalidate(0, name = $$props.name);
6547
- if ('options' in $$props) $$invalidate(8, options = $$props.options);
6548
- if ('required' in $$props) $$invalidate(9, required = $$props.required);
6675
+ if ('options' in $$props) $$invalidate(9, options = $$props.options);
6676
+ if ('required' in $$props) $$invalidate(10, required = $$props.required);
6549
6677
  if ('_layoutStyle' in $$props) $$invalidate(1, _layoutStyle = $$props._layoutStyle);
6550
- if ('font' in $$props) $$invalidate(10, font = $$props.font);
6678
+ if ('font' in $$props) $$invalidate(11, font = $$props.font);
6551
6679
  if ('_textStyle' in $$props) $$invalidate(2, _textStyle = $$props._textStyle);
6552
- if ('buttonSize' in $$props) $$invalidate(11, buttonSize = $$props.buttonSize);
6553
- if ('buttonColor' in $$props) $$invalidate(12, buttonColor = $$props.buttonColor);
6554
- if ('buttonColorActive' in $$props) $$invalidate(13, buttonColorActive = $$props.buttonColorActive);
6680
+ if ('buttonSize' in $$props) $$invalidate(12, buttonSize = $$props.buttonSize);
6681
+ if ('buttonColor' in $$props) $$invalidate(13, buttonColor = $$props.buttonColor);
6682
+ if ('buttonColorActive' in $$props) $$invalidate(14, buttonColorActive = $$props.buttonColorActive);
6555
6683
  };
6556
6684
 
6557
6685
  $$self.$$.update = () => {
6558
- if ($$self.$$.dirty & /*font*/ 1024) {
6686
+ if ($$self.$$.dirty & /*font*/ 2048) {
6559
6687
  addFont(font);
6560
6688
  }
6561
6689
 
6562
- if ($$self.$$.dirty & /*options*/ 256) {
6690
+ if ($$self.$$.dirty & /*options*/ 512) {
6563
6691
  $$invalidate(4, _options = options.split(','));
6564
6692
  }
6565
6693
 
6566
- if ($$self.$$.dirty & /*buttonColor, buttonColorActive, buttonSize*/ 14336) {
6694
+ if ($$self.$$.dirty & /*buttonColor, buttonColorActive, buttonSize*/ 28672) {
6567
6695
  $$invalidate(5, buttonStyle = (() => {
6568
6696
  return stringifyStyleObj({
6569
6697
  '--color-main': buttonColor.main,
@@ -6575,7 +6703,7 @@ function instance$g($$self, $$props, $$invalidate) {
6575
6703
  })());
6576
6704
  }
6577
6705
 
6578
- if ($$self.$$.dirty & /*$value*/ 16384) {
6706
+ if ($$self.$$.dirty & /*$value*/ 32768) {
6579
6707
  $$invalidate(3, _value = $value[0]);
6580
6708
  }
6581
6709
  };
@@ -6587,6 +6715,7 @@ function instance$g($$self, $$props, $$invalidate) {
6587
6715
  _value,
6588
6716
  _options,
6589
6717
  buttonStyle,
6718
+ fontCss,
6590
6719
  value,
6591
6720
  handleChange,
6592
6721
  options,
@@ -6611,14 +6740,14 @@ class FormRadioButtons extends SvelteComponent {
6611
6740
  safe_not_equal,
6612
6741
  {
6613
6742
  name: 0,
6614
- options: 8,
6615
- required: 9,
6743
+ options: 9,
6744
+ required: 10,
6616
6745
  _layoutStyle: 1,
6617
- font: 10,
6746
+ font: 11,
6618
6747
  _textStyle: 2,
6619
- buttonSize: 11,
6620
- buttonColor: 12,
6621
- buttonColorActive: 13
6748
+ buttonSize: 12,
6749
+ buttonColor: 13,
6750
+ buttonColorActive: 14
6622
6751
  },
6623
6752
  add_css$f
6624
6753
  );
@@ -6638,7 +6767,7 @@ function get_each_context$4(ctx, list, i) {
6638
6767
  return child_ctx;
6639
6768
  }
6640
6769
 
6641
- // (108:10) {:else}
6770
+ // (107:10) {:else}
6642
6771
  function create_else_block(ctx) {
6643
6772
  let t;
6644
6773
 
@@ -6658,7 +6787,7 @@ function create_else_block(ctx) {
6658
6787
  };
6659
6788
  }
6660
6789
 
6661
- // (106:10) {#if option}
6790
+ // (105:10) {#if option}
6662
6791
  function create_if_block$2(ctx) {
6663
6792
  let t_value = /*option*/ ctx[19] + "";
6664
6793
  let t;
@@ -6679,7 +6808,7 @@ function create_if_block$2(ctx) {
6679
6808
  };
6680
6809
  }
6681
6810
 
6682
- // (104:6) {#each _options as option, i}
6811
+ // (103:6) {#each _options as option, i}
6683
6812
  function create_each_block$4(ctx) {
6684
6813
  let option;
6685
6814
  let t;
@@ -6890,11 +7019,12 @@ function instance$f($$self, $$props, $$invalidate) {
6890
7019
  $$invalidate(1, _value = $value[0]);
6891
7020
  }
6892
7021
 
6893
- if ($$self.$$.dirty & /*_style, _textStyle, _value, _placeholderStyle*/ 25602) {
7022
+ if ($$self.$$.dirty & /*_style, _textStyle, _value, _placeholderStyle, font*/ 29698) {
6894
7023
  $$invalidate(3, style = [
6895
7024
  ..._style.split(';'),
6896
7025
  ..._textStyle.split(';'),
6897
- ...!_value ? _placeholderStyle.split(';') : []
7026
+ ...!_value ? _placeholderStyle.split(';') : [],
7027
+ `font-family:${font}`
6898
7028
  ].join(';'));
6899
7029
  }
6900
7030
 
@@ -6902,11 +7032,10 @@ function instance$f($$self, $$props, $$invalidate) {
6902
7032
  $$invalidate(2, styleVariables = (() => {
6903
7033
  const variables = {};
6904
7034
  const focusStyleObj = parseStyle(_focusStyle);
6905
- const placeholderStyle = parseStyle(_placeholderStyle);
7035
+ parseStyle(_placeholderStyle);
6906
7036
  if (focusStyleObj['border-width']) variables['--focus-border-width'] = focusStyleObj['border-width'];
6907
7037
  if (focusStyleObj['border-color']) variables['--focus-border-color'] = focusStyleObj['border-color'];
6908
7038
  if (focusStyleObj['border-style']) variables['--focus-border-style'] = focusStyleObj['border-style'];
6909
- if (placeholderStyle.color) variables['--placeholder-color'] = placeholderStyle.color;
6910
7039
  variables['--icon-color'] = iconColor;
6911
7040
  variables['--icon-size'] = iconSize;
6912
7041
  return stringifyStyleObj(variables);
@@ -7409,9 +7538,11 @@ function instance$d($$self, $$props, $$invalidate) {
7409
7538
  };
7410
7539
 
7411
7540
  function getTextButtonStyle(isActive) {
7412
- return isActive
7413
- ? [...buttonStyle.split(';'), ...buttonActiveStyle.split(';')].join(';')
7414
- : buttonStyle;
7541
+ return [
7542
+ ...buttonStyle.split(';'),
7543
+ `font-family:${font}`,
7544
+ ...isActive ? buttonActiveStyle : []
7545
+ ].join(';');
7415
7546
  }
7416
7547
 
7417
7548
  $$self.$$set = $$props => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaidev/karte-action-sdk",
3
- "version": "1.1.206",
3
+ "version": "1.1.207",
4
4
  "author": "Plaid Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "module": "./dist/index.es.js",